From a23fcfd722560ed8056e07595a5dbb929d99051c Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Thu, 23 Feb 2023 16:51:00 +0100 Subject: [PATCH] test: isolate hr-time specific wpt global init --- test/common/wpt.js | 4 +--- test/wpt/test-hr-time.js | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) 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');