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
a971bfb
commit 42725e2
Showing
8 changed files
with
80 additions
and
9 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
Tests/LibWeb/Text/expected/Streams/TransformStream-cancelled-by-readable-side.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: cancel called by the readable side. |
1 change: 1 addition & 0 deletions
1
Tests/LibWeb/Text/expected/Streams/TransformStream-cancelled-by-writable-side.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: abort called by the writable side. |
16 changes: 16 additions & 0 deletions
16
Tests/LibWeb/Text/input/Streams/TransformStream-cancelled-by-readable-side.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,16 @@ | ||
<script src="../include.js"></script> | ||
<script> | ||
function testTransformStreamReadableStreamCancellation() { | ||
const transformStream = new TransformStream({ | ||
cancel(reason) { | ||
println(`TransformStream cancelled due to: ${reason}`); | ||
return Promise.resolve(); | ||
} | ||
}); | ||
transformStream.readable.cancel('cancel called by the readable side.'); | ||
} | ||
|
||
test(() => { | ||
testTransformStreamReadableStreamCancellation(); | ||
}); | ||
</script> |
16 changes: 16 additions & 0 deletions
16
Tests/LibWeb/Text/input/Streams/TransformStream-cancelled-by-writable-side.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,16 @@ | ||
<script src="../include.js"></script> | ||
<script> | ||
function testTransformStreamReadableStreamCancellation() { | ||
const transformStream = new TransformStream({ | ||
cancel(reason) { | ||
println(`TransformStream cancelled due to: ${reason}`); | ||
return Promise.resolve(); | ||
} | ||
}); | ||
transformStream.writable.abort('abort called by the writable side.'); | ||
} | ||
|
||
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