Bug 180470 - [Readable Streams API] Throw RangeError if a size is provided when creating a readable byte stream
Summary: [Readable Streams API] Throw RangeError if a size is provided when creating a...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Romain Bellessort
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-12-06 06:51 PST by Romain Bellessort
Modified: 2017-12-12 08:52 PST (History)
8 users (show)

See Also:


Attachments
Patch (6.38 KB, patch)
2017-12-06 07:12 PST, Romain Bellessort
no flags Details | Formatted Diff | Diff
Patch (5.67 KB, patch)
2017-12-12 01:56 PST, Romain Bellessort
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews102 for mac-elcapitan (2.19 MB, application/zip)
2017-12-12 02:52 PST, EWS Watchlist
no flags Details
Archive of layout-test-results from ews104 for mac-elcapitan-wk2 (2.63 MB, application/zip)
2017-12-12 03:05 PST, EWS Watchlist
no flags Details
Archive of layout-test-results from ews113 for mac-elcapitan (2.89 MB, application/zip)
2017-12-12 03:18 PST, EWS Watchlist
no flags Details
Archive of layout-test-results from ews123 for ios-simulator-wk2 (2.21 MB, application/zip)
2017-12-12 03:20 PST, EWS Watchlist
no flags Details
Patch (8.32 KB, patch)
2017-12-12 06:04 PST, Romain Bellessort
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Romain Bellessort 2017-12-06 06:51:16 PST
When creating a ReadableStream with type 'bytes', no strategy size should be provided. As per updated spec (see https://github.com/whatwg/streams/pull/856), a RangeError should be thrown if size is not undefined.
Comment 1 Romain Bellessort 2017-12-06 07:12:16 PST
Created attachment 328564 [details]
Patch
Comment 2 Xabier Rodríguez Calvar 2017-12-11 04:54:17 PST
Comment on attachment 328564 [details]
Patch

Code is ok, test is redudant as it commit da06ef1c8668bd121a461405361fc7f4615b6cd6 of WPT shows at https://github.com/w3c/web-platform-tests.git. So you want to import that test instead of creating a new one.
Comment 3 Romain Bellessort 2017-12-11 08:11:17 PST
(In reply to Xabier Rodríguez Calvar from comment #2)
> Comment on attachment 328564 [details]
> Patch
> 
> Code is ok, test is redudant as it commit
> da06ef1c8668bd121a461405361fc7f4615b6cd6 of WPT shows at
> https://github.com/w3c/web-platform-tests.git. So you want to import that
> test instead of creating a new one.

WPT test targets the same behavior, but it requires other changes from the latest spec (e.g. CountQueuingStrategy and ByteLengthQueuingStrategy) which are not implemented in current WebKit implementation. Maybe I could add a comment to the test I added to indicate that it should be removed once the implementation supports CountQueuingStrategy and ByteLengthQueuingStrategy?
Comment 4 youenn fablet 2017-12-11 09:53:13 PST
> WPT test targets the same behavior, but it requires other changes from the
> latest spec (e.g. CountQueuingStrategy and ByteLengthQueuingStrategy) which
> are not implemented in current WebKit implementation. Maybe I could add a
> comment to the test I added to indicate that it should be removed once the
> implementation supports CountQueuingStrategy and ByteLengthQueuingStrategy?

Does this mean that reimporting streams API will regress somehow our coverage?
We resent regularly so this will happen anyhow.

I like the simplicity of the test you are adding.
We could land that patch and upstream the test you are adding to WPT. Once upstreamed, we would need to remove the WebKit-specific version.
Comment 5 Romain Bellessort 2017-12-12 01:02:06 PST
(In reply to youenn fablet from comment #4)
> > WPT test targets the same behavior, but it requires other changes from the
> > latest spec (e.g. CountQueuingStrategy and ByteLengthQueuingStrategy) which
> > are not implemented in current WebKit implementation. Maybe I could add a
> > comment to the test I added to indicate that it should be removed once the
> > implementation supports CountQueuingStrategy and ByteLengthQueuingStrategy?
> 
> Does this mean that reimporting streams API will regress somehow our
> coverage?
> We resent regularly so this will happen anyhow.
> 
> I like the simplicity of the test you are adding.
> We could land that patch and upstream the test you are adding to WPT. Once
> upstreamed, we would need to remove the WebKit-specific version.

I haven't checked how many tests will be impacted, but yes, coverage will regress. Corresponding WPT test already comprises a very similar test (see https://github.com/w3c/web-platform-tests/commit/da06ef1c8668bd121a461405361fc7f4615b6cd6 , line 1968), but it also adds other tests as the queuing strategy may now be an instance of CountQueuingStrategy or ByteLengthQueuingStrategy. The corresponding test will fail as all tests are gathered in the same test case. An option may be to split this test case so that only CountQueuingStrategy and ByteLengthQueuingStrategy tests fail.
Comment 6 Romain Bellessort 2017-12-12 01:29:15 PST
In fact I was wrong, CountQueuingStrategy and ByteLengthQueuingStrategy are already implemented, so the test will pass, sorry for the misunderstanding. 

I will prepare a new patch with the imported test. Is it ok if I just copy the new test in the corresponding file, or should I replace the whole file?
Comment 7 Romain Bellessort 2017-12-12 01:56:30 PST
Created attachment 329097 [details]
Patch
Comment 8 Romain Bellessort 2017-12-12 01:57:57 PST
This patch imports only the corresponding test from WPT. If this is not the right approach please tell me.
Comment 9 Xabier Rodríguez Calvar 2017-12-12 02:13:17 PST
Comment on attachment 329097 [details]
Patch

Lgtm, but let's wait for Youenn's opinion before landing.
Comment 10 EWS Watchlist 2017-12-12 02:52:16 PST
Comment on attachment 329097 [details]
Patch

Attachment 329097 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/5628416

New failing tests:
imported/w3c/web-platform-tests/streams/readable-byte-streams/general.dedicatedworker.html
Comment 11 EWS Watchlist 2017-12-12 02:52:17 PST
Created attachment 329099 [details]
Archive of layout-test-results from ews102 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 12 EWS Watchlist 2017-12-12 03:05:04 PST
Comment on attachment 329097 [details]
Patch

Attachment 329097 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/5628433

New failing tests:
imported/w3c/web-platform-tests/streams/readable-byte-streams/general.serviceworker.https.html
imported/w3c/web-platform-tests/streams/readable-byte-streams/general.dedicatedworker.html
Comment 13 EWS Watchlist 2017-12-12 03:05:06 PST
Created attachment 329100 [details]
Archive of layout-test-results from ews104 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 14 EWS Watchlist 2017-12-12 03:18:04 PST
Comment on attachment 329097 [details]
Patch

Attachment 329097 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/5628431

New failing tests:
imported/w3c/web-platform-tests/streams/readable-byte-streams/general.dedicatedworker.html
Comment 15 EWS Watchlist 2017-12-12 03:18:05 PST
Created attachment 329102 [details]
Archive of layout-test-results from ews113 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews113  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 16 EWS Watchlist 2017-12-12 03:20:12 PST
Comment on attachment 329097 [details]
Patch

Attachment 329097 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/5628445

New failing tests:
imported/w3c/web-platform-tests/streams/readable-byte-streams/general.dedicatedworker.html
Comment 17 EWS Watchlist 2017-12-12 03:20:13 PST
Created attachment 329103 [details]
Archive of layout-test-results from ews123 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews123  Port: ios-simulator-wk2  Platform: Mac OS X 10.12.6
Comment 18 Romain Bellessort 2017-12-12 06:04:12 PST
Created attachment 329109 [details]
Patch
Comment 19 Romain Bellessort 2017-12-12 07:08:11 PST
I had forgotten to update some expectations. The new patch fixes that.
Comment 20 youenn fablet 2017-12-12 08:16:52 PST
Comment on attachment 329109 [details]
Patch

LGTM too
Comment 21 WebKit Commit Bot 2017-12-12 08:51:58 PST
Comment on attachment 329109 [details]
Patch

Clearing flags on attachment: 329109

Committed r225784: <https://trac.webkit.org/changeset/225784>
Comment 22 WebKit Commit Bot 2017-12-12 08:52:00 PST
All reviewed patches have been landed.  Closing bug.
Comment 23 Radar WebKit Bug Importer 2017-12-12 08:52:38 PST
<rdar://problem/35995043>