Skip to content

Commit 76a9634

Browse files
panvatargos
authored andcommitted
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

Lines changed: 1 addition & 3 deletions
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

Lines changed: 3 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy