⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 194391 in webkit


Ignore:
Timestamp:
Dec 23, 2015, 10:13:57 AM (11 years ago)
Author:
calvaris@igalia.com
Message:

[Streams API] In RS during enqueuing error should be reported only if readable
https://bugs.webkit.org/show_bug.cgi?id=152505

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Updated imported spec tests.

  • web-platform-tests/streams-api/README.txt: Updated spec version.
  • web-platform-tests/streams-api/readable-streams/bad-strategies-expected.txt: Expectations.
  • web-platform-tests/streams-api/readable-streams/bad-strategies.js: Added two new tests.

Source/WebCore:

This commit fixes last spec change done in
https://github.com/whatwg/streams/commit/4ba861e6f60c248060811830e11271c84b439cc3.

Test: imported/w3c/web-platform-tests/streams-api/readable-streams/bad-strategies.html

  • Modules/streams/ReadableStreamInternals.js:

(enqueueInReadableStream): Call @errorReadableStream only if state is readable.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r194329 r194391  
     12015-12-23  Xabier Rodriguez Calvar  <calvaris@igalia.com>
     2
     3        [Streams API] In RS during enqueuing error should be reported only if readable
     4        https://bugs.webkit.org/show_bug.cgi?id=152505
     5
     6        Reviewed by Youenn Fablet.
     7
     8        Updated imported spec tests.
     9
     10        * web-platform-tests/streams-api/README.txt: Updated spec version.
     11        * web-platform-tests/streams-api/readable-streams/bad-strategies-expected.txt: Expectations.
     12        * web-platform-tests/streams-api/readable-streams/bad-strategies.js: Added two new tests.
     13
    1142015-12-21  Xabier Rodriguez Calvar  <calvaris@igalia.com>
    215
  • trunk/LayoutTests/imported/w3c/web-platform-tests/streams-api/README.txt

    r194329 r194391  
    44automatic.
    55
    6 Current version: https://github.com/whatwg/streams/tree/f7cb0eac03e6a6d045d6e8c09df1f9f8a264fdef/reference-implementation/web-platform-tests.
     6Current version: https://github.com/whatwg/streams/tree/2e7f87e45806d58114592c923aed299798d10161/reference-implementation/web-platform-tests.
  • trunk/LayoutTests/imported/w3c/web-platform-tests/streams-api/readable-streams/bad-strategies-expected.txt

    r194319 r194391  
    11
    22PASS Readable stream: throwing strategy.size getter
     3PASS Readable stream: strategy.size errors the stream and then throws
     4PASS Readable stream: strategy.size errors the stream and then returns Infinity
    35PASS Readable stream: throwing strategy.size method
    46PASS Readable stream: throwing strategy.highWaterMark getter
     
    1113      get size() {
    1214 ..." threw object "ReferenceError: Can't find variable: ReadableStream" ("ReferenceError") expected object "Error: a unique string" ("Error")
     15FAIL Readable stream: strategy.size errors the stream and then throws Can't find variable: ReadableStream
     16FAIL Readable stream: strategy.size errors the stream and then returns Infinity Can't find variable: ReadableStream
    1317FAIL Readable stream: throwing strategy.size method Can't find variable: ReadableStream
    1418FAIL Readable stream: throwing strategy.highWaterMark getter assert_throws: construction should re-throw the error function "() => {
  • trunk/LayoutTests/imported/w3c/web-platform-tests/streams-api/readable-streams/bad-strategies.js

    r193824 r194391  
    1919
    2020}, 'Readable stream: throwing strategy.size getter');
     21
     22test(() => {
     23
     24  const theError = new Error('a unique string');
     25
     26  let controller;
     27  const rs = new ReadableStream(
     28    {
     29      start(c) {
     30        controller = c;
     31      }
     32    },
     33    {
     34      size() {
     35        controller.error(theError);
     36        throw theError;
     37      },
     38      highWaterMark: 5
     39    }
     40  );
     41
     42  assert_throws(theError, () => {
     43    controller.enqueue('a');
     44  }, 'enqueue should re-throw the error');
     45
     46}, 'Readable stream: strategy.size errors the stream and then throws');
     47
     48test(() => {
     49
     50  const theError = new Error('a unique string');
     51
     52  let controller;
     53  const rs = new ReadableStream(
     54    {
     55      start(c) {
     56        controller = c;
     57      }
     58    },
     59    {
     60      size() {
     61        controller.error(theError);
     62        return Infinity;
     63      },
     64      highWaterMark: 5
     65    }
     66  );
     67
     68  try {
     69    controller.enqueue('a');
     70  } catch (error) {
     71    assert_equals(error.name, 'RangeError', 'enqueue should throw a RangeError');
     72  }
     73
     74}, 'Readable stream: strategy.size errors the stream and then returns Infinity');
    2175
    2276promise_test(() => {
  • trunk/Source/WebCore/ChangeLog

    r194386 r194391  
     12015-12-23  Xabier Rodriguez Calvar  <calvaris@igalia.com>
     2
     3        [Streams API] In RS during enqueuing error should be reported only if readable
     4        https://bugs.webkit.org/show_bug.cgi?id=152505
     5
     6        Reviewed by Youenn Fablet.
     7
     8        This commit fixes last spec change done in
     9        https://github.com/whatwg/streams/commit/4ba861e6f60c248060811830e11271c84b439cc3.
     10
     11        Test: imported/w3c/web-platform-tests/streams-api/readable-streams/bad-strategies.html
     12
     13        * Modules/streams/ReadableStreamInternals.js:
     14        (enqueueInReadableStream): Call @errorReadableStream only if state is readable.
     15
    1162015-12-23  Chris Aljoudi <chris@chrismatic.io> and Alex Christensen <achristensen@webkit.org>
    217
  • trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js

    r194035 r194391  
    329329    }
    330330    catch(error) {
    331         @errorReadableStream(stream, error);
     331        if (stream.@state === @streamReadable)
     332            @errorReadableStream(stream, error);
    332333        throw error;
    333334    }
Note: See TracChangeset for help on using the changeset viewer.