From 53319bfa0bbe51c4348b19b52ee460d157835a3a Mon Sep 17 00:00:00 2001 From: "youenn.fablet@crf.canon.fr" Date: Sat, 27 Jun 2015 08:04:19 +0000 Subject: [PATCH] [Streams API] Implement ReadableStreamController.desiredSize property https://bugs.webkit.org/show_bug.cgi?id=146311 Reviewed by Darin Adler. Source/WebCore: Covered by rebased tests. * Modules/streams/ReadableStreamController.h: Adding desiredSize getter. (WebCore::ReadableStreamController::desiredSize): Ditto. * Modules/streams/ReadableStreamController.idl: Added desiredSize attribute. LayoutTests: * streams/reference-implementation/count-queuing-strategy-expected.txt: * streams/reference-implementation/readable-stream-expected.txt: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@186024 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 10 ++++++++++ .../count-queuing-strategy-expected.txt | 6 +++--- .../reference-implementation/readable-stream-expected.txt | 8 ++++---- Source/WebCore/ChangeLog | 13 +++++++++++++ Source/WebCore/Modules/streams/ReadableStreamController.h | 2 ++ Source/WebCore/Modules/streams/ReadableStreamController.idl | 2 ++ 6 files changed, 34 insertions(+), 7 deletions(-) diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index c588715..ee00c51 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,13 @@ +2015-06-27 Xabier Rodriguez Calvar and Youenn Fablet + + [Streams API] Implement ReadableStreamController.desiredSize property + https://bugs.webkit.org/show_bug.cgi?id=146311 + + Reviewed by Darin Adler. + + * streams/reference-implementation/count-queuing-strategy-expected.txt: + * streams/reference-implementation/readable-stream-expected.txt: + 2015-06-26 Myles C. Maxfield [iOS] AppleGothic has been superseded by Apple SD Gothic Neo diff --git a/LayoutTests/streams/reference-implementation/count-queuing-strategy-expected.txt b/LayoutTests/streams/reference-implementation/count-queuing-strategy-expected.txt index 2faef6e..ed3d061 100644 --- a/LayoutTests/streams/reference-implementation/count-queuing-strategy-expected.txt +++ b/LayoutTests/streams/reference-implementation/count-queuing-strategy-expected.txt @@ -3,7 +3,7 @@ PASS Can construct a CountQueuingStrategy with a valid high water mark PASS Can construct a CountQueuingStrategy with any value as its high water mark PASS CountQueuingStrategy instances have the correct properties PASS Can construct a readable stream with a valid CountQueuingStrategy -FAIL Correctly governs the return value of a ReadableStream's enqueue function (HWM = 0) assert_equals: 0 reads, 0 enqueues: desiredSize should be 0 expected (number) 0 but got (undefined) undefined -FAIL Correctly governs a ReadableStreamController's desiredSize property (HWM = 1) assert_equals: 0 reads, 0 enqueues: desiredSize should be 1 expected (number) 1 but got (undefined) undefined -FAIL Correctly governs a ReadableStreamController's desiredSize property (HWM = 4) assert_equals: 0 reads, 0 enqueues: desiredSize should be 4 expected (number) 4 but got (undefined) undefined +PASS Correctly governs the return value of a ReadableStream's enqueue function (HWM = 0) +PASS Correctly governs a ReadableStreamController's desiredSize property (HWM = 1) +PASS Correctly governs a ReadableStreamController's desiredSize property (HWM = 4) diff --git a/LayoutTests/streams/reference-implementation/readable-stream-expected.txt b/LayoutTests/streams/reference-implementation/readable-stream-expected.txt index 7576228..ae5d1fc 100644 --- a/LayoutTests/streams/reference-implementation/readable-stream-expected.txt +++ b/LayoutTests/streams/reference-implementation/readable-stream-expected.txt @@ -5,8 +5,8 @@ FAIL ReadableStream instances should have the correct list of properties assert_ PASS ReadableStream constructor should throw for non-function start arguments PASS ReadableStream constructor can get initial garbage as cancel argument PASS ReadableStream constructor can get initial garbage as pull argument -FAIL ReadableStream start should be called with the proper parameters assert_array_equals: the controller should have the right properties lengths differ, expected 5 got 4 -FAIL ReadableStream start controller parameter should be extensible assert_array_equals: prototype should have the right properties lengths differ, expected 5 got 4 +FAIL ReadableStream start should be called with the proper parameters assert_false: close should be non-enumerable expected false got true +PASS ReadableStream start controller parameter should be extensible PASS ReadableStream should be able to call start method within prototype chain of its source PASS ReadableStream start should be able to return a promise PASS ReadableStream start should be able to return a promise and reject it @@ -26,8 +26,8 @@ PASS ReadableStream: enqueue should throw when the stream is readable but draini PASS ReadableStream: enqueue should throw when the stream is closed PASS ReadableStream: enqueue should throw the stored error when the stream is errored PASS ReadableStream: should call underlying source methods as methods -FAIL ReadableStream strategies: the default strategy should give desiredSize of 1 to start, decreasing by 1 per enqueue assert_equals: expected (number) 1 but got (undefined) undefined -FAIL ReadableStream strategies: the default strategy should continue giving desiredSize of 1 if the chunks are read immediately assert_equals: desiredSize should start at 1 expected (number) 1 but got (undefined) undefined +PASS ReadableStream strategies: the default strategy should give desiredSize of 1 to start, decreasing by 1 per enqueue +PASS ReadableStream strategies: the default strategy should continue giving desiredSize of 1 if the chunks are read immediately PASS ReadableStream integration test: adapting a random push source PASS ReadableStream integration test: adapting a sync pull source diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index f82623d..f20e4fb 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,16 @@ +2015-06-27 Xabier Rodriguez Calvar and Youenn Fablet + + [Streams API] Implement ReadableStreamController.desiredSize property + https://bugs.webkit.org/show_bug.cgi?id=146311 + + Reviewed by Darin Adler. + + Covered by rebased tests. + + * Modules/streams/ReadableStreamController.h: Adding desiredSize getter. + (WebCore::ReadableStreamController::desiredSize): Ditto. + * Modules/streams/ReadableStreamController.idl: Added desiredSize attribute. + 2015-06-27 Carlos Garcia Campos [GTK][SOUP] Implement WebCore::PublicSuffix for soup and enable PUBLIC_SUFFIX_LIST for GTK+ diff --git a/Source/WebCore/Modules/streams/ReadableStreamController.h b/Source/WebCore/Modules/streams/ReadableStreamController.h index e5958d1..b292add 100644 --- a/Source/WebCore/Modules/streams/ReadableStreamController.h +++ b/Source/WebCore/Modules/streams/ReadableStreamController.h @@ -49,6 +49,8 @@ public: void ref() { m_stream.ref(); } void deref() { m_stream.deref(); } + double desiredSize() const { return m_stream.desiredSize(); } + private: ReadableJSStream& m_stream; }; diff --git a/Source/WebCore/Modules/streams/ReadableStreamController.idl b/Source/WebCore/Modules/streams/ReadableStreamController.idl index 7a96a0e..6072b17 100644 --- a/Source/WebCore/Modules/streams/ReadableStreamController.idl +++ b/Source/WebCore/Modules/streams/ReadableStreamController.idl @@ -36,4 +36,6 @@ [Custom, RaisesException] boolean enqueue(any chunk); [Custom, RaisesException] void close(); [Custom, RaisesException] void error(any error); + + readonly attribute double desiredSize; }; -- 1.8.3.1