Skip to content

Commit 3daf508

Browse files
panvatargos
authored andcommitted
test: stop faking performance idlharness
PR-URL: #46794 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent c7f056c commit 3daf508

File tree

5 files changed

+7
-33
lines changed

5 files changed

+7
-33
lines changed

test/common/wpt.js

-30
Original file line numberDiff line numberDiff line change
@@ -526,36 +526,6 @@ class WPTRunner {
526526
this.globalThisInitScripts.push(script);
527527
}
528528

529-
brandCheckGlobalScopeAttribute(name) {
530-
// TODO(legendecas): idlharness GlobalScope attribute receiver validation.
531-
const script = `
532-
const desc = Object.getOwnPropertyDescriptor(globalThis, '${name}');
533-
function getter() {
534-
// Mimic GlobalScope instance brand check.
535-
if (this !== globalThis) {
536-
throw new TypeError('Illegal invocation');
537-
}
538-
return desc.get();
539-
}
540-
Object.defineProperty(getter, 'name', { value: 'get ${name}' });
541-
542-
function setter(value) {
543-
// Mimic GlobalScope instance brand check.
544-
if (this !== globalThis) {
545-
throw new TypeError('Illegal invocation');
546-
}
547-
desc.set(value);
548-
}
549-
Object.defineProperty(setter, 'name', { value: 'set ${name}' });
550-
551-
Object.defineProperty(globalThis, '${name}', {
552-
get: getter,
553-
set: setter,
554-
});
555-
`;
556-
this.globalThisInitScripts.push(script);
557-
}
558-
559529
// TODO(joyeecheung): work with the upstream to port more tests in .html
560530
// to .js.
561531
async runJsTests() {

test/wpt/status/hr-time.json

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
{
2+
"idlharness.any.js": {
3+
"fail": {
4+
"expected": [
5+
"Window interface: attribute performance"
6+
]
7+
}
8+
},
29
"window-worker-timeOrigin.window.js": {
310
"skip": "depends on URL.createObjectURL(blob)"
411
}

test/wpt/test-hr-time.js

-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ const { WPTRunner } = require('../common/wpt');
66
const runner = new WPTRunner('hr-time');
77

88
runner.pretendGlobalThisAs('Window');
9-
runner.brandCheckGlobalScopeAttribute('performance');
109

1110
runner.runJsTests();

test/wpt/test-performance-timeline.js

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const { WPTRunner } = require('../common/wpt');
55
const runner = new WPTRunner('performance-timeline');
66

77
runner.pretendGlobalThisAs('Window');
8-
runner.brandCheckGlobalScopeAttribute('performance');
98
runner.setInitScript(`
109
// Create a dummy resource timing entry to mimic how the browser would
1110
// record the initial page load.

test/wpt/test-user-timing.js

-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ const { WPTRunner } = require('../common/wpt');
66
const runner = new WPTRunner('user-timing');
77

88
runner.pretendGlobalThisAs('Window');
9-
runner.brandCheckGlobalScopeAttribute('performance');
109

1110
runner.runJsTests();

0 commit comments

Comments
 (0)