Diff
Modified: trunk/LayoutTests/ChangeLog (288610 => 288611)
--- trunk/LayoutTests/ChangeLog 2022-01-26 09:25:24 UTC (rev 288610)
+++ trunk/LayoutTests/ChangeLog 2022-01-26 09:47:11 UTC (rev 288611)
@@ -1,3 +1,23 @@
+2022-01-26 Kimmo Kinnunen <[email protected]>
+
+ Streams tests try to call ReadableStream.prototype.pipeThrough.call generically
+ https://bugs.webkit.org/show_bug.cgi?id=235560
+
+ Reviewed by Youenn Fablet.
+
+ ReadableStream methods are nowadays defined to accept only ReadableStream instances.
+ Tests sometimes assert that an exception is thrown. However, the exception being actually thrown is different.
+ Future testharness.js will check the exception and the test will fail.
+
+ * TestExpectations:
+ * platform/win/TestExpectations:
+ * streams/brand-checks-expected.txt: Removed.
+ * streams/brand-checks.html: Removed.
+ * streams/readable-stream-pipeThrough-expected.txt: Removed.
+ * streams/readable-stream-pipeThrough.html: Removed.
+ * streams/reference-implementation/brand-checks-expected.txt: Removed.
+ * streams/reference-implementation/brand-checks.html: Removed.
+
2022-01-25 Fujii Hironori <[email protected]>
[WinCairo] Unreviewed test gardening
Modified: trunk/LayoutTests/TestExpectations (288610 => 288611)
--- trunk/LayoutTests/TestExpectations 2022-01-26 09:25:24 UTC (rev 288610)
+++ trunk/LayoutTests/TestExpectations 2022-01-26 09:47:11 UTC (rev 288611)
@@ -1530,7 +1530,6 @@
http/tests/loading/text-content-type-with-binary-extension.html [ Pass Failure ]
# Tests that are flakey due to unhandled promise rejection error messages
-webkit.org/b/171094 streams/brand-checks.html [ Pass Failure ]
webkit.org/b/171094 streams/reference-implementation/abstract-ops.html [ Pass Failure ]
# WPT tests that fail after doing full test repository reimport and need further investigation
Modified: trunk/LayoutTests/platform/win/TestExpectations (288610 => 288611)
--- trunk/LayoutTests/platform/win/TestExpectations 2022-01-26 09:25:24 UTC (rev 288610)
+++ trunk/LayoutTests/platform/win/TestExpectations 2022-01-26 09:47:11 UTC (rev 288611)
@@ -3545,7 +3545,6 @@
streams/readable-stream-byob-request-worker.html [ Failure ]
streams/reference-implementation/bad-strategies.html [ Failure ]
streams/reference-implementation/bad-underlying-sinks.html [ Failure ]
-streams/reference-implementation/brand-checks.html [ Failure ]
streams/reference-implementation/byte-length-queuing-strategy.html [ Failure ]
streams/reference-implementation/count-queuing-strategy.html [ Failure ]
streams/reference-implementation/readable-stream-templated.html [ Failure ]
Deleted: trunk/LayoutTests/streams/brand-checks-expected.txt (288610 => 288611)
--- trunk/LayoutTests/streams/brand-checks-expected.txt 2022-01-26 09:25:24 UTC (rev 288610)
+++ trunk/LayoutTests/streams/brand-checks-expected.txt 2022-01-26 09:47:11 UTC (rev 288611)
@@ -1,6 +0,0 @@
-
-PASS ReadableStream.prototype.pipeThrough works generically on its this and its arguments
-PASS ReadableStream.prototype.pipeTo works generically on its this and its arguments
-PASS ByteLengthQueuingStrategy.prototype.size should work generically on its this and its arguments
-PASS CountQueuingStrategy.prototype.size should work generically on its this and its arguments
-
Deleted: trunk/LayoutTests/streams/brand-checks.html (288610 => 288611)
--- trunk/LayoutTests/streams/brand-checks.html 2022-01-26 09:25:24 UTC (rev 288610)
+++ trunk/LayoutTests/streams/brand-checks.html 2022-01-26 09:47:11 UTC (rev 288611)
@@ -1,77 +0,0 @@
-<!DOCTYPE html>
-<script src=''></script>
-<script src=''></script>
-<script src=''></script>
-<script>
-// This is updated till https://github.com/whatwg/streams/commit/4ba861e6f60c248060811830e11271c84b439cc3
-
-let ReadableStreamDefaultReader = (new ReadableStream()).getReader().constructor;
-
-function fakeWritableStream() {
- return {
- get closed() { return Promise.resolve(); },
- get ready() { return Promise.resolve(); },
- get state() { return 'closed' },
- abort(reason) { return Promise.resolve(); },
- close() { return Promise.resolve(); },
- write(chunk) { return Promise.resolve(); }
- };
-}
-
-function realReadableStream() {
- return new ReadableStream();
-}
-
-function fakeReadableStream() {
- return {
- cancel: function(reason) { return Promise.resolve(); },
- getReader: function() { return new ReadableStreamDefaultReader(new ReadableStream()); },
- pipeThrough: function(obj, options) { return obj.readable; },
- pipeTo: function() { return Promise.resolve(); },
- tee: function() { return [realReadableStream(), realReadableStream()]; }
- };
-}
-
-test(function() {
- var pipeToArguments;
- var thisValue = {
- pipeTo: function() {
- pipeToArguments = arguments;
- }
- };
-
- var input = { readable: {}, writable: {} };
- var options = {};
- var result = ReadableStream.prototype.pipeThrough.call(thisValue, input, options);
-
- assert_array_equals(pipeToArguments, [input.writable, options], 'correct arguments should be passed to thisValue.pipeTo');
- assert_equals(result, input.readable, 'return value should be the passed readable property');
-}, 'ReadableStream.prototype.pipeThrough works generically on its this and its arguments');
-
-test(function() {
- ReadableStream.prototype.pipeTo.call(fakeReadableStream(), fakeWritableStream()); // Check it does not throw.
-}, 'ReadableStream.prototype.pipeTo works generically on its this and its arguments');
-
-test(function() {
- var thisValue = null;
- var returnValue = { 'returned from': 'byteLength getter' };
- var chunk = {
- get byteLength() {
- return returnValue;
- }
- };
-
- assert_equals(ByteLengthQueuingStrategy.prototype.size.call(thisValue, chunk), returnValue);
-}, 'ByteLengthQueuingStrategy.prototype.size should work generically on its this and its arguments');
-
-test(function() {
- var thisValue = null;
- var chunk = {
- get byteLength() {
- throw new TypeError('shouldn\'t be called');
- }
- };
-
- assert_equals(CountQueuingStrategy.prototype.size.call(thisValue, chunk), 1);
-}, 'CountQueuingStrategy.prototype.size should work generically on its this and its arguments');
-</script>
Deleted: trunk/LayoutTests/streams/readable-stream-pipeThrough-expected.txt (288610 => 288611)
--- trunk/LayoutTests/streams/readable-stream-pipeThrough-expected.txt 2022-01-26 09:25:24 UTC (rev 288610)
+++ trunk/LayoutTests/streams/readable-stream-pipeThrough-expected.txt 2022-01-26 09:47:11 UTC (rev 288611)
@@ -1,5 +0,0 @@
-
-PASS ReadableStream.prototype.pipeThrough should throw when "this" has no pipeTo method
-PASS ReadableStream.prototype.pipeThrough should throw when passed argument is not an object
-PASS ReadableStream.prototype.pipeThrough should throw when called getters are throwing
-
Deleted: trunk/LayoutTests/streams/readable-stream-pipeThrough.html (288610 => 288611)
--- trunk/LayoutTests/streams/readable-stream-pipeThrough.html 2022-01-26 09:25:24 UTC (rev 288610)
+++ trunk/LayoutTests/streams/readable-stream-pipeThrough.html 2022-01-26 09:47:11 UTC (rev 288611)
@@ -1,67 +0,0 @@
-<!DOCTYPE html>
-<script src=''></script>
-<script src=''></script>
-<script src=''></script>
-<script>
-// This is updated till https://github.com/whatwg/streams/commit/4ba861e6f60c248060811830e11271c84b439cc3
-
-test(function() {
- var input = {
- readable: { },
- writable: { }
- };
- var options = { };
- assert_throws(new TypeError(), function() { ReadableStream.prototype.pipeThrough.call(undefined, input, options); });
- assert_throws(new TypeError(), function() { ReadableStream.prototype.pipeThrough.call(null, input, options); });
- assert_throws(new TypeError(), function() { ReadableStream.prototype.pipeThrough.call(1, input, options); });
- assert_throws(new TypeError(), function() { ReadableStream.prototype.pipeThrough.call({ "pipeTo": "test" }, input, options); });
-}, 'ReadableStream.prototype.pipeThrough should throw when "this" has no pipeTo method');
-
-test(function() {
- var options = { };
- var thisValue = {
- pipeTo: function() {
- assert_unreached();
- }
- };
-
- assert_throws(new TypeError(), function() { ReadableStream.prototype.pipeThrough.call(thisValue, null, options); });
- assert_throws(new TypeError(), function() { ReadableStream.prototype.pipeThrough.call(thisValue, undefined, options); });
-}, 'ReadableStream.prototype.pipeThrough should throw when passed argument is not an object');
-
-test(function() {
- var options = { };
- var error = new TypeError("potato");
-
- var thisWrongValue = {
- get pipeTo() {
- throw error;
- }
- };
- assert_throws(error, function() { ReadableStream.prototype.pipeThrough.call(thisWrongValue, { readable: { }, writable: { } }, options); });
-
- var thisValue = {
- pipeTo: function() {
- assert_unreached();
- }
- };
- var wrongInput = {
- readable: { },
- get writable() {
- throw error;
- }
- };
- assert_throws(error, function() { ReadableStream.prototype.pipeThrough.call(thisValue, wrongInput, options); });
-
- var wrongInput2 = {
- get readable() {
- throw error;
- },
- writable: { }
- };
- var thisValue2 = {
- pipeTo: function() { }
- };
- assert_throws(error, function() { ReadableStream.prototype.pipeThrough.call(thisValue2, wrongInput2, options); });
-}, 'ReadableStream.prototype.pipeThrough should throw when called getters are throwing');
-</script>
Deleted: trunk/LayoutTests/streams/reference-implementation/brand-checks-expected.txt (288610 => 288611)
--- trunk/LayoutTests/streams/reference-implementation/brand-checks-expected.txt 2022-01-26 09:25:24 UTC (rev 288610)
+++ trunk/LayoutTests/streams/reference-implementation/brand-checks-expected.txt 2022-01-26 09:47:11 UTC (rev 288611)
@@ -1,8 +0,0 @@
-
-FAIL WritableStream.prototype.closed enforces a brand check undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(obj, getterName).get')
-FAIL WritableStream.prototype.ready enforces a brand check undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(obj, getterName).get')
-FAIL WritableStream.prototype.state enforces a brand check undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(obj, getterName).get')
-PASS WritableStream.prototype.abort enforces a brand check
-FAIL WritableStream.prototype.write enforces a brand check undefined is not an object (evaluating 'method.call')
-PASS WritableStream.prototype.close enforces a brand check
-
Deleted: trunk/LayoutTests/streams/reference-implementation/brand-checks.html (288610 => 288611)
--- trunk/LayoutTests/streams/reference-implementation/brand-checks.html 2022-01-26 09:25:24 UTC (rev 288610)
+++ trunk/LayoutTests/streams/reference-implementation/brand-checks.html 2022-01-26 09:47:11 UTC (rev 288611)
@@ -1,89 +0,0 @@
-<!DOCTYPE html>
-<script src=''></script>
-<script src=''></script>
-<script src=''></script>
-<script>
-// This is updated till https://github.com/whatwg/streams/commit/4ba861e6f60c248060811830e11271c84b439cc3
-
-function fakeWritableStream() {
- return {
- get closed() { return Promise.resolve(); },
- get ready() { return Promise.resolve(); },
- get state() { return 'closed' },
- abort(reason) { return Promise.resolve(); },
- close() { return Promise.resolve(); },
- write(chunk) { return Promise.resolve(); }
- };
-}
-
-function realReadableStream() {
- return new ReadableStream();
-}
-
-function getterRejects(test, obj, getterName, target, endTest) {
- var getter = Object.getOwnPropertyDescriptor(obj, getterName).get;
-
- getter.call(target).then(
- test.step_func(function() { assert_unreached(getterName + ' should not fulfill'); }),
- test.step_func(function(e) {
- assert_throws(new TypeError(), function() { throw e; }, getterName + ' should reject with a TypeError');
- if (endTest === true) {
- test.done();
- }
- }));
-}
-
-function methodRejects(test, obj, methodName, target, endTest) {
- var method = obj[methodName];
-
- method.call(target).then(
- test.step_func(function() { assert_unreached(methodName + ' should not fulfill'); }),
- test.step_func(function(e) {
- assert_throws(new TypeError(), function() { throw e; }, methodName + ' should reject with a TypeError');
- if (endTest === true) {
- test.done();
- }
- }));
-}
-
-function getterThrows(obj, getterName, target) {
- var getter = Object.getOwnPropertyDescriptor(obj, getterName).get;
-
- assert_throws(new TypeError(), function() { getter.call(target); }, getterName + ' should throw a TypeError');
-}
-
-var test1 = async_test('WritableStream.prototype.closed enforces a brand check');
-test1.step(function() {
- getterRejects(test1, WritableStream.prototype, 'closed', fakeWritableStream());
- getterRejects(test1, WritableStream.prototype, 'closed', realReadableStream(), true);
-});
-
-var test2 = async_test('WritableStream.prototype.ready enforces a brand check');
-test2.step(function() {
- getterRejects(test2, WritableStream.prototype, 'ready', fakeWritableStream());
- getterRejects(test2, WritableStream.prototype, 'ready', realReadableStream(), true);
-});
-
-test(function() {
- getterThrows(WritableStream.prototype, 'state', fakeWritableStream());
- getterThrows(WritableStream.prototype, 'state', realReadableStream());
-}, 'WritableStream.prototype.state enforces a brand check');
-
-var test3 = async_test('WritableStream.prototype.abort enforces a brand check');
-test3.step(function() {
- methodRejects(test3, WritableStream.prototype, 'abort', fakeWritableStream());
- methodRejects(test3, WritableStream.prototype, 'abort', realReadableStream(), true);
-});
-
-var test4 = async_test('WritableStream.prototype.write enforces a brand check');
-test4.step(function() {
- methodRejects(test4, WritableStream.prototype, 'write', fakeWritableStream());
- methodRejects(test4, WritableStream.prototype, 'write', realReadableStream(), true);
-});
-
-var test5 = async_test('WritableStream.prototype.close enforces a brand check');
-test5.step(function() {
- methodRejects(test5, WritableStream.prototype, 'close', fakeWritableStream());
- methodRejects(test5, WritableStream.prototype, 'close', realReadableStream(), true);
-});
-</script>