mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-21 00:38:56 +00:00
Tests/LibWeb: Verify we throw when trying to pipe from/to locked streams
This commit is contained in:
parent
8ff52582ce
commit
a0802b6e29
Notes:
sideshowbarker
2024-07-17 05:05:51 +09:00
Author: https://github.com/kennethmyhra
Commit: a0802b6e29
Pull-request: https://github.com/SerenityOS/serenity/pull/23869
Reviewed-by: https://github.com/shannonbooth ✅
4 changed files with 46 additions and 0 deletions
|
@ -0,0 +1 @@
|
|||
TypeError: Failed to execute 'pipeTo' on 'ReadableStream': Cannot pipe a locked stream
|
|
@ -0,0 +1 @@
|
|||
TypeError: Failed to execute 'pipeTo' on 'ReadableStream': Cannot pipe to a locked stream
|
|
@ -0,0 +1,22 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
asyncTest(done => {
|
||||
const writableStream = new WritableStream(
|
||||
{
|
||||
write(chunk) {}
|
||||
}
|
||||
);
|
||||
const stream = new ReadableStream({
|
||||
start(controller) {},
|
||||
pull(controller) {},
|
||||
cancel() {},
|
||||
});
|
||||
|
||||
stream.getReader();
|
||||
stream.pipeTo(writableStream)
|
||||
.catch(reason => {
|
||||
println(reason);
|
||||
done();
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,22 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
asyncTest(done => {
|
||||
const writableStream = new WritableStream(
|
||||
{
|
||||
write(chunk) {}
|
||||
}
|
||||
);
|
||||
const stream = new ReadableStream({
|
||||
start(controller) {},
|
||||
pull(controller) {},
|
||||
cancel() {},
|
||||
});
|
||||
|
||||
writableStream.getWriter();
|
||||
stream.pipeTo(writableStream)
|
||||
.catch(reason => {
|
||||
println(reason);
|
||||
done();
|
||||
});
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue