Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 76a9634

Browse filesBrowse 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
Copy full SHA for 76a9634

File tree

Expand file treeCollapse file tree

2 files changed

+4
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+4
-3
lines changed
Open diff view settings
Collapse file

‎test/common/wpt.js‎

Copy file name to clipboardExpand all lines: test/common/wpt.js
+1-3Lines 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
}
Collapse file

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

Copy file name to clipboardExpand all lines: test/wpt/test-hr-time.js
+3Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.