Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: stop faking performance idlharness #46794

Merged
merged 1 commit into from
Feb 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();