summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/streams/piping/transform-streams.any.js
blob: e079bb637cad0da3f2bb6a28569e49b84d540c2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// META: global=window,worker,shadowrealm
'use strict';

promise_test(() => {
  const rs = new ReadableStream({
    start(c) {
      c.enqueue('a');
      c.enqueue('b');
      c.enqueue('c');
      c.close();
    }
  });

  const ts = new TransformStream();

  const ws = new WritableStream();

  return rs.pipeThrough(ts).pipeTo(ws).then(() => {
    const writer = ws.getWriter();
    return writer.closed;
  });
}, 'Piping through an identity transform stream should close the destination when the source closes');