ladybird/Tests/LibWeb/Text/input/Streams/TransformStream-readable-cancel.html

24 lines
839 B
HTML
Raw Normal View History

2025-03-18 19:28:35 +01:00
<!DOCTYPE html>
<script src="../include.js"></script>
<script>
test(() => {
const ts = new TransformStream();
ts.readable.cancel(new Error("error1"));
ts.writable.getWriter().closed.catch(e => {
println(`catch ${e}`);
});
const tsWithBackpressure = new TransformStream({}, undefined, { highWaterMark: 0 });
tsWithBackpressure.readable.cancel(new Error("error1"))
tsWithBackpressure.writable.getWriter().closed.catch(e => {
println(`catch ${e}`)
})
const tsWithoutBackpressure = new TransformStream({}, undefined, { highWaterMark: 1 });
tsWithoutBackpressure.readable.cancel(new Error("error1"))
tsWithoutBackpressure.writable.getWriter().closed.catch(e => {
println(`catch ${e}`)
})
});
</script>