forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Close acquired writer in AO readable_stream_pipe_to()
Also adds a test to prove that the WritableStream's close callback is called.
- Loading branch information
1 parent
15b6773
commit e2c4019
Showing
3 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
Tests/LibWeb/Text/expected/Streams/ReadableStream-pipeTo-Writer-close-callback-called.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Writer has been closed. |
20 changes: 20 additions & 0 deletions
20
Tests/LibWeb/Text/input/Streams/ReadableStream-pipeTo-Writer-close-callback-called.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters