Re: [whatwg/streams] Add tests for TransformStream backpressure (#773)

domenic commented on this pull request.



> +
+promise_test(() => {
+  const ts = new TransformStream();
+  const writer = ts.writable.getWriter();
+  const reader = ts.readable.getReader();
+  const events = [];
+  writer.write('a').then(() => events.push('a'));
+  writer.write('b').then(() => events.push('b'));
+  writer.close().then(() => events.push('closed'));
+  return flushAsyncEvents().then(() => {
+    assert_array_equals(events, [], 'no writes should have resolved yet');
+    return reader.read();
+  }).then(({ value, done }) => {
+    assert_false(done, 'done should not be true');
+    assert_equals('a', value, 'value should be "a"');
+    return delay(0);

Those are pretty great explanations.

-- 
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/773#discussion_r134680031

Received on Wednesday, 23 August 2017 07:52:04 UTC