mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-15 15:58:57 +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;
|
\\ return true;
|
||||||
\\};
|
\\};
|
||||||
\\window.removeEventListener = function () {};
|
\\window.removeEventListener = function () {};
|
||||||
|
\\
|
||||||
|
\\console = [];
|
||||||
|
\\console.log = function () {
|
||||||
|
\\ console.push(...arguments);
|
||||||
|
\\};
|
||||||
;
|
;
|
||||||
res = try evalJS(js_env, alloc, init, "init");
|
res = try evalJS(js_env, alloc, init, "init");
|
||||||
if (!res.success) {
|
if (!res.success) {
|
||||||
@@ -247,6 +252,12 @@ fn runWPT(arena: *std.heap.ArenaAllocator, comptime apis: []jsruntime.API, f: []
|
|||||||
return res;
|
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.
|
// Check the final test status.
|
||||||
res = try evalJS(js_env, alloc, "report.status;", "teststatus");
|
res = try evalJS(js_env, alloc, "report.status;", "teststatus");
|
||||||
if (!res.success) {
|
if (!res.success) {
|
||||||
|
|||||||
Reference in New Issue
Block a user