Skip to content

Commit

Permalink
[Squash] Fixup additional wpt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Jun 25, 2021
1 parent 36f2992 commit bd86655
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
5 changes: 1 addition & 4 deletions test/wpt/status/streams.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
"readable-byte-streams/bad-buffers-and-views.any.js": {
"fail": "TODO: implement detached ArrayBuffer support"
},
"readable-byte-streams/enqueue-with-detached-buffer.window.js": {
"fail": "There's no global postMessage. Don't skip because there are other relevant tests"
},
"readable-byte-streams/non-transferable-buffers.any.js": {
"fail": "Needs more investigation"
"fail": "Test is buggy - /~https://github.com/web-platform-tests/wpt/issues/29500"
}
}
20 changes: 7 additions & 13 deletions test/wpt/test-streams.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,6 @@ runner.setInitScript(`
const { internalBinding } = require('internal/test/binding');
const { DOMException } = internalBinding('messaging');
global.DOMException = DOMException;
// global.ReadableStream = ReadableStream;
// global.ReadableStreamDefaultReader = ReadableStreamDefaultReader;
// global.ReadableStreamBYOBReader = ReadableStreamBYOBReader;
// global.ReadableStreamBYOBRequest = ReadableStreamBYOBRequest;
// global.ReadableByteStreamController = ReadableByteStreamController;
// global.ReadableStreamDefaultController = ReadableStreamDefaultController;
// global.TransformStream = TransformStream;
// global.TransformStreamDefaultController = TransformStreamDefaultController;
// global.WritableStream = WritableStream;
// global.WritableStreamDefaultWriter = WritableStreamDefaultWriter;
// global.WritableStreamDefaultController = WritableStreamDefaultController;
// global.ByteLengthQueuingStrategy = ByteLengthQueuingStrategy;
// global.CountQueuingStrategy = CountQueuingStrategy;
Object.defineProperties(global, {
ReadableStream: {
Expand Down Expand Up @@ -123,6 +110,13 @@ runner.setInitScript(`
enumerable: false,
},
});
// Simulate global postMessage for enqueue-with-detached-buffer.window.js
function postMessage(value, origin, transferList) {
const mc = new MessageChannel();
mc.port1.postMessage(value, transferList);
mc.port2.close();
}
`);

runner.runJsTests();

0 comments on commit bd86655

Please sign in to comment.