LibWeb/Tests: Add basic test for CountQueuingStrategy
This commit is contained in:
parent
49689e5d8e
commit
b2a51e86e5
Notes:
sideshowbarker
2024-07-17 07:31:31 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/b2a51e86e5 Pull-request: https://github.com/SerenityOS/serenity/pull/19555 Reviewed-by: https://github.com/kennethmyhra ✅ Reviewed-by: https://github.com/mattco98 ✅
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
Reference in a new issue