mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
Test/LibWeb: Add test to prove a ReadableStream can be cancelled
This commit is contained in:
parent
c51d01bea7
commit
fc37bc328e
Notes:
sideshowbarker
2024-07-17 20:22:04 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/LadybirdBrowser/ladybird/commit/fc37bc328e Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/95
@ -0,0 +1 @@
|
||||
ReadableStream cancelled due to: Test cancellation
|
@ -0,0 +1,17 @@
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
function testReadableStreamCancellation() {
|
||||
const readableStream = new ReadableStream({
|
||||
cancel(reason) {
|
||||
println(`ReadableStream cancelled due to: ${reason}`);
|
||||
return Promise.resolve();
|
||||
}
|
||||
});
|
||||
|
||||
readableStream.cancel('Test cancellation');
|
||||
}
|
||||
|
||||
test(() => {
|
||||
testReadableStreamCancellation();
|
||||
});
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user