forked from LadybirdBrowser/ladybird
-
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: Implement and wire up TransformerStream's cancel callback
- Loading branch information
1 parent
97b3595
commit be4fff3
Showing
6 changed files
with
66 additions
and
9 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
Tests/LibWeb/Text/expected/Streams/TransformStream-cancel-callback.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 @@ | ||
TransformStream cancelled due to: Test cancellation |
19 changes: 19 additions & 0 deletions
19
Tests/LibWeb/Text/input/Streams/TransformStream-cancel-callback.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,19 @@ | ||
<script src="../include.js"></script> | ||
<script> | ||
function testTransformStreamReadableStreamCancellation() { | ||
const readableStream = new ReadableStream(); | ||
const transformStream = new TransformStream({ | ||
cancel(reason) { | ||
println(`TransformStream cancelled due to: ${reason}`); | ||
return Promise.resolve(); | ||
} | ||
}); | ||
const transformedStream = readableStream.pipeThrough(transformStream); | ||
|
||
transformedStream.cancel('Test cancellation'); | ||
} | ||
|
||
test(() => { | ||
testTransformStreamReadableStreamCancellation(); | ||
}); | ||
</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
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
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
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