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

ricea commented on this pull request.



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

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 10:53:57 UTC