haikuwebkit/LayoutTests/streams/readable-stream-default-con...

49 lines
1.6 KiB
HTML
Raw Permalink Normal View History

[Streams API] ReadableStream constructor start function should be able to error the stream https://bugs.webkit.org/show_bug.cgi?id=141162 Reviewed by Darin Adler. Source/WebCore: This patch implements the functionality of the ReadableStreamController error function. It basically changes the state of the stream to errored, resolves the ready promise and rejects the closed promise. Adding support to reject promise with any JSValue. Support for storing the error is added to both reader and stream. Test: streams/readable-stream-controller-error.html and rebased tests * Modules/streams/ReadableStream.cpp: (WebCore::ReadableStream::changeStateToErrored): * Modules/streams/ReadableStream.h: * Modules/streams/ReadableStreamReader.cpp: (WebCore::ReadableStreamReader::initialize): (WebCore::ReadableStreamReader::closed): (WebCore::ReadableStreamReader::changeStateToClosed): (WebCore::ReadableStreamReader::changeStateToErrored): * Modules/streams/ReadableStreamReader.h: * bindings/js/JSDOMPromise.h: (WebCore::DeferredWrapper::reject): * bindings/js/JSReadableStreamControllerCustom.cpp: (WebCore::JSReadableStreamController::error): * bindings/js/JSReadableStreamReaderCustom.cpp: (WebCore::JSReadableStreamReader::closed): * bindings/js/ReadableJSStream.cpp: (WebCore::ReadableJSStream::createReader): (WebCore::ReadableJSStream::storeError): (WebCore::ReadableJSStream::Reader::storeError): (WebCore::ReadableJSStream::jsController): Deleted. * bindings/js/ReadableJSStream.h: LayoutTests: * streams/readable-stream-controller-error-expected.txt: Added. * streams/readable-stream-controller-error.html: Added. * streams/reference-implementation/bad-underlying-sources-expected.txt: * streams/reference-implementation/readable-stream-templated-expected.txt: Canonical link: https://commits.webkit.org/162822@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183991 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-08 10:44:06 +00:00
<!DOCTYPE html>
<script src='../resources/testharness.js'></script>
<script src='../resources/testharnessreport.js'></script>
<script>
[Streams API] Fix cosmetic things after importing spec tests https://bugs.webkit.org/show_bug.cgi?id=152479 Reviewed by Youenn Fablet. Spec version are mainly updated in this patch as it wasn't done when importing tests from the spec. Some other minor changes were done, as renumbering some tests, removing some orphan expectations and other styling issues. * streams/brand-checks.html: * streams/pipe-to.html: * streams/readable-stream-controller-error.html: * streams/readable-stream-pipeThrough.html: * streams/readable-stream-reader-read.html: * streams/reference-implementation/abstract-ops.html: * streams/reference-implementation/bad-strategies.html: * streams/reference-implementation/bad-underlying-sinks.html: * streams/reference-implementation/bad-underlying-sources-expected.txt: Removed. * streams/reference-implementation/brand-checks.html: * streams/reference-implementation/byte-length-queuing-strategy.html: * streams/reference-implementation/count-queuing-strategy.html: * streams/reference-implementation/pipe-through.html: * streams/reference-implementation/pipe-to-options.html: * streams/reference-implementation/pipe-to.html: * streams/reference-implementation/readable-stream-templated.html: * streams/reference-implementation/transform-stream-errors.html: * streams/reference-implementation/transform-stream.html: * streams/reference-implementation/writable-stream-abort.html: * streams/reference-implementation/writable-stream-expected.txt: * streams/reference-implementation/writable-stream.html: Canonical link: https://commits.webkit.org/170606@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194366 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-22 18:20:49 +00:00
// This is updated till https://github.com/whatwg/streams/commit/4ba861e6f60c248060811830e11271c84b439cc3
[Streams API] Replace ReadableStreamReader by ReadableStreamDefaultReader https://bugs.webkit.org/show_bug.cgi?id=160194 Patch by Romain Bellessort <romain.bellessort@crf.canon.fr> on 2016-07-27 Reviewed by Youenn Fablet. Replaced ReadableStreamReader by ReadableStreamDefaultReader to align with updated Streams API specification. No change in functionality. Source/WebCore: * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * Modules/fetch/FetchInternals.js: (consumeStream): * Modules/fetch/FetchResponse.js: (body): * Modules/streams/ReadableStream.js: (getReader): * Modules/streams/ReadableStreamDefaultReader.idl: Renamed from Source/WebCore/Modules/streams/ReadableStreamReader.idl. * Modules/streams/ReadableStreamDefaultReader.js: Renamed from Source/WebCore/Modules/streams/ReadableStreamReader.js. (cancel): (read): (releaseLock): (closed): * Modules/streams/ReadableStreamInternals.js: (privateInitializeReadableStreamDefaultReader): (teeReadableStream): (teeReadableStreamPullFunction): (isReadableStreamDefaultReader): (closeReadableStream): (readFromReadableStreamDefaultReader): * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::addBuiltinGlobals): (WebCore::JSDOMGlobalObject::finishCreation): * bindings/js/JSReadableStreamPrivateConstructors.cpp: (WebCore::constructJSReadableStreamDefaultReader): (WebCore::JSBuiltinReadableStreamDefaultReaderPrivateConstructor::initializeExecutable): (WebCore::createReadableStreamDefaultReaderPrivateConstructor): * bindings/js/JSReadableStreamPrivateConstructors.h: * bindings/js/WebCoreBuiltinNames.h: * features.json: LayoutTests: * streams/brand-checks.html: * streams/readable-stream-controller-error-expected.txt: * streams/readable-stream-controller-error.html: * streams/readable-stream-default-reader-read-expected.txt: Renamed from LayoutTests/streams/readable-stream-reader-read-expected.txt. * streams/readable-stream-default-reader-read.html: Renamed from LayoutTests/streams/readable-stream-reader-read.html. * streams/readable-stream-error-messages-expected.txt: * streams/readable-stream-error-messages.html: * streams/reference-implementation/readable-stream-reader-expected.txt: * streams/shadowing-Promise-expected.txt: * streams/shadowing-Promise.html: Canonical link: https://commits.webkit.org/178400@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-07-27 10:40:17 +00:00
var test1 = async_test('Erroring a ReadableStream after checking closed should reject ReadableStreamDefaultReader closed promise');
[Streams API] Sync tests with spec https://bugs.webkit.org/show_bug.cgi?id=145839 Reviewed by Darin Adler. Considered all changes in the spec tests and brought them to WebKit. Some of those changes were related to spec changes, like the strategy or some of the algorithms. Some like the tee ones were newly added as they will be implemented soon. There are also some tests that shuffled around because they were just moved at the spec or integrated from the changes we submitted, which was substantially important as it allowed us to remove some of our custom tests that are now covered by the spec ones. * resources/gc.js: Added warning about using gcRec, results might not be reliable. * streams/readable-stream-controller-error-expected.txt: * streams/readable-stream-controller-error.html: New failing test due to discrepancies with the reference implementation. Something we will address. * streams/readable-stream-expected.txt: Removed. * streams/readable-stream-gc.html: Renumbered. * streams/readable-stream-reader-expected.txt: Removed. * streams/readable-stream-reader-read.html: Renumbered. * streams/readable-stream-reader.html: Removed. * streams/readable-stream.html: Removed. * streams/reference-implementation/bad-strategies-expected.txt: Added. * streams/reference-implementation/bad-strategies.html: Added. * streams/reference-implementation/bad-underlying-sources-expected.txt: * streams/reference-implementation/bad-underlying-sources.html: Updated from spec and expectations. * streams/reference-implementation/brand-checks-expected.txt: * streams/reference-implementation/brand-checks.html: Updated from spec and expectations. * streams/reference-implementation/byte-length-queuing-strategy-expected.txt: Added. * streams/reference-implementation/byte-length-queuing-strategy.html: Added. * streams/reference-implementation/count-queuing-strategy-expected.txt: * streams/reference-implementation/count-queuing-strategy.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream-cancel-expected.txt: * streams/reference-implementation/readable-stream-cancel.html: Updated from spec and expectations and corrected timeouts to try to overcome problems in slower bots. * streams/reference-implementation/readable-stream-expected.txt: * streams/reference-implementation/readable-stream-reader-expected.txt: * streams/reference-implementation/readable-stream-reader.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream-tee-expected.txt: Added. * streams/reference-implementation/readable-stream-tee.html: Added. * streams/reference-implementation/readable-stream-templated-expected.txt: * streams/reference-implementation/readable-stream-templated.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream.html: Updated from spec and expectations. * streams/reference-implementation/resources/byte-length-queuing-strategy.js: (ByteLengthQueuingStrategy): Updated from spec. (typeIsObject): Deleted. (ByteLengthQueuingStrategy.prototype.shouldApplyBackpressure): Deleted. * streams/reference-implementation/resources/count-queuing-strategy.js: (CountQueuingStrategy): Updated from spec. (typeIsObject): Deleted. (CountQueuingStrategy.prototype.shouldApplyBackpressure): Deleted. * streams/reference-implementation/resources/streams-utils.js: (RandomPushSource.prototype.readStart.writeChunk): (RandomPushSource.prototype.readStart): Renamed stream as source (.stream.new.ReadableStream): (sequentialReadableStream): Updated from spec. (typeIsObject): Added. (createDataProperty): Added. Canonical link: https://commits.webkit.org/164046@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-06-16 08:19:04 +00:00
test1.step(function() {
[Streams API] ReadableStream constructor start function should be able to error the stream https://bugs.webkit.org/show_bug.cgi?id=141162 Reviewed by Darin Adler. Source/WebCore: This patch implements the functionality of the ReadableStreamController error function. It basically changes the state of the stream to errored, resolves the ready promise and rejects the closed promise. Adding support to reject promise with any JSValue. Support for storing the error is added to both reader and stream. Test: streams/readable-stream-controller-error.html and rebased tests * Modules/streams/ReadableStream.cpp: (WebCore::ReadableStream::changeStateToErrored): * Modules/streams/ReadableStream.h: * Modules/streams/ReadableStreamReader.cpp: (WebCore::ReadableStreamReader::initialize): (WebCore::ReadableStreamReader::closed): (WebCore::ReadableStreamReader::changeStateToClosed): (WebCore::ReadableStreamReader::changeStateToErrored): * Modules/streams/ReadableStreamReader.h: * bindings/js/JSDOMPromise.h: (WebCore::DeferredWrapper::reject): * bindings/js/JSReadableStreamControllerCustom.cpp: (WebCore::JSReadableStreamController::error): * bindings/js/JSReadableStreamReaderCustom.cpp: (WebCore::JSReadableStreamReader::closed): * bindings/js/ReadableJSStream.cpp: (WebCore::ReadableJSStream::createReader): (WebCore::ReadableJSStream::storeError): (WebCore::ReadableJSStream::Reader::storeError): (WebCore::ReadableJSStream::jsController): Deleted. * bindings/js/ReadableJSStream.h: LayoutTests: * streams/readable-stream-controller-error-expected.txt: Added. * streams/readable-stream-controller-error.html: Added. * streams/reference-implementation/bad-underlying-sources-expected.txt: * streams/reference-implementation/readable-stream-templated-expected.txt: Canonical link: https://commits.webkit.org/162822@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183991 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-08 10:44:06 +00:00
var controller;
var rs = new ReadableStream({
start: function(c) {
controller = c;
}
});
[Streams API] Sync tests with spec https://bugs.webkit.org/show_bug.cgi?id=145839 Reviewed by Darin Adler. Considered all changes in the spec tests and brought them to WebKit. Some of those changes were related to spec changes, like the strategy or some of the algorithms. Some like the tee ones were newly added as they will be implemented soon. There are also some tests that shuffled around because they were just moved at the spec or integrated from the changes we submitted, which was substantially important as it allowed us to remove some of our custom tests that are now covered by the spec ones. * resources/gc.js: Added warning about using gcRec, results might not be reliable. * streams/readable-stream-controller-error-expected.txt: * streams/readable-stream-controller-error.html: New failing test due to discrepancies with the reference implementation. Something we will address. * streams/readable-stream-expected.txt: Removed. * streams/readable-stream-gc.html: Renumbered. * streams/readable-stream-reader-expected.txt: Removed. * streams/readable-stream-reader-read.html: Renumbered. * streams/readable-stream-reader.html: Removed. * streams/readable-stream.html: Removed. * streams/reference-implementation/bad-strategies-expected.txt: Added. * streams/reference-implementation/bad-strategies.html: Added. * streams/reference-implementation/bad-underlying-sources-expected.txt: * streams/reference-implementation/bad-underlying-sources.html: Updated from spec and expectations. * streams/reference-implementation/brand-checks-expected.txt: * streams/reference-implementation/brand-checks.html: Updated from spec and expectations. * streams/reference-implementation/byte-length-queuing-strategy-expected.txt: Added. * streams/reference-implementation/byte-length-queuing-strategy.html: Added. * streams/reference-implementation/count-queuing-strategy-expected.txt: * streams/reference-implementation/count-queuing-strategy.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream-cancel-expected.txt: * streams/reference-implementation/readable-stream-cancel.html: Updated from spec and expectations and corrected timeouts to try to overcome problems in slower bots. * streams/reference-implementation/readable-stream-expected.txt: * streams/reference-implementation/readable-stream-reader-expected.txt: * streams/reference-implementation/readable-stream-reader.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream-tee-expected.txt: Added. * streams/reference-implementation/readable-stream-tee.html: Added. * streams/reference-implementation/readable-stream-templated-expected.txt: * streams/reference-implementation/readable-stream-templated.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream.html: Updated from spec and expectations. * streams/reference-implementation/resources/byte-length-queuing-strategy.js: (ByteLengthQueuingStrategy): Updated from spec. (typeIsObject): Deleted. (ByteLengthQueuingStrategy.prototype.shouldApplyBackpressure): Deleted. * streams/reference-implementation/resources/count-queuing-strategy.js: (CountQueuingStrategy): Updated from spec. (typeIsObject): Deleted. (CountQueuingStrategy.prototype.shouldApplyBackpressure): Deleted. * streams/reference-implementation/resources/streams-utils.js: (RandomPushSource.prototype.readStart.writeChunk): (RandomPushSource.prototype.readStart): Renamed stream as source (.stream.new.ReadableStream): (sequentialReadableStream): Updated from spec. (typeIsObject): Added. (createDataProperty): Added. Canonical link: https://commits.webkit.org/164046@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-06-16 08:19:04 +00:00
rs.getReader().closed.then(test1.step_func(function() {
[Streams API] ReadableStream constructor start function should be able to error the stream https://bugs.webkit.org/show_bug.cgi?id=141162 Reviewed by Darin Adler. Source/WebCore: This patch implements the functionality of the ReadableStreamController error function. It basically changes the state of the stream to errored, resolves the ready promise and rejects the closed promise. Adding support to reject promise with any JSValue. Support for storing the error is added to both reader and stream. Test: streams/readable-stream-controller-error.html and rebased tests * Modules/streams/ReadableStream.cpp: (WebCore::ReadableStream::changeStateToErrored): * Modules/streams/ReadableStream.h: * Modules/streams/ReadableStreamReader.cpp: (WebCore::ReadableStreamReader::initialize): (WebCore::ReadableStreamReader::closed): (WebCore::ReadableStreamReader::changeStateToClosed): (WebCore::ReadableStreamReader::changeStateToErrored): * Modules/streams/ReadableStreamReader.h: * bindings/js/JSDOMPromise.h: (WebCore::DeferredWrapper::reject): * bindings/js/JSReadableStreamControllerCustom.cpp: (WebCore::JSReadableStreamController::error): * bindings/js/JSReadableStreamReaderCustom.cpp: (WebCore::JSReadableStreamReader::closed): * bindings/js/ReadableJSStream.cpp: (WebCore::ReadableJSStream::createReader): (WebCore::ReadableJSStream::storeError): (WebCore::ReadableJSStream::Reader::storeError): (WebCore::ReadableJSStream::jsController): Deleted. * bindings/js/ReadableJSStream.h: LayoutTests: * streams/readable-stream-controller-error-expected.txt: Added. * streams/readable-stream-controller-error.html: Added. * streams/reference-implementation/bad-underlying-sources-expected.txt: * streams/reference-implementation/readable-stream-templated-expected.txt: Canonical link: https://commits.webkit.org/162822@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183991 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-08 10:44:06 +00:00
assert_unreached("closed promise should not be resolved when stream is errored");
[Streams API] Sync tests with spec https://bugs.webkit.org/show_bug.cgi?id=145839 Reviewed by Darin Adler. Considered all changes in the spec tests and brought them to WebKit. Some of those changes were related to spec changes, like the strategy or some of the algorithms. Some like the tee ones were newly added as they will be implemented soon. There are also some tests that shuffled around because they were just moved at the spec or integrated from the changes we submitted, which was substantially important as it allowed us to remove some of our custom tests that are now covered by the spec ones. * resources/gc.js: Added warning about using gcRec, results might not be reliable. * streams/readable-stream-controller-error-expected.txt: * streams/readable-stream-controller-error.html: New failing test due to discrepancies with the reference implementation. Something we will address. * streams/readable-stream-expected.txt: Removed. * streams/readable-stream-gc.html: Renumbered. * streams/readable-stream-reader-expected.txt: Removed. * streams/readable-stream-reader-read.html: Renumbered. * streams/readable-stream-reader.html: Removed. * streams/readable-stream.html: Removed. * streams/reference-implementation/bad-strategies-expected.txt: Added. * streams/reference-implementation/bad-strategies.html: Added. * streams/reference-implementation/bad-underlying-sources-expected.txt: * streams/reference-implementation/bad-underlying-sources.html: Updated from spec and expectations. * streams/reference-implementation/brand-checks-expected.txt: * streams/reference-implementation/brand-checks.html: Updated from spec and expectations. * streams/reference-implementation/byte-length-queuing-strategy-expected.txt: Added. * streams/reference-implementation/byte-length-queuing-strategy.html: Added. * streams/reference-implementation/count-queuing-strategy-expected.txt: * streams/reference-implementation/count-queuing-strategy.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream-cancel-expected.txt: * streams/reference-implementation/readable-stream-cancel.html: Updated from spec and expectations and corrected timeouts to try to overcome problems in slower bots. * streams/reference-implementation/readable-stream-expected.txt: * streams/reference-implementation/readable-stream-reader-expected.txt: * streams/reference-implementation/readable-stream-reader.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream-tee-expected.txt: Added. * streams/reference-implementation/readable-stream-tee.html: Added. * streams/reference-implementation/readable-stream-templated-expected.txt: * streams/reference-implementation/readable-stream-templated.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream.html: Updated from spec and expectations. * streams/reference-implementation/resources/byte-length-queuing-strategy.js: (ByteLengthQueuingStrategy): Updated from spec. (typeIsObject): Deleted. (ByteLengthQueuingStrategy.prototype.shouldApplyBackpressure): Deleted. * streams/reference-implementation/resources/count-queuing-strategy.js: (CountQueuingStrategy): Updated from spec. (typeIsObject): Deleted. (CountQueuingStrategy.prototype.shouldApplyBackpressure): Deleted. * streams/reference-implementation/resources/streams-utils.js: (RandomPushSource.prototype.readStart.writeChunk): (RandomPushSource.prototype.readStart): Renamed stream as source (.stream.new.ReadableStream): (sequentialReadableStream): Updated from spec. (typeIsObject): Added. (createDataProperty): Added. Canonical link: https://commits.webkit.org/164046@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-06-16 08:19:04 +00:00
}), test1.step_func(function(err) {
[Streams API] ReadableStream constructor start function should be able to error the stream https://bugs.webkit.org/show_bug.cgi?id=141162 Reviewed by Darin Adler. Source/WebCore: This patch implements the functionality of the ReadableStreamController error function. It basically changes the state of the stream to errored, resolves the ready promise and rejects the closed promise. Adding support to reject promise with any JSValue. Support for storing the error is added to both reader and stream. Test: streams/readable-stream-controller-error.html and rebased tests * Modules/streams/ReadableStream.cpp: (WebCore::ReadableStream::changeStateToErrored): * Modules/streams/ReadableStream.h: * Modules/streams/ReadableStreamReader.cpp: (WebCore::ReadableStreamReader::initialize): (WebCore::ReadableStreamReader::closed): (WebCore::ReadableStreamReader::changeStateToClosed): (WebCore::ReadableStreamReader::changeStateToErrored): * Modules/streams/ReadableStreamReader.h: * bindings/js/JSDOMPromise.h: (WebCore::DeferredWrapper::reject): * bindings/js/JSReadableStreamControllerCustom.cpp: (WebCore::JSReadableStreamController::error): * bindings/js/JSReadableStreamReaderCustom.cpp: (WebCore::JSReadableStreamReader::closed): * bindings/js/ReadableJSStream.cpp: (WebCore::ReadableJSStream::createReader): (WebCore::ReadableJSStream::storeError): (WebCore::ReadableJSStream::Reader::storeError): (WebCore::ReadableJSStream::jsController): Deleted. * bindings/js/ReadableJSStream.h: LayoutTests: * streams/readable-stream-controller-error-expected.txt: Added. * streams/readable-stream-controller-error.html: Added. * streams/reference-implementation/bad-underlying-sources-expected.txt: * streams/reference-implementation/readable-stream-templated-expected.txt: Canonical link: https://commits.webkit.org/162822@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183991 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-08 10:44:06 +00:00
assert_equals(rsError, err);
[Streams API] Sync tests with spec https://bugs.webkit.org/show_bug.cgi?id=145839 Reviewed by Darin Adler. Considered all changes in the spec tests and brought them to WebKit. Some of those changes were related to spec changes, like the strategy or some of the algorithms. Some like the tee ones were newly added as they will be implemented soon. There are also some tests that shuffled around because they were just moved at the spec or integrated from the changes we submitted, which was substantially important as it allowed us to remove some of our custom tests that are now covered by the spec ones. * resources/gc.js: Added warning about using gcRec, results might not be reliable. * streams/readable-stream-controller-error-expected.txt: * streams/readable-stream-controller-error.html: New failing test due to discrepancies with the reference implementation. Something we will address. * streams/readable-stream-expected.txt: Removed. * streams/readable-stream-gc.html: Renumbered. * streams/readable-stream-reader-expected.txt: Removed. * streams/readable-stream-reader-read.html: Renumbered. * streams/readable-stream-reader.html: Removed. * streams/readable-stream.html: Removed. * streams/reference-implementation/bad-strategies-expected.txt: Added. * streams/reference-implementation/bad-strategies.html: Added. * streams/reference-implementation/bad-underlying-sources-expected.txt: * streams/reference-implementation/bad-underlying-sources.html: Updated from spec and expectations. * streams/reference-implementation/brand-checks-expected.txt: * streams/reference-implementation/brand-checks.html: Updated from spec and expectations. * streams/reference-implementation/byte-length-queuing-strategy-expected.txt: Added. * streams/reference-implementation/byte-length-queuing-strategy.html: Added. * streams/reference-implementation/count-queuing-strategy-expected.txt: * streams/reference-implementation/count-queuing-strategy.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream-cancel-expected.txt: * streams/reference-implementation/readable-stream-cancel.html: Updated from spec and expectations and corrected timeouts to try to overcome problems in slower bots. * streams/reference-implementation/readable-stream-expected.txt: * streams/reference-implementation/readable-stream-reader-expected.txt: * streams/reference-implementation/readable-stream-reader.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream-tee-expected.txt: Added. * streams/reference-implementation/readable-stream-tee.html: Added. * streams/reference-implementation/readable-stream-templated-expected.txt: * streams/reference-implementation/readable-stream-templated.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream.html: Updated from spec and expectations. * streams/reference-implementation/resources/byte-length-queuing-strategy.js: (ByteLengthQueuingStrategy): Updated from spec. (typeIsObject): Deleted. (ByteLengthQueuingStrategy.prototype.shouldApplyBackpressure): Deleted. * streams/reference-implementation/resources/count-queuing-strategy.js: (CountQueuingStrategy): Updated from spec. (typeIsObject): Deleted. (CountQueuingStrategy.prototype.shouldApplyBackpressure): Deleted. * streams/reference-implementation/resources/streams-utils.js: (RandomPushSource.prototype.readStart.writeChunk): (RandomPushSource.prototype.readStart): Renamed stream as source (.stream.new.ReadableStream): (sequentialReadableStream): Updated from spec. (typeIsObject): Added. (createDataProperty): Added. Canonical link: https://commits.webkit.org/164046@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-06-16 08:19:04 +00:00
test1.done();
[Streams API] ReadableStream constructor start function should be able to error the stream https://bugs.webkit.org/show_bug.cgi?id=141162 Reviewed by Darin Adler. Source/WebCore: This patch implements the functionality of the ReadableStreamController error function. It basically changes the state of the stream to errored, resolves the ready promise and rejects the closed promise. Adding support to reject promise with any JSValue. Support for storing the error is added to both reader and stream. Test: streams/readable-stream-controller-error.html and rebased tests * Modules/streams/ReadableStream.cpp: (WebCore::ReadableStream::changeStateToErrored): * Modules/streams/ReadableStream.h: * Modules/streams/ReadableStreamReader.cpp: (WebCore::ReadableStreamReader::initialize): (WebCore::ReadableStreamReader::closed): (WebCore::ReadableStreamReader::changeStateToClosed): (WebCore::ReadableStreamReader::changeStateToErrored): * Modules/streams/ReadableStreamReader.h: * bindings/js/JSDOMPromise.h: (WebCore::DeferredWrapper::reject): * bindings/js/JSReadableStreamControllerCustom.cpp: (WebCore::JSReadableStreamController::error): * bindings/js/JSReadableStreamReaderCustom.cpp: (WebCore::JSReadableStreamReader::closed): * bindings/js/ReadableJSStream.cpp: (WebCore::ReadableJSStream::createReader): (WebCore::ReadableJSStream::storeError): (WebCore::ReadableJSStream::Reader::storeError): (WebCore::ReadableJSStream::jsController): Deleted. * bindings/js/ReadableJSStream.h: LayoutTests: * streams/readable-stream-controller-error-expected.txt: Added. * streams/readable-stream-controller-error.html: Added. * streams/reference-implementation/bad-underlying-sources-expected.txt: * streams/reference-implementation/readable-stream-templated-expected.txt: Canonical link: https://commits.webkit.org/162822@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183991 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-08 10:44:06 +00:00
}));
var rsError = "my error";
controller.error(rsError);
});
[Streams API] Replace ReadableStreamReader by ReadableStreamDefaultReader https://bugs.webkit.org/show_bug.cgi?id=160194 Patch by Romain Bellessort <romain.bellessort@crf.canon.fr> on 2016-07-27 Reviewed by Youenn Fablet. Replaced ReadableStreamReader by ReadableStreamDefaultReader to align with updated Streams API specification. No change in functionality. Source/WebCore: * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * Modules/fetch/FetchInternals.js: (consumeStream): * Modules/fetch/FetchResponse.js: (body): * Modules/streams/ReadableStream.js: (getReader): * Modules/streams/ReadableStreamDefaultReader.idl: Renamed from Source/WebCore/Modules/streams/ReadableStreamReader.idl. * Modules/streams/ReadableStreamDefaultReader.js: Renamed from Source/WebCore/Modules/streams/ReadableStreamReader.js. (cancel): (read): (releaseLock): (closed): * Modules/streams/ReadableStreamInternals.js: (privateInitializeReadableStreamDefaultReader): (teeReadableStream): (teeReadableStreamPullFunction): (isReadableStreamDefaultReader): (closeReadableStream): (readFromReadableStreamDefaultReader): * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::addBuiltinGlobals): (WebCore::JSDOMGlobalObject::finishCreation): * bindings/js/JSReadableStreamPrivateConstructors.cpp: (WebCore::constructJSReadableStreamDefaultReader): (WebCore::JSBuiltinReadableStreamDefaultReaderPrivateConstructor::initializeExecutable): (WebCore::createReadableStreamDefaultReaderPrivateConstructor): * bindings/js/JSReadableStreamPrivateConstructors.h: * bindings/js/WebCoreBuiltinNames.h: * features.json: LayoutTests: * streams/brand-checks.html: * streams/readable-stream-controller-error-expected.txt: * streams/readable-stream-controller-error.html: * streams/readable-stream-default-reader-read-expected.txt: Renamed from LayoutTests/streams/readable-stream-reader-read-expected.txt. * streams/readable-stream-default-reader-read.html: Renamed from LayoutTests/streams/readable-stream-reader-read.html. * streams/readable-stream-error-messages-expected.txt: * streams/readable-stream-error-messages.html: * streams/reference-implementation/readable-stream-reader-expected.txt: * streams/shadowing-Promise-expected.txt: * streams/shadowing-Promise.html: Canonical link: https://commits.webkit.org/178400@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-07-27 10:40:17 +00:00
var test2 = async_test('Erroring a ReadableStream before checking closed should reject ReadableStreamDefaultReader closed promise');
[Streams API] Sync tests with spec https://bugs.webkit.org/show_bug.cgi?id=145839 Reviewed by Darin Adler. Considered all changes in the spec tests and brought them to WebKit. Some of those changes were related to spec changes, like the strategy or some of the algorithms. Some like the tee ones were newly added as they will be implemented soon. There are also some tests that shuffled around because they were just moved at the spec or integrated from the changes we submitted, which was substantially important as it allowed us to remove some of our custom tests that are now covered by the spec ones. * resources/gc.js: Added warning about using gcRec, results might not be reliable. * streams/readable-stream-controller-error-expected.txt: * streams/readable-stream-controller-error.html: New failing test due to discrepancies with the reference implementation. Something we will address. * streams/readable-stream-expected.txt: Removed. * streams/readable-stream-gc.html: Renumbered. * streams/readable-stream-reader-expected.txt: Removed. * streams/readable-stream-reader-read.html: Renumbered. * streams/readable-stream-reader.html: Removed. * streams/readable-stream.html: Removed. * streams/reference-implementation/bad-strategies-expected.txt: Added. * streams/reference-implementation/bad-strategies.html: Added. * streams/reference-implementation/bad-underlying-sources-expected.txt: * streams/reference-implementation/bad-underlying-sources.html: Updated from spec and expectations. * streams/reference-implementation/brand-checks-expected.txt: * streams/reference-implementation/brand-checks.html: Updated from spec and expectations. * streams/reference-implementation/byte-length-queuing-strategy-expected.txt: Added. * streams/reference-implementation/byte-length-queuing-strategy.html: Added. * streams/reference-implementation/count-queuing-strategy-expected.txt: * streams/reference-implementation/count-queuing-strategy.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream-cancel-expected.txt: * streams/reference-implementation/readable-stream-cancel.html: Updated from spec and expectations and corrected timeouts to try to overcome problems in slower bots. * streams/reference-implementation/readable-stream-expected.txt: * streams/reference-implementation/readable-stream-reader-expected.txt: * streams/reference-implementation/readable-stream-reader.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream-tee-expected.txt: Added. * streams/reference-implementation/readable-stream-tee.html: Added. * streams/reference-implementation/readable-stream-templated-expected.txt: * streams/reference-implementation/readable-stream-templated.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream.html: Updated from spec and expectations. * streams/reference-implementation/resources/byte-length-queuing-strategy.js: (ByteLengthQueuingStrategy): Updated from spec. (typeIsObject): Deleted. (ByteLengthQueuingStrategy.prototype.shouldApplyBackpressure): Deleted. * streams/reference-implementation/resources/count-queuing-strategy.js: (CountQueuingStrategy): Updated from spec. (typeIsObject): Deleted. (CountQueuingStrategy.prototype.shouldApplyBackpressure): Deleted. * streams/reference-implementation/resources/streams-utils.js: (RandomPushSource.prototype.readStart.writeChunk): (RandomPushSource.prototype.readStart): Renamed stream as source (.stream.new.ReadableStream): (sequentialReadableStream): Updated from spec. (typeIsObject): Added. (createDataProperty): Added. Canonical link: https://commits.webkit.org/164046@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-06-16 08:19:04 +00:00
test2.step(function() {
[Streams API] ReadableStream constructor start function should be able to error the stream https://bugs.webkit.org/show_bug.cgi?id=141162 Reviewed by Darin Adler. Source/WebCore: This patch implements the functionality of the ReadableStreamController error function. It basically changes the state of the stream to errored, resolves the ready promise and rejects the closed promise. Adding support to reject promise with any JSValue. Support for storing the error is added to both reader and stream. Test: streams/readable-stream-controller-error.html and rebased tests * Modules/streams/ReadableStream.cpp: (WebCore::ReadableStream::changeStateToErrored): * Modules/streams/ReadableStream.h: * Modules/streams/ReadableStreamReader.cpp: (WebCore::ReadableStreamReader::initialize): (WebCore::ReadableStreamReader::closed): (WebCore::ReadableStreamReader::changeStateToClosed): (WebCore::ReadableStreamReader::changeStateToErrored): * Modules/streams/ReadableStreamReader.h: * bindings/js/JSDOMPromise.h: (WebCore::DeferredWrapper::reject): * bindings/js/JSReadableStreamControllerCustom.cpp: (WebCore::JSReadableStreamController::error): * bindings/js/JSReadableStreamReaderCustom.cpp: (WebCore::JSReadableStreamReader::closed): * bindings/js/ReadableJSStream.cpp: (WebCore::ReadableJSStream::createReader): (WebCore::ReadableJSStream::storeError): (WebCore::ReadableJSStream::Reader::storeError): (WebCore::ReadableJSStream::jsController): Deleted. * bindings/js/ReadableJSStream.h: LayoutTests: * streams/readable-stream-controller-error-expected.txt: Added. * streams/readable-stream-controller-error.html: Added. * streams/reference-implementation/bad-underlying-sources-expected.txt: * streams/reference-implementation/readable-stream-templated-expected.txt: Canonical link: https://commits.webkit.org/162822@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183991 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-08 10:44:06 +00:00
var controller;
var rs = new ReadableStream({
start: function(c) {
controller = c;
}
});
var rsError = "my error";
controller.error(rsError);
// Let's call getReader twice to ensure that stream is not locked to a reader.
rs.getReader().releaseLock();
[Streams API] Sync tests with spec https://bugs.webkit.org/show_bug.cgi?id=145839 Reviewed by Darin Adler. Considered all changes in the spec tests and brought them to WebKit. Some of those changes were related to spec changes, like the strategy or some of the algorithms. Some like the tee ones were newly added as they will be implemented soon. There are also some tests that shuffled around because they were just moved at the spec or integrated from the changes we submitted, which was substantially important as it allowed us to remove some of our custom tests that are now covered by the spec ones. * resources/gc.js: Added warning about using gcRec, results might not be reliable. * streams/readable-stream-controller-error-expected.txt: * streams/readable-stream-controller-error.html: New failing test due to discrepancies with the reference implementation. Something we will address. * streams/readable-stream-expected.txt: Removed. * streams/readable-stream-gc.html: Renumbered. * streams/readable-stream-reader-expected.txt: Removed. * streams/readable-stream-reader-read.html: Renumbered. * streams/readable-stream-reader.html: Removed. * streams/readable-stream.html: Removed. * streams/reference-implementation/bad-strategies-expected.txt: Added. * streams/reference-implementation/bad-strategies.html: Added. * streams/reference-implementation/bad-underlying-sources-expected.txt: * streams/reference-implementation/bad-underlying-sources.html: Updated from spec and expectations. * streams/reference-implementation/brand-checks-expected.txt: * streams/reference-implementation/brand-checks.html: Updated from spec and expectations. * streams/reference-implementation/byte-length-queuing-strategy-expected.txt: Added. * streams/reference-implementation/byte-length-queuing-strategy.html: Added. * streams/reference-implementation/count-queuing-strategy-expected.txt: * streams/reference-implementation/count-queuing-strategy.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream-cancel-expected.txt: * streams/reference-implementation/readable-stream-cancel.html: Updated from spec and expectations and corrected timeouts to try to overcome problems in slower bots. * streams/reference-implementation/readable-stream-expected.txt: * streams/reference-implementation/readable-stream-reader-expected.txt: * streams/reference-implementation/readable-stream-reader.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream-tee-expected.txt: Added. * streams/reference-implementation/readable-stream-tee.html: Added. * streams/reference-implementation/readable-stream-templated-expected.txt: * streams/reference-implementation/readable-stream-templated.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream.html: Updated from spec and expectations. * streams/reference-implementation/resources/byte-length-queuing-strategy.js: (ByteLengthQueuingStrategy): Updated from spec. (typeIsObject): Deleted. (ByteLengthQueuingStrategy.prototype.shouldApplyBackpressure): Deleted. * streams/reference-implementation/resources/count-queuing-strategy.js: (CountQueuingStrategy): Updated from spec. (typeIsObject): Deleted. (CountQueuingStrategy.prototype.shouldApplyBackpressure): Deleted. * streams/reference-implementation/resources/streams-utils.js: (RandomPushSource.prototype.readStart.writeChunk): (RandomPushSource.prototype.readStart): Renamed stream as source (.stream.new.ReadableStream): (sequentialReadableStream): Updated from spec. (typeIsObject): Added. (createDataProperty): Added. Canonical link: https://commits.webkit.org/164046@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-06-16 08:19:04 +00:00
rs.getReader().closed.then(test2.step_func(function() {
[Streams API] ReadableStream constructor start function should be able to error the stream https://bugs.webkit.org/show_bug.cgi?id=141162 Reviewed by Darin Adler. Source/WebCore: This patch implements the functionality of the ReadableStreamController error function. It basically changes the state of the stream to errored, resolves the ready promise and rejects the closed promise. Adding support to reject promise with any JSValue. Support for storing the error is added to both reader and stream. Test: streams/readable-stream-controller-error.html and rebased tests * Modules/streams/ReadableStream.cpp: (WebCore::ReadableStream::changeStateToErrored): * Modules/streams/ReadableStream.h: * Modules/streams/ReadableStreamReader.cpp: (WebCore::ReadableStreamReader::initialize): (WebCore::ReadableStreamReader::closed): (WebCore::ReadableStreamReader::changeStateToClosed): (WebCore::ReadableStreamReader::changeStateToErrored): * Modules/streams/ReadableStreamReader.h: * bindings/js/JSDOMPromise.h: (WebCore::DeferredWrapper::reject): * bindings/js/JSReadableStreamControllerCustom.cpp: (WebCore::JSReadableStreamController::error): * bindings/js/JSReadableStreamReaderCustom.cpp: (WebCore::JSReadableStreamReader::closed): * bindings/js/ReadableJSStream.cpp: (WebCore::ReadableJSStream::createReader): (WebCore::ReadableJSStream::storeError): (WebCore::ReadableJSStream::Reader::storeError): (WebCore::ReadableJSStream::jsController): Deleted. * bindings/js/ReadableJSStream.h: LayoutTests: * streams/readable-stream-controller-error-expected.txt: Added. * streams/readable-stream-controller-error.html: Added. * streams/reference-implementation/bad-underlying-sources-expected.txt: * streams/reference-implementation/readable-stream-templated-expected.txt: Canonical link: https://commits.webkit.org/162822@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183991 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-08 10:44:06 +00:00
assert_unreached("closed promise should not be resolved when stream is errored");
[Streams API] Sync tests with spec https://bugs.webkit.org/show_bug.cgi?id=145839 Reviewed by Darin Adler. Considered all changes in the spec tests and brought them to WebKit. Some of those changes were related to spec changes, like the strategy or some of the algorithms. Some like the tee ones were newly added as they will be implemented soon. There are also some tests that shuffled around because they were just moved at the spec or integrated from the changes we submitted, which was substantially important as it allowed us to remove some of our custom tests that are now covered by the spec ones. * resources/gc.js: Added warning about using gcRec, results might not be reliable. * streams/readable-stream-controller-error-expected.txt: * streams/readable-stream-controller-error.html: New failing test due to discrepancies with the reference implementation. Something we will address. * streams/readable-stream-expected.txt: Removed. * streams/readable-stream-gc.html: Renumbered. * streams/readable-stream-reader-expected.txt: Removed. * streams/readable-stream-reader-read.html: Renumbered. * streams/readable-stream-reader.html: Removed. * streams/readable-stream.html: Removed. * streams/reference-implementation/bad-strategies-expected.txt: Added. * streams/reference-implementation/bad-strategies.html: Added. * streams/reference-implementation/bad-underlying-sources-expected.txt: * streams/reference-implementation/bad-underlying-sources.html: Updated from spec and expectations. * streams/reference-implementation/brand-checks-expected.txt: * streams/reference-implementation/brand-checks.html: Updated from spec and expectations. * streams/reference-implementation/byte-length-queuing-strategy-expected.txt: Added. * streams/reference-implementation/byte-length-queuing-strategy.html: Added. * streams/reference-implementation/count-queuing-strategy-expected.txt: * streams/reference-implementation/count-queuing-strategy.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream-cancel-expected.txt: * streams/reference-implementation/readable-stream-cancel.html: Updated from spec and expectations and corrected timeouts to try to overcome problems in slower bots. * streams/reference-implementation/readable-stream-expected.txt: * streams/reference-implementation/readable-stream-reader-expected.txt: * streams/reference-implementation/readable-stream-reader.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream-tee-expected.txt: Added. * streams/reference-implementation/readable-stream-tee.html: Added. * streams/reference-implementation/readable-stream-templated-expected.txt: * streams/reference-implementation/readable-stream-templated.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream.html: Updated from spec and expectations. * streams/reference-implementation/resources/byte-length-queuing-strategy.js: (ByteLengthQueuingStrategy): Updated from spec. (typeIsObject): Deleted. (ByteLengthQueuingStrategy.prototype.shouldApplyBackpressure): Deleted. * streams/reference-implementation/resources/count-queuing-strategy.js: (CountQueuingStrategy): Updated from spec. (typeIsObject): Deleted. (CountQueuingStrategy.prototype.shouldApplyBackpressure): Deleted. * streams/reference-implementation/resources/streams-utils.js: (RandomPushSource.prototype.readStart.writeChunk): (RandomPushSource.prototype.readStart): Renamed stream as source (.stream.new.ReadableStream): (sequentialReadableStream): Updated from spec. (typeIsObject): Added. (createDataProperty): Added. Canonical link: https://commits.webkit.org/164046@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-06-16 08:19:04 +00:00
}), test2.step_func(function(err) {
[Streams API] ReadableStream constructor start function should be able to error the stream https://bugs.webkit.org/show_bug.cgi?id=141162 Reviewed by Darin Adler. Source/WebCore: This patch implements the functionality of the ReadableStreamController error function. It basically changes the state of the stream to errored, resolves the ready promise and rejects the closed promise. Adding support to reject promise with any JSValue. Support for storing the error is added to both reader and stream. Test: streams/readable-stream-controller-error.html and rebased tests * Modules/streams/ReadableStream.cpp: (WebCore::ReadableStream::changeStateToErrored): * Modules/streams/ReadableStream.h: * Modules/streams/ReadableStreamReader.cpp: (WebCore::ReadableStreamReader::initialize): (WebCore::ReadableStreamReader::closed): (WebCore::ReadableStreamReader::changeStateToClosed): (WebCore::ReadableStreamReader::changeStateToErrored): * Modules/streams/ReadableStreamReader.h: * bindings/js/JSDOMPromise.h: (WebCore::DeferredWrapper::reject): * bindings/js/JSReadableStreamControllerCustom.cpp: (WebCore::JSReadableStreamController::error): * bindings/js/JSReadableStreamReaderCustom.cpp: (WebCore::JSReadableStreamReader::closed): * bindings/js/ReadableJSStream.cpp: (WebCore::ReadableJSStream::createReader): (WebCore::ReadableJSStream::storeError): (WebCore::ReadableJSStream::Reader::storeError): (WebCore::ReadableJSStream::jsController): Deleted. * bindings/js/ReadableJSStream.h: LayoutTests: * streams/readable-stream-controller-error-expected.txt: Added. * streams/readable-stream-controller-error.html: Added. * streams/reference-implementation/bad-underlying-sources-expected.txt: * streams/reference-implementation/readable-stream-templated-expected.txt: Canonical link: https://commits.webkit.org/162822@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183991 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-08 10:44:06 +00:00
assert_equals(rsError, err);
[Streams API] Sync tests with spec https://bugs.webkit.org/show_bug.cgi?id=145839 Reviewed by Darin Adler. Considered all changes in the spec tests and brought them to WebKit. Some of those changes were related to spec changes, like the strategy or some of the algorithms. Some like the tee ones were newly added as they will be implemented soon. There are also some tests that shuffled around because they were just moved at the spec or integrated from the changes we submitted, which was substantially important as it allowed us to remove some of our custom tests that are now covered by the spec ones. * resources/gc.js: Added warning about using gcRec, results might not be reliable. * streams/readable-stream-controller-error-expected.txt: * streams/readable-stream-controller-error.html: New failing test due to discrepancies with the reference implementation. Something we will address. * streams/readable-stream-expected.txt: Removed. * streams/readable-stream-gc.html: Renumbered. * streams/readable-stream-reader-expected.txt: Removed. * streams/readable-stream-reader-read.html: Renumbered. * streams/readable-stream-reader.html: Removed. * streams/readable-stream.html: Removed. * streams/reference-implementation/bad-strategies-expected.txt: Added. * streams/reference-implementation/bad-strategies.html: Added. * streams/reference-implementation/bad-underlying-sources-expected.txt: * streams/reference-implementation/bad-underlying-sources.html: Updated from spec and expectations. * streams/reference-implementation/brand-checks-expected.txt: * streams/reference-implementation/brand-checks.html: Updated from spec and expectations. * streams/reference-implementation/byte-length-queuing-strategy-expected.txt: Added. * streams/reference-implementation/byte-length-queuing-strategy.html: Added. * streams/reference-implementation/count-queuing-strategy-expected.txt: * streams/reference-implementation/count-queuing-strategy.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream-cancel-expected.txt: * streams/reference-implementation/readable-stream-cancel.html: Updated from spec and expectations and corrected timeouts to try to overcome problems in slower bots. * streams/reference-implementation/readable-stream-expected.txt: * streams/reference-implementation/readable-stream-reader-expected.txt: * streams/reference-implementation/readable-stream-reader.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream-tee-expected.txt: Added. * streams/reference-implementation/readable-stream-tee.html: Added. * streams/reference-implementation/readable-stream-templated-expected.txt: * streams/reference-implementation/readable-stream-templated.html: Updated from spec and expectations. * streams/reference-implementation/readable-stream.html: Updated from spec and expectations. * streams/reference-implementation/resources/byte-length-queuing-strategy.js: (ByteLengthQueuingStrategy): Updated from spec. (typeIsObject): Deleted. (ByteLengthQueuingStrategy.prototype.shouldApplyBackpressure): Deleted. * streams/reference-implementation/resources/count-queuing-strategy.js: (CountQueuingStrategy): Updated from spec. (typeIsObject): Deleted. (CountQueuingStrategy.prototype.shouldApplyBackpressure): Deleted. * streams/reference-implementation/resources/streams-utils.js: (RandomPushSource.prototype.readStart.writeChunk): (RandomPushSource.prototype.readStart): Renamed stream as source (.stream.new.ReadableStream): (sequentialReadableStream): Updated from spec. (typeIsObject): Added. (createDataProperty): Added. Canonical link: https://commits.webkit.org/164046@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-06-16 08:19:04 +00:00
test2.done();
[Streams API] ReadableStream constructor start function should be able to error the stream https://bugs.webkit.org/show_bug.cgi?id=141162 Reviewed by Darin Adler. Source/WebCore: This patch implements the functionality of the ReadableStreamController error function. It basically changes the state of the stream to errored, resolves the ready promise and rejects the closed promise. Adding support to reject promise with any JSValue. Support for storing the error is added to both reader and stream. Test: streams/readable-stream-controller-error.html and rebased tests * Modules/streams/ReadableStream.cpp: (WebCore::ReadableStream::changeStateToErrored): * Modules/streams/ReadableStream.h: * Modules/streams/ReadableStreamReader.cpp: (WebCore::ReadableStreamReader::initialize): (WebCore::ReadableStreamReader::closed): (WebCore::ReadableStreamReader::changeStateToClosed): (WebCore::ReadableStreamReader::changeStateToErrored): * Modules/streams/ReadableStreamReader.h: * bindings/js/JSDOMPromise.h: (WebCore::DeferredWrapper::reject): * bindings/js/JSReadableStreamControllerCustom.cpp: (WebCore::JSReadableStreamController::error): * bindings/js/JSReadableStreamReaderCustom.cpp: (WebCore::JSReadableStreamReader::closed): * bindings/js/ReadableJSStream.cpp: (WebCore::ReadableJSStream::createReader): (WebCore::ReadableJSStream::storeError): (WebCore::ReadableJSStream::Reader::storeError): (WebCore::ReadableJSStream::jsController): Deleted. * bindings/js/ReadableJSStream.h: LayoutTests: * streams/readable-stream-controller-error-expected.txt: Added. * streams/readable-stream-controller-error.html: Added. * streams/reference-implementation/bad-underlying-sources-expected.txt: * streams/reference-implementation/readable-stream-templated-expected.txt: Canonical link: https://commits.webkit.org/162822@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183991 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-08 10:44:06 +00:00
}));
});
</script>