Diff
Modified: trunk/LayoutTests/ChangeLog (185640 => 185641)
--- trunk/LayoutTests/ChangeLog 2015-06-17 05:31:30 UTC (rev 185640)
+++ trunk/LayoutTests/ChangeLog 2015-06-17 06:00:27 UTC (rev 185641)
@@ -1,3 +1,15 @@
+2015-06-16 Youenn Fablet <[email protected]> and Xabier Rodriguez Calvar <[email protected]>
+
+ [Streams API] Implement ReadableStream locked property
+ https://bugs.webkit.org/show_bug.cgi?id=146023
+
+ Reviewed by Darin Adler.
+
+ Rebasing tests.
+
+ * streams/reference-implementation/readable-stream-expected.txt:
+ * streams/reference-implementation/readable-stream-templated-expected.txt:
+
2015-06-10 Filip Pizlo <[email protected]>
FTL should eliminate array bounds checks in loops
Modified: trunk/LayoutTests/streams/reference-implementation/readable-stream-expected.txt (185640 => 185641)
--- trunk/LayoutTests/streams/reference-implementation/readable-stream-expected.txt 2015-06-17 05:31:30 UTC (rev 185640)
+++ trunk/LayoutTests/streams/reference-implementation/readable-stream-expected.txt 2015-06-17 06:00:27 UTC (rev 185641)
@@ -1,7 +1,7 @@
PASS ReadableStream can be constructed with no errors
PASS ReadableStream can't be constructed with garbage
-FAIL ReadableStream instances should have the correct list of properties assert_array_equals: should have all the correct methods lengths differ, expected 7 got 5
+FAIL ReadableStream instances should have the correct list of properties assert_array_equals: should have all the correct methods lengths differ, expected 7 got 6
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
Modified: trunk/LayoutTests/streams/reference-implementation/readable-stream-templated-expected.txt (185640 => 185641)
--- trunk/LayoutTests/streams/reference-implementation/readable-stream-templated-expected.txt 2015-06-17 05:31:30 UTC (rev 185640)
+++ trunk/LayoutTests/streams/reference-implementation/readable-stream-templated-expected.txt 2015-06-17 06:00:27 UTC (rev 185641)
@@ -1,9 +1,9 @@
PASS Running templatedRSEmpty with ReadableStream (empty)
-FAIL instances have the correct methods and properties assert_equals: has a boolean locked getter expected "boolean" but got "undefined"
+FAIL instances have the correct methods and properties assert_equals: has a tee method expected "function" but got "undefined"
PASS Running templatedRSEmptyReader with ReadableStream (empty) reader
PASS instances have the correct methods and properties
-FAIL locked should be true assert_true: locked getter should return true expected true got undefined
+PASS locked should be true
PASS read() should never settle
PASS two read()s should both never settle
PASS read() should return distinct promises each time
@@ -16,7 +16,7 @@
FAIL canceling via the stream should fail cancel is not implemented
PASS Running templatedRSClosed with ReadableStream (closed via call in start)
FAIL cancel() should return a distinct fulfilled promise each time cancel is not implemented
-FAIL locked should be false assert_false: locked getter should return false expected false got undefined
+PASS locked should be false
PASS getReader() should be OK
PASS should be able to acquire multiple readers, since they are all auto-released
PASS Running templatedRSClosedReader with ReadableStream (closed via call in start) reader
@@ -34,14 +34,14 @@
FAIL cancel() should return a distinct fulfilled promise each time cancel is not implemented
PASS Running templatedRSErrored with ReadableStream (errored via call in start)
PASS getReader() should return a reader that acts errored
-FAIL locked should be false assert_false: locked getter should return false expected false got undefined
+PASS locked should be false
PASS Running templatedRSErroredSyncOnly with ReadableStream (errored via call in start)
FAIL cancel() should return a distinct rejected promise each time cancel is not implemented
FAIL reader cancel() should return a distinct rejected promise each time cancel is not implemented
PASS should be able to acquire multiple readers, since they are all auto-released
PASS Running templatedRSErrored with ReadableStream (errored via returning a rejected promise in start)
PASS getReader() should return a reader that acts errored
-FAIL locked should be false assert_false: locked getter should return false expected false got undefined
+PASS locked should be false
PASS Running templatedRSErroredReader with ReadableStream (errored via returning a rejected promise in start) reader
PASS closed should reject with the error
PASS read() should reject with the error
@@ -53,7 +53,7 @@
PASS Running templatedRSTwoChunksClosedReader with ReadableStream (two chunks enqueued, then closed) reader
PASS third read(), without waiting, should give { value: undefined, done: true }
PASS third read, with waiting, should give { value: undefined, done: true }
-FAIL draining the stream via read() should cause the reader closed promise to fulfill and locked to be false assert_false: stream should no longer be locked expected false got undefined
+PASS draining the stream via read() should cause the reader closed promise to fulfill and locked to be false
FAIL releasing the lock after the stream is closed should do nothing releaseLock is not implemented
FAIL releasing the lock should cause read() to act as if the stream is closed releaseLock is not implemented
FAIL reader's closed property always returns the same promise releaseLock is not implemented
Modified: trunk/Source/WebCore/ChangeLog (185640 => 185641)
--- trunk/Source/WebCore/ChangeLog 2015-06-17 05:31:30 UTC (rev 185640)
+++ trunk/Source/WebCore/ChangeLog 2015-06-17 06:00:27 UTC (rev 185641)
@@ -1,3 +1,20 @@
+2015-06-16 Youenn Fablet <[email protected]> and Xabier Rodriguez Calvar <[email protected]>
+
+ [Streams API] Implement ReadableStream locked property
+ https://bugs.webkit.org/show_bug.cgi?id=146023
+
+ Reviewed by Darin Adler.
+
+ Covered by rebased tests.
+
+ * Modules/streams/ReadableStream.h:
+ (WebCore::ReadableStream::locked): Renamed isLocked by locked.
+ * Modules/streams/ReadableStream.idl: Adding locked.
+ * bindings/js/JSReadableStreamCustom.cpp:
+ (WebCore::JSReadableStream::getReader): Using isLocked.
+ * bindings/js/JSReadableStreamReaderCustom.cpp:
+ (WebCore::constructJSReadableStreamReader): Using isLocked.
+
2015-06-16 Myles C. Maxfield <[email protected]>
REGRESSION(r184899): [Cocoa] font-variant: small-caps is not honored with web fonts
Modified: trunk/Source/WebCore/Modules/streams/ReadableStream.h (185640 => 185641)
--- trunk/Source/WebCore/Modules/streams/ReadableStream.h 2015-06-17 05:31:30 UTC (rev 185640)
+++ trunk/Source/WebCore/Modules/streams/ReadableStream.h 2015-06-17 06:00:27 UTC (rev 185641)
@@ -64,8 +64,9 @@
ReadableStreamReader& getReader();
const ReadableStreamReader* reader() const { return m_reader.get(); }
- bool isLocked() const { return !!m_reader; }
+ bool locked() const { return !!m_reader; }
+
bool isErrored() const { return m_state == State::Errored; }
bool isReadable() const { return m_state == State::Readable; }
bool isCloseRequested() const { return m_closeRequested; }
Modified: trunk/Source/WebCore/Modules/streams/ReadableStream.idl (185640 => 185641)
--- trunk/Source/WebCore/Modules/streams/ReadableStream.idl 2015-06-17 05:31:30 UTC (rev 185640)
+++ trunk/Source/WebCore/Modules/streams/ReadableStream.idl 2015-06-17 06:00:27 UTC (rev 185641)
@@ -37,4 +37,6 @@
[Custom, RaisesException] ReadableStreamReader getReader();
[Custom, RaisesException] Promise pipeTo(any streams, any options);
[Custom, RaisesException] Object pipeThrough(any dest, any options);
+
+ readonly attribute boolean locked;
};
Modified: trunk/Source/WebCore/bindings/js/JSReadableStreamCustom.cpp (185640 => 185641)
--- trunk/Source/WebCore/bindings/js/JSReadableStreamCustom.cpp 2015-06-17 05:31:30 UTC (rev 185640)
+++ trunk/Source/WebCore/bindings/js/JSReadableStreamCustom.cpp 2015-06-17 06:00:27 UTC (rev 185641)
@@ -55,7 +55,7 @@
JSValue JSReadableStream::getReader(ExecState* exec)
{
- if (impl().isLocked())
+ if (impl().locked())
return exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("ReadableStream is locked")));
return toJS(exec, globalObject(), impl().getReader());
}
Modified: trunk/Source/WebCore/bindings/js/JSReadableStreamReaderCustom.cpp (185640 => 185641)
--- trunk/Source/WebCore/bindings/js/JSReadableStreamReaderCustom.cpp 2015-06-17 05:31:30 UTC (rev 185640)
+++ trunk/Source/WebCore/bindings/js/JSReadableStreamReaderCustom.cpp 2015-06-17 06:00:27 UTC (rev 185641)
@@ -107,7 +107,7 @@
if (!stream)
return throwVMError(exec, createTypeError(exec, ASCIILiteral("ReadableStreamReader constructor parameter is not a ReadableStream")));
- if (stream->impl().isLocked())
+ if (stream->impl().locked())
return throwVMError(exec, createTypeError(exec, ASCIILiteral("ReadableStreamReader constructor parameter is a locked ReadableStream")));
return JSValue::encode(toJS(exec, stream->globalObject(), stream->impl().getReader()));