Skip to content

Commit 7076e9e

Browse files
committed
Bug 1595736 [wpt PR 20205] - Verify piping disturbs stream synchronously, a=testonly
Automatic update from web-platform-tests Verify piping disturbs stream synchronously (#20205) whatwg/streams#1022 changes pipeTo and pipeThrough to always set the [[disturbed]] slot of the Response's body to true synchronously. This test verifies that behaviour. -- wpt-commits: 760485a4f652813d1f195ee28042c391cf2fdc02 wpt-pr: 20205 UltraBlame original commit: fcba8dc0552eb96c10b6997d7313972e5177ac93
1 parent dc042ef commit 7076e9e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
test(() => {
2+
const r = new Response(new ReadableStream());
3+
4+
r.body.pipeTo(new WritableStream({}, {highWaterMark: 0}));
5+
assert_true(r.bodyUsed, 'bodyUsed should be true');
6+
}, 'using pipeTo on Response body should disturb it synchronously');
7+
8+
test(() => {
9+
const r = new Response(new ReadableStream());
10+
r.body.pipeThrough({
11+
writable: new WritableStream({}, {highWaterMark: 0}),
12+
readable: new ReadableStream()
13+
});
14+
assert_true(r.bodyUsed, 'bodyUsed should be true');
15+
}, 'using pipeThrough on Response body should disturb it synchronously');

0 commit comments

Comments
 (0)