From 005f9228f0f92eb1558b8d5b2193bc7a93d5ec80 Mon Sep 17 00:00:00 2001 From: Nidhi Jaju Date: Tue, 10 Nov 2020 20:33:04 -0800 Subject: [PATCH] Add typedef ReadableStreamReader to readable_stream.idl In this CL, the typedef for ReadableStreamReader is added to the Readable Stream WebIDL file based on the Streams API Standard[1]. In order to avoid confusion, the ReadableStreamReader class is also renamed to ReadableStreamGenericReader. This also makes more sense as the base class for the Default and BYOB Readers. Furthermore, the return value of getReader() is also changed to use the ReadableStreamReader typedef. Due to how the bindings code works, this meant that the return type of getReader in the C++ implementation also had to be changed to void and pass the ReadableStreamReader as a parameter, which is set as the returned reader. Lastly, a new function called GetDefaultReaderForTesting() is added to support calls to getReader() and read() in the various test files without having to change the return type everywhere. [1] https://streams.spec.whatwg.org/#typedefdef-readablestreamreader Bug: 1093862 Change-Id: Icbb34470f52ddcef53e9b1fa34f3dd8f27c48198 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2524628 Commit-Queue: Nidhi Jaju Reviewed-by: Adam Rice Reviewed-by: Guido Urdaneta Reviewed-by: Yutaka Hirano Cr-Commit-Position: refs/heads/master@{#826119} --- streams/readable-byte-streams/general.any.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/streams/readable-byte-streams/general.any.js b/streams/readable-byte-streams/general.any.js index e384dbc5c7944b..8ae6af70efd6c9 100644 --- a/streams/readable-byte-streams/general.any.js +++ b/streams/readable-byte-streams/general.any.js @@ -239,7 +239,7 @@ test(() => { const reader = stream.getReader(); reader.read(); assert_throws_js(TypeError, () => reader.releaseLock(), 'reader.releaseLock() must throw'); -}, 'ReadableStream with byte source: releaseLock() on ReadableStreamReader with pending read() must throw'); +}, 'ReadableStream with byte source: releaseLock() on ReadableStreamDefaultReader with pending read() must throw'); promise_test(() => { let pullCount = 0;