mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
wpt: add a console.log debug message
This commit is contained in:
@@ -205,6 +205,11 @@ fn runWPT(arena: *std.heap.ArenaAllocator, comptime apis: []jsruntime.API, f: []
|
||||
\\ return true;
|
||||
\\};
|
||||
\\window.removeEventListener = function () {};
|
||||
\\
|
||||
\\console = [];
|
||||
\\console.log = function () {
|
||||
\\ console.push(...arguments);
|
||||
\\};
|
||||
;
|
||||
res = try evalJS(js_env, alloc, init, "init");
|
||||
if (!res.success) {
|
||||
@@ -247,6 +252,12 @@ fn runWPT(arena: *std.heap.ArenaAllocator, comptime apis: []jsruntime.API, f: []
|
||||
return res;
|
||||
}
|
||||
|
||||
// display console logs
|
||||
res = try evalJS(js_env, alloc, "console.join(', ');", "console");
|
||||
if (res.result.len > 0) {
|
||||
std.debug.print("-- CONSOLE LOG\n{s}\n--\n", .{res.result});
|
||||
}
|
||||
|
||||
// Check the final test status.
|
||||
res = try evalJS(js_env, alloc, "report.status;", "teststatus");
|
||||
if (!res.success) {
|
||||
|
||||
Reference in New Issue
Block a user