diff --git a/test/common/wpt.js b/test/common/wpt.js index 964862248c91c9..694e489058a486 100644 --- a/test/common/wpt.js +++ b/test/common/wpt.js @@ -484,9 +484,7 @@ class WPTRunner { pretendGlobalThisAs(name) { switch (name) { case 'Window': { - this.globalThisInitScripts.push( - `global.Window = Object.getPrototypeOf(globalThis).constructor; - self.GLOBAL.isWorker = () => false;`); + this.globalThisInitScripts.push('globalThis.Window = Object.getPrototypeOf(globalThis).constructor;'); this.loadLazyGlobals(); break; } diff --git a/test/wpt/test-hr-time.js b/test/wpt/test-hr-time.js index 8900e8617bbc1d..d853fff8fb3eca 100644 --- a/test/wpt/test-hr-time.js +++ b/test/wpt/test-hr-time.js @@ -5,6 +5,9 @@ const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('hr-time'); +runner.setInitScript(` + self.GLOBAL.isWorker = () => false; +`); runner.pretendGlobalThisAs('Window'); runner.brandCheckGlobalScopeAttribute('performance');