Tests/LibWeb: Verify we throw when trying to pipe through locked streams
This commit is contained in:
parent
9802cf07bd
commit
29521b50e6
Notes:
sideshowbarker
2024-07-17 09:37:30 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/29521b50e6 Pull-request: https://github.com/SerenityOS/serenity/pull/23874 Reviewed-by: https://github.com/shannonbooth ✅
4 changed files with 36 additions and 0 deletions
|
@ -0,0 +1 @@
|
|||
TypeError: Failed to execute 'pipeThrough' on 'ReadableStream': Cannot pipe a locked stream
|
|
@ -0,0 +1 @@
|
|||
TypeError: Failed to execute 'pipeThrough' on 'ReadableStream': parameter 1's 'writable' is locked
|
|
@ -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>
|
|
@ -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>
|
Loading…
Add table
Reference in a new issue