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

ricea commented on this pull request.



> +if (self.importScripts) {
+  self.importScripts('/resources/testharness.js', '../resources/recording-streams.js', '../resources/test-utils.js');
+}
+
+promise_test(() => {
+  const ts = recordingIdentityTransformStream();
+  const writer = ts.writable.getWriter();
+  writer.write('a');
+  writer.write('b');
+  return delay(0).then(() => {
+    assert_array_equals(ts.events, ['transform', 'a'], 'transform should be called once');
+  });
+}, 'transform() should be called once with default identity transform');
+
+promise_test(() => {
+  // Without a transform() implementation, recordingTransformStream() never enqueues anything.

Now that identity behaviour is the default for recordingTransformStream, it is explicit that this one is discarding chunks and so I've been able to reduce the need for explanation a bit.

-- 
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_r134706434

Received on Wednesday, 23 August 2017 09:51:41 UTC