mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-23 17:58:59 +00:00
LibWeb: Close acquired writer in AO readable_stream_pipe_to()
Also adds a test to prove that the WritableStream's close callback is called.
This commit is contained in:
parent
15b677385c
commit
e2c4019bfc
Notes:
sideshowbarker
2024-07-16 23:55:09 +09:00
Author: https://github.com/kennethmyhra
Commit: e2c4019bfc
Pull-request: https://github.com/SerenityOS/serenity/pull/24132
Reviewed-by: https://github.com/shannonbooth
Reviewed-by: https://github.com/trflynn89
3 changed files with 29 additions and 2 deletions
|
@ -0,0 +1,20 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
asyncTest(done => {
|
||||
const writableStream = new WritableStream({
|
||||
close() {
|
||||
println("Writer has been closed.");
|
||||
}
|
||||
}
|
||||
);
|
||||
const stream = new ReadableStream({
|
||||
pull(controller) {
|
||||
controller.close();
|
||||
}
|
||||
});
|
||||
|
||||
stream.pipeTo(writableStream).then(() => {
|
||||
done();
|
||||
});
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue