From f3596146bbf7a46ac4d458f82b410f8c40b62b47 Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Sat, 25 Feb 2023 16:49:48 +0100 Subject: [PATCH] test: stop faking performance idlharness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/46794 Reviewed-By: Chengzhong Wu Reviewed-By: James M Snell Reviewed-By: Michaƫl Zasso --- test/common/wpt.js | 30 --------------------------- test/wpt/status/hr-time.json | 7 +++++++ test/wpt/test-hr-time.js | 1 - test/wpt/test-performance-timeline.js | 1 - test/wpt/test-user-timing.js | 1 - 5 files changed, 7 insertions(+), 33 deletions(-) diff --git a/test/common/wpt.js b/test/common/wpt.js index 964862248c91c9..1978b266c045f7 100644 --- a/test/common/wpt.js +++ b/test/common/wpt.js @@ -526,36 +526,6 @@ class WPTRunner { this.globalThisInitScripts.push(script); } - brandCheckGlobalScopeAttribute(name) { - // TODO(legendecas): idlharness GlobalScope attribute receiver validation. - const script = ` - const desc = Object.getOwnPropertyDescriptor(globalThis, '${name}'); - function getter() { - // Mimic GlobalScope instance brand check. - if (this !== globalThis) { - throw new TypeError('Illegal invocation'); - } - return desc.get(); - } - Object.defineProperty(getter, 'name', { value: 'get ${name}' }); - - function setter(value) { - // Mimic GlobalScope instance brand check. - if (this !== globalThis) { - throw new TypeError('Illegal invocation'); - } - desc.set(value); - } - Object.defineProperty(setter, 'name', { value: 'set ${name}' }); - - Object.defineProperty(globalThis, '${name}', { - get: getter, - set: setter, - }); - `; - this.globalThisInitScripts.push(script); - } - // TODO(joyeecheung): work with the upstream to port more tests in .html // to .js. async runJsTests() { diff --git a/test/wpt/status/hr-time.json b/test/wpt/status/hr-time.json index 973e32b298a557..a2940656dbe80e 100644 --- a/test/wpt/status/hr-time.json +++ b/test/wpt/status/hr-time.json @@ -1,4 +1,11 @@ { + "idlharness.any.js": { + "fail": { + "expected": [ + "Window interface: attribute performance" + ] + } + }, "window-worker-timeOrigin.window.js": { "skip": "depends on URL.createObjectURL(blob)" } diff --git a/test/wpt/test-hr-time.js b/test/wpt/test-hr-time.js index 8900e8617bbc1d..f9dc5f0bc3211d 100644 --- a/test/wpt/test-hr-time.js +++ b/test/wpt/test-hr-time.js @@ -6,6 +6,5 @@ const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('hr-time'); runner.pretendGlobalThisAs('Window'); -runner.brandCheckGlobalScopeAttribute('performance'); runner.runJsTests(); diff --git a/test/wpt/test-performance-timeline.js b/test/wpt/test-performance-timeline.js index 89dfcaf5755bb2..7752a4e72f1b0c 100644 --- a/test/wpt/test-performance-timeline.js +++ b/test/wpt/test-performance-timeline.js @@ -5,7 +5,6 @@ const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('performance-timeline'); runner.pretendGlobalThisAs('Window'); -runner.brandCheckGlobalScopeAttribute('performance'); runner.setInitScript(` // Create a dummy resource timing entry to mimic how the browser would // record the initial page load. diff --git a/test/wpt/test-user-timing.js b/test/wpt/test-user-timing.js index 8c3c3812430514..45173142461d8c 100644 --- a/test/wpt/test-user-timing.js +++ b/test/wpt/test-user-timing.js @@ -6,6 +6,5 @@ const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('user-timing'); runner.pretendGlobalThisAs('Window'); -runner.brandCheckGlobalScopeAttribute('performance'); runner.runJsTests();