2025-03-18 15:28:35 -03:00
|
|
|
<!DOCTYPE html>
|
2024-06-02 17:33:13 -03:00
|
|
|
<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>
|