mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
explicitly load testing.js
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
<script src="../testing.js"></script>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<iframe src="https://httpbin.io/html" title="iframea"></iframe>
|
<iframe src="https://httpbin.io/html" title="iframea"></iframe>
|
||||||
<iframe src="https://httpbin.io/html" title="iframeb"></iframe>
|
<iframe src="https://httpbin.io/html" title="iframeb"></iframe>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<script src="../testing.js"></script>
|
||||||
<body></body>
|
<body></body>
|
||||||
<script id=aliases>
|
<script id=aliases>
|
||||||
testing.expectEqual(window, window.self);
|
testing.expectEqual(window, window.self);
|
||||||
|
|||||||
@@ -516,18 +516,6 @@ pub fn newRunner(file: []const u8) !void {
|
|||||||
try_catch.init(js_context);
|
try_catch.init(js_context);
|
||||||
defer try_catch.deinit();
|
defer try_catch.deinit();
|
||||||
|
|
||||||
// if you want to make a lot of changes to testing.js, but don't want to reload
|
|
||||||
// every time, use this to dynamically load it during development
|
|
||||||
const content = try std.fs.cwd().readFileAlloc(arena_allocator, "src/browser/tests/testing.js", 1024 * 32);
|
|
||||||
|
|
||||||
// const content = @embedFile("browser/tests/testing.js");
|
|
||||||
|
|
||||||
js_context.eval(content, "testing.js") catch |err| {
|
|
||||||
const msg = try_catch.err(arena_allocator) catch @errorName(err) orelse "unknown";
|
|
||||||
std.debug.print("Failed to setup testing.js: {s}\n", .{msg});
|
|
||||||
return err;
|
|
||||||
};
|
|
||||||
|
|
||||||
const url = try std.fmt.allocPrint(arena_allocator, "http://localhost:9582/src/browser/tests/{s}", .{file});
|
const url = try std.fmt.allocPrint(arena_allocator, "http://localhost:9582/src/browser/tests/{s}", .{file});
|
||||||
try page.navigate(url, .{});
|
try page.navigate(url, .{});
|
||||||
page.wait(2);
|
page.wait(2);
|
||||||
|
|||||||
Reference in New Issue
Block a user