Skip to content

Commit fb46756

Browse files
committed
fixup! test: enable multi-global WPTs
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
1 parent 4fd482e commit fb46756

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

test/common/wpt.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,7 @@ class WPTRunner {
992992
path: absolutePath,
993993
isAnyTest,
994994
initScript: this.initScript,
995+
title: meta.title,
995996
variant: spec.variant,
996997
scripts: meta.script?.map(
997998
(script) => this.resource.toRealFilePath(relativePath, script),

test/common/wpt/webworker.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ globalThis.onmessage = ({ data }) => {
114114
});
115115
}
116116

117+
if (data.title) {
118+
globalThis.META_TITLE = data.title;
119+
}
120+
117121
if (data.isAnyTest) {
118122
globalThis.importScripts('/resources/testharness.js');
119123
for (const script of data.scripts) {

test/parallel/test-common-wpt-backends.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,18 @@ async function main() {
130130
runDriver(driver, spec, 'process'),
131131
);
132132
}
133+
134+
const windowResults = runDriver(
135+
'test-events.js',
136+
'dom/events/Event-constructors.any.html',
137+
'thread',
138+
);
139+
const workerResults = runDriver(
140+
'test-events.js',
141+
'dom/events/Event-constructors.any.worker.html',
142+
'thread',
143+
).map((line) => line.replace('.any.worker.html', '.any.html'));
144+
assert.deepStrictEqual(workerResults, windowResults);
133145
}
134146

135147
main().then(common.mustCall());

0 commit comments

Comments
 (0)