Skip to content

Commit 76a9634

Browse files
panvatargos
authored andcommittedMar 13, 2023
test: isolate hr-time specific wpt global init
PR-URL: #46795 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent 3daf508 commit 76a9634

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed
 

‎test/common/wpt.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -484,9 +484,7 @@ class WPTRunner {
484484
pretendGlobalThisAs(name) {
485485
switch (name) {
486486
case 'Window': {
487-
this.globalThisInitScripts.push(
488-
`global.Window = Object.getPrototypeOf(globalThis).constructor;
489-
self.GLOBAL.isWorker = () => false;`);
487+
this.globalThisInitScripts.push('globalThis.Window = Object.getPrototypeOf(globalThis).constructor;');
490488
this.loadLazyGlobals();
491489
break;
492490
}

‎test/wpt/test-hr-time.js

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ const { WPTRunner } = require('../common/wpt');
55

66
const runner = new WPTRunner('hr-time');
77

8+
runner.setInitScript(`
9+
self.GLOBAL.isWorker = () => false;
10+
`);
811
runner.pretendGlobalThisAs('Window');
912

1013
runner.runJsTests();

0 commit comments

Comments
 (0)