Skip to content

Commit f0ec5df

Browse files
committed
cleanup test-* files
1 parent cd03a0f commit f0ec5df

34 files changed

+95
-127
lines changed

test/common/wpt.js

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,7 @@ class WPTRunner {
489489
pretendGlobalThisAs(name) {
490490
switch (name) {
491491
case 'Window': {
492-
this.globalThisInitScripts.push(
493-
`global.Window = Object.getPrototypeOf(globalThis).constructor;
494-
self.GLOBAL.isWorker = () => false;`);
492+
this.globalThisInitScripts.push('globalThis.Window = Object.getPrototypeOf(globalThis).constructor;');
495493
this.loadLazyGlobals();
496494
break;
497495
}
@@ -531,39 +529,10 @@ class WPTRunner {
531529
this.globalThisInitScripts.push(script);
532530
}
533531

534-
brandCheckGlobalScopeAttribute(name) {
535-
// TODO(legendecas): idlharness GlobalScope attribute receiver validation.
536-
const script = `
537-
const desc = Object.getOwnPropertyDescriptor(globalThis, '${name}');
538-
function getter() {
539-
// Mimic GlobalScope instance brand check.
540-
if (this !== globalThis) {
541-
throw new TypeError('Illegal invocation');
542-
}
543-
return desc.get();
544-
}
545-
Object.defineProperty(getter, 'name', { value: 'get ${name}' });
546-
547-
function setter(value) {
548-
// Mimic GlobalScope instance brand check.
549-
if (this !== globalThis) {
550-
throw new TypeError('Illegal invocation');
551-
}
552-
desc.set(value);
553-
}
554-
Object.defineProperty(setter, 'name', { value: 'set ${name}' });
555-
556-
Object.defineProperty(globalThis, '${name}', {
557-
get: getter,
558-
set: setter,
559-
});
560-
`;
561-
this.globalThisInitScripts.push(script);
562-
}
563-
564532
// TODO(joyeecheung): work with the upstream to port more tests in .html
565533
// to .js.
566534
async runJsTests() {
535+
this.pretendGlobalThisAs('Window');
567536
let queue = [];
568537

569538
// If the tests are run as `node test/wpt/test-something.js subset.any.js`,

test/wpt/.eslintrc.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
rules:
2+
node-core/required-modules: off
3+
node-core/require-common-first: off

test/wpt/status/FileAPI/blob.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"ArrayBuffer elements of the blobParts array should be supported.",
1818
"Passing typed arrays as elements of the blobParts array should work.",
1919
"Passing a Float64Array as element of the blobParts array should work.",
20+
"Passing BigInt typed arrays as elements of the blobParts array should work.",
2021
"Array with two blobs",
2122
"Array with two buffers",
2223
"Array with two bufferviews",
@@ -43,5 +44,12 @@
4344
},
4445
"Blob-slice.any.js": {
4546
"skip": "Depends on File API"
47+
},
48+
"Blob-stream.any.js": {
49+
"fail": {
50+
"expected": [
51+
"Reading Blob.stream() with BYOB reader"
52+
]
53+
}
4654
}
4755
}

test/wpt/status/dom/events.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
"event-global-set-before-handleEvent-lookup.window.js": {
2424
"skip": "window is not defined"
2525
},
26-
"event-global.worker.js": {
27-
"skip": "importScripts is not defined"
28-
},
2926
"legacy-pre-activation-behavior.window.js": {
3027
"skip": "document is not defined"
3128
},

test/wpt/status/encoding.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
"streams/realms.window.js": {
5252
"skip": "window is not defined"
5353
},
54+
"streams/invalid-realm.window.js": {
55+
"skip": "document is not defined"
56+
},
5457
"streams/decode-attributes.any.js": {
5558
"requires": ["full-icu"]
5659
},

test/wpt/status/hr-time.json

Lines changed: 7 additions & 0 deletions
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
}
Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
11
{
22
"structured-clone.any.js": {
33
"fail": {
4-
"expected": ["File basic"]
4+
"expected": [
5+
"File basic",
6+
"Serializing a non-serializable platform object fails",
7+
"A subclass instance will deserialize as its closest serializable superclass",
8+
"Resizable ArrayBuffer",
9+
"Growable SharedArrayBuffer",
10+
"Length-tracking TypedArray",
11+
"Length-tracking DataView",
12+
"Serializing OOB TypedArray throws",
13+
"Serializing OOB DataView throws",
14+
"A detached ArrayBuffer cannot be transferred",
15+
"Transferring a non-transferable platform object fails",
16+
"Resizable ArrayBuffer is transferable",
17+
"Length-tracking TypedArray is transferable",
18+
"Length-tracking DataView is transferable",
19+
"Transferring OOB TypedArray throws",
20+
"Transferring OOB DataView throws"
21+
]
522
}
623
}
724
}

test/wpt/status/html/webappapis/timers.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"evil-spec-example.any.js": {
3+
"skip": "Node.js validates setTimeout arguments using its own validators, not WebIDL"
4+
},
25
"negative-settimeout.any.js": {
36
"skip": "unreliable in Node.js; Refs: https://github.com/nodejs/node/issues/37672"
47
}

test/wpt/status/performance-timeline.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
]
88
}
99
},
10+
"droppedentriescount.any.js": {
11+
"skip": "depends on relative-path fetch()"
12+
},
1013
"webtiming-resolution.any.js": {
1114
"skip": "flaky"
1215
}

test/wpt/status/resource-timing.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
{
2+
"idlharness.any.js": {
3+
"fail": {
4+
"expected": [
5+
"PerformanceResourceTiming interface: attribute responseStatus",
6+
"PerformanceResourceTiming interface: attribute renderBlockingStatus",
7+
"PerformanceResourceTiming interface: resource must inherit property \"responseStatus\" with the proper type",
8+
"PerformanceResourceTiming interface: resource must inherit property \"renderBlockingStatus\" with the proper type",
9+
"PerformanceResourceTiming interface: default toJSON operation on resource"
10+
]
11+
}
12+
},
213
"cors-preflight.any.js": {
314
"skip": "Browser-specific test"
415
},

0 commit comments

Comments
 (0)