Skip to content

Commit

Permalink
test: stop faking performance idlharness
Browse files Browse the repository at this point in the history
PR-URL: #46794
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
  • Loading branch information
panva authored Feb 25, 2023
1 parent 70cdc5d commit f359614
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 33 deletions.
30 changes: 0 additions & 30 deletions test/common/wpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
7 changes: 7 additions & 0 deletions test/wpt/status/hr-time.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"idlharness.any.js": {
"fail": {
"expected": [
"Window interface: attribute performance"
]
}
},
"window-worker-timeOrigin.window.js": {
"skip": "depends on URL.createObjectURL(blob)"
}
Expand Down
1 change: 0 additions & 1 deletion test/wpt/test-hr-time.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ const { WPTRunner } = require('../common/wpt');
const runner = new WPTRunner('hr-time');

runner.pretendGlobalThisAs('Window');
runner.brandCheckGlobalScopeAttribute('performance');

runner.runJsTests();
1 change: 0 additions & 1 deletion test/wpt/test-performance-timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion test/wpt/test-user-timing.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ const { WPTRunner } = require('../common/wpt');
const runner = new WPTRunner('user-timing');

runner.pretendGlobalThisAs('Window');
runner.brandCheckGlobalScopeAttribute('performance');

runner.runJsTests();

0 comments on commit f359614

Please sign in to comment.