mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
wpt: update test runner
This commit is contained in:
@@ -4,7 +4,6 @@ const parser = @import("netsurf.zig");
|
|||||||
const jsruntime = @import("jsruntime");
|
const jsruntime = @import("jsruntime");
|
||||||
|
|
||||||
const public = @import("jsruntime");
|
const public = @import("jsruntime");
|
||||||
const API = public.API;
|
|
||||||
const TPL = public.TPL;
|
const TPL = public.TPL;
|
||||||
const Env = public.Env;
|
const Env = public.Env;
|
||||||
const Loop = public.Loop;
|
const Loop = public.Loop;
|
||||||
@@ -152,6 +151,10 @@ fn runWPT(arena: *std.heap.ArenaAllocator, f: []const u8, loader: *FileLoader) !
|
|||||||
// add document object
|
// add document object
|
||||||
try js_env.addObject(apis, doc, "document");
|
try js_env.addObject(apis, doc, "document");
|
||||||
|
|
||||||
|
// alias global as self and window
|
||||||
|
try js_env.attachObject(try js_env.getGlobal(), "self", null);
|
||||||
|
try js_env.attachObject(try js_env.getGlobal(), "window", null);
|
||||||
|
|
||||||
var res = jsruntime.JSResult{};
|
var res = jsruntime.JSResult{};
|
||||||
var cbk_res = jsruntime.JSResult{
|
var cbk_res = jsruntime.JSResult{
|
||||||
.success = true,
|
.success = true,
|
||||||
@@ -160,10 +163,8 @@ fn runWPT(arena: *std.heap.ArenaAllocator, f: []const u8, loader: *FileLoader) !
|
|||||||
};
|
};
|
||||||
|
|
||||||
const init =
|
const init =
|
||||||
\\var window = this;
|
|
||||||
\\window.listeners = [];
|
\\window.listeners = [];
|
||||||
\\window.document = document;
|
\\window.document = document;
|
||||||
\\window.self = window;
|
|
||||||
\\window.parent = window;
|
\\window.parent = window;
|
||||||
\\window.addEventListener = function (type, listener, options) {
|
\\window.addEventListener = function (type, listener, options) {
|
||||||
\\ window.listeners.push({type: type, listener: listener, options: options});
|
\\ window.listeners.push({type: type, listener: listener, options: options});
|
||||||
|
|||||||
Reference in New Issue
Block a user