mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +00:00
LibWeb/Tests: Add basic test for CountQueuingStrategy
This commit is contained in:
parent
49689e5d8e
commit
b2a51e86e5
2 changed files with 29 additions and 0 deletions
|
@ -0,0 +1,5 @@
|
||||||
|
3
|
||||||
|
2
|
||||||
|
1
|
||||||
|
0
|
||||||
|
-1
|
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue