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:
Kenneth Myhra 2024-05-20 10:42:33 +02:00 committed by Tim Flynn
commit e2c4019bfc
Notes: sideshowbarker 2024-07-16 23:55:09 +09:00
3 changed files with 29 additions and 2 deletions

View file

@ -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>