summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/common/wpt.js4
-rw-r--r--test/wpt/test-whatwg-console.js2
-rw-r--r--test/wpt/test-whatwg-url.js2
3 files changed, 5 insertions, 3 deletions
diff --git a/test/common/wpt.js b/test/common/wpt.js
index 59dbe26d2a..4f2f39c8e5 100644
--- a/test/common/wpt.js
+++ b/test/common/wpt.js
@@ -280,7 +280,9 @@ class WPTRunner {
sandbox.self = sandbox;
// TODO(joyeecheung): we are not a window - work with the upstream to
// add a new scope for us.
- sandbox.document = {}; // Pretend we are Window
+
+ const { Worker } = require('worker_threads');
+ sandbox.DedicatedWorker = Worker; // Pretend we are a Worker
return context;
}
diff --git a/test/wpt/test-whatwg-console.js b/test/wpt/test-whatwg-console.js
index 7b23fe8d3e..15fb80fc96 100644
--- a/test/wpt/test-whatwg-console.js
+++ b/test/wpt/test-whatwg-console.js
@@ -1,6 +1,6 @@
'use strict';
-// Flags: --expose-internals
+// Flags: --expose-internals --experimental-worker
require('../common');
const { WPTRunner } = require('../common/wpt');
diff --git a/test/wpt/test-whatwg-url.js b/test/wpt/test-whatwg-url.js
index 8734452940..fbbea24532 100644
--- a/test/wpt/test-whatwg-url.js
+++ b/test/wpt/test-whatwg-url.js
@@ -1,6 +1,6 @@
'use strict';
-// Flags: --expose-internals
+// Flags: --expose-internals --experimental-worker
require('../common');
const { WPTRunner } = require('../common/wpt');