Re: [whatwg/streams] Aborting a stream should wait for pending writes (#619)

ricea commented on this pull request.



> +  });
+}, 'writes should be satisfied in order when aborting');
+
+promise_test(t => {
+  const ws = new WritableStream({
+    write() {
+      return Promise.reject(new Error());
+    }
+  }, new CountQueuingStrategy(4));
+  const writer = ws.getWriter();
+  return writer.ready.then(() => {
+    const resolveOrder = [];
+    return Promise.all([
+      promise_rejects(t, new Error(), writer.write('1'), 'pending write should be rejected')
+          .then(() => resolveOrder.push(1)),
+      promise_rejects(t, new TypeError(), writer.write('2'), 'first queued write should be rejected')

Done.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/619

Received on Thursday, 24 November 2016 11:55:16 UTC