Bug 152505 - [Streams API] In RS during enqueuing error should be reported only if readable
Summary: [Streams API] In RS during enqueuing error should be reported only if readable
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Xabier Rodríguez Calvar
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-22 08:57 PST by Xabier Rodríguez Calvar
Modified: 2015-12-23 10:14 PST (History)
3 users (show)

See Also:


Attachments
Patch (1.63 KB, patch)
2015-12-22 08:59 PST, Xabier Rodríguez Calvar
no flags Details | Formatted Diff | Diff
Patch (6.95 KB, patch)
2015-12-23 05:17 PST, Xabier Rodríguez Calvar
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xabier Rodríguez Calvar 2015-12-22 08:57:15 PST
[Streams API] In RS during enqueuing error should be reported only if readable
Comment 1 Xabier Rodríguez Calvar 2015-12-22 08:59:42 PST
Created attachment 267787 [details]
Patch
Comment 2 youenn fablet 2015-12-22 09:10:24 PST
Looks ok.
I wonder why the patch does not contain any test modification.
What about the tests added in https://github.com/whatwg/streams/commit/2e7f87e45806d58114592c923aed299798d10161?
Comment 3 Xabier Rodríguez Calvar 2015-12-22 09:39:45 PST
(In reply to comment #2)
> Looks ok.
> I wonder why the patch does not contain any test modification.
> What about the tests added in
> https://github.com/whatwg/streams/commit/
> 2e7f87e45806d58114592c923aed299798d10161?

You're right, I saw them at that moment and I forget about them later.
Comment 4 Xabier Rodríguez Calvar 2015-12-23 05:17:14 PST
Created attachment 267836 [details]
Patch

Added tests
Comment 5 youenn fablet 2015-12-23 06:22:20 PST
Comment on attachment 267836 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=267836&action=review

> LayoutTests/imported/w3c/web-platform-tests/streams-api/readable-streams/bad-strategies.js:46
> +}, 'Readable stream: strategy.size errors the stream and then throws');

Are we not already passing this test without ReadableStreamInternals.js tests?

> LayoutTests/imported/w3c/web-platform-tests/streams-api/readable-streams/bad-strategies.js:71
> +    assert_equals(error.name, 'RangeError', 'enqueue should throw a RangeError');

Are we not passing this test without the patch?
The checks of this test may not be sufficient enough.
It seems to me we should check that rs.getReader().closed be equal to theError.
Comment 6 Xabier Rodríguez Calvar 2015-12-23 07:05:55 PST
(In reply to comment #5)
> > LayoutTests/imported/w3c/web-platform-tests/streams-api/readable-streams/bad-strategies.js:46
> > +}, 'Readable stream: strategy.size errors the stream and then throws');
> 
> Are we not already passing this test without ReadableStreamInternals.js
> tests?

> > LayoutTests/imported/w3c/web-platform-tests/streams-api/readable-streams/bad-strategies.js:71
> > +    assert_equals(error.name, 'RangeError', 'enqueue should throw a RangeError');

Both fail in debug because of the assert, but not in release.
Comment 7 youenn fablet 2015-12-23 07:47:39 PST
Comment on attachment 267836 [details]
Patch

r=me.
It would be good to improve the second test: making it a promise test, expecting the error to be theError and not a RangeError, either here or as a pull request to whatwg streams github.
Comment 8 Xabier Rodríguez Calvar 2015-12-23 09:27:57 PST
(In reply to comment #7)
> Comment on attachment 267836 [details]
> Patch
> 
> r=me.

Landing.

> It would be good to improve the second test: making it a promise test,
> expecting the error to be theError and not a RangeError, either here or as a
> pull request to whatwg streams github.

I'll do it GitHub.
Comment 9 Xabier Rodríguez Calvar 2015-12-23 10:07:56 PST
(In reply to comment #8)
> > It would be good to improve the second test: making it a promise test,
> > expecting the error to be theError and not a RangeError, either here or as a
> > pull request to whatwg streams github.
> 
> I'll do it GitHub.

https://github.com/whatwg/streams/pull/420
Comment 10 WebKit Commit Bot 2015-12-23 10:14:22 PST
Comment on attachment 267836 [details]
Patch

Clearing flags on attachment: 267836

Committed r194391: <http://trac.webkit.org/changeset/194391>
Comment 11 WebKit Commit Bot 2015-12-23 10:14:26 PST
All reviewed patches have been landed.  Closing bug.