LibWeb/Tests: Add basic test for ByteLengthQueuingStrategy
This commit is contained in:
parent
a975fca42e
commit
a92d94f4e9
Notes:
sideshowbarker
2024-07-17 07:25:39 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/a92d94f4e9 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 26 additions and 0 deletions
|
@ -0,0 +1,4 @@
|
|||
5
|
||||
2
|
||||
-5
|
||||
-6
|
|
@ -0,0 +1,22 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
let controller;
|
||||
new ReadableStream(
|
||||
{
|
||||
start(c) {
|
||||
controller = c;
|
||||
}
|
||||
},
|
||||
new ByteLengthQueuingStrategy({ highWaterMark: 5 })
|
||||
);
|
||||
|
||||
println(controller.desiredSize);
|
||||
controller.enqueue(new Uint8Array([1, 2, 3]));
|
||||
println(controller.desiredSize);
|
||||
controller.enqueue(new Uint8Array([1, 2, 3, 4, 5, 6, 7]));
|
||||
println(controller.desiredSize);
|
||||
controller.enqueue(new Uint8Array([1]));
|
||||
println(controller.desiredSize);
|
||||
});
|
||||
</script>
|
Loading…
Add table
Reference in a new issue