[Streams API] Implement pipeTo method in readable Stream
authorcalvaris@igalia.com <calvaris@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Nov 2015 18:47:19 +0000 (18:47 +0000)
committercalvaris@igalia.com <calvaris@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Nov 2015 18:47:19 +0000 (18:47 +0000)
commit43527fe95f027af2784a905ee18561833ed17bc2
tree6408a93b3342cf9b098683240be6f29dcd04d55e
parentf9f3003419a4dd825d724759d97d5cdb25911f8e
[Streams API] Implement pipeTo method in readable Stream
https://bugs.webkit.org/show_bug.cgi?id=151588

Reviewed by Darin Adler.

Source/WebCore:

Implemented pipeTo method according to the reference implementation in the spec as the spec is not written
yet. It can be found at https://github.com/whatwg/streams/blob/632b26a05f3106650b1ec91239ad5b012e6c64af/reference-implementation/lib/readable-stream.js#L75.

Tests: streams/pipe-to.html
       streams/reference-implementation/brand-checks.html
       streams/reference-implementation/pipe-through.html
       streams/reference-implementation/pipe-to.html
       streams/reference-implementation/pipe-to-options.html
       streams/reference-implementation/readable-stream-templated

* Modules/streams/ReadableStream.js:
(doPipe): Internal function of pipeTo.
(closeDest): Internal function of pipeTo.
(abortDest): Internal function of pipeTo.
(pipeTo): Implemented as per spec with some other internal functions as helpers.

LayoutTests:

Test "Piping to a writable stream that does not consume the writes fast enough exerts backpressure on the
source" was moved to its own file because it causes timing issues.

* streams/reference-implementation/pipe-to.html: Moved "Piping to a writable stream that does not consume the
writes fast enough exerts backpressure on the source" test to its own file.
* streams/pipe-to.html: Added with "Piping to a writable stream that does not consume the writes fast enough
exerts backpressure on the source" test.
* streams/reference-implementation/brand-checks.html: Fixed issue with the creation of a ReadableStreamReader.
* streams/pipe-to-expected.txt:
* streams/reference-implementation/brand-checks-expected.txt:
* streams/reference-implementation/pipe-through-expected.txt:
* streams/reference-implementation/pipe-to-expected.txt:
* streams/reference-implementation/pipe-to-options-expected.txt:
* streams/reference-implementation/readable-stream-templated-expected.txt: Expectations.
* platform/mac/TestExpectations:
* platform/win/TestExpectations: Flagged pipe-to test because of webkit.org/b/147933.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192765 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/win/TestExpectations
LayoutTests/streams/pipe-to-expected.txt [new file with mode: 0644]
LayoutTests/streams/pipe-to.html [new file with mode: 0644]
LayoutTests/streams/reference-implementation/brand-checks-expected.txt
LayoutTests/streams/reference-implementation/brand-checks.html
LayoutTests/streams/reference-implementation/pipe-through-expected.txt
LayoutTests/streams/reference-implementation/pipe-to-expected.txt
LayoutTests/streams/reference-implementation/pipe-to-options-expected.txt
LayoutTests/streams/reference-implementation/pipe-to.html
LayoutTests/streams/reference-implementation/readable-stream-templated-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/streams/ReadableStream.js