LibWeb/Tests: Add basic test for CountQueuingStrategy

This commit is contained in:
Shannon Booth 2023-06-23 08:48:04 +12:00 committed by Andreas Kling
parent 49689e5d8e
commit b2a51e86e5
Notes: sideshowbarker 2024-07-17 07:31:31 +09:00
2 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,24 @@
<script src="../include.js"></script>
<script>
test(() => {
let controller;
new ReadableStream(
{
start(c) {
controller = c;
}
},
new CountQueuingStrategy({ highWaterMark: 3 })
);
println(controller.desiredSize);
controller.enqueue('Hello, friends!');
println(controller.desiredSize);
controller.enqueue('Enqueues being counted...');
println(controller.desiredSize);
controller.enqueue('By CountQueuingStrategy');
println(controller.desiredSize);
controller.enqueue('!');
println(controller.desiredSize);
});
</script>