Tests/LibWeb: Verify we throw when trying to pipe through locked streams

This commit is contained in:
Kenneth Myhra 2024-04-07 13:17:29 +02:00 committed by Luke Wilde
parent 9802cf07bd
commit 29521b50e6
Notes: sideshowbarker 2024-07-17 09:37:30 +09:00
4 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1 @@
TypeError: Failed to execute 'pipeThrough' on 'ReadableStream': Cannot pipe a locked stream

View file

@ -0,0 +1 @@
TypeError: Failed to execute 'pipeThrough' on 'ReadableStream': parameter 1's 'writable' is locked

View file

@ -0,0 +1,17 @@
<script src="../include.js"></script>
<script>
asyncTest(done => {
const transformStream = new TransformStream();
const stream = new ReadableStream();
stream.getReader();
try {
stream.pipeThrough(transformStream);
}
catch (e) {
println(e);
}
done();
});
</script>

View file

@ -0,0 +1,17 @@
<script src="../include.js"></script>
<script>
asyncTest(done => {
const transformStream = new TransformStream();
const stream = new ReadableStream();
transformStream.writable.getWriter();
try {
stream.pipeThrough(transformStream);
}
catch (e) {
println(e);
}
done();
});
</script>