mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 11:36:10 +00:00
LibWeb: Import ReadableStreamPipeTo synchronous writing tests
This commit is contained in:
parent
8599917188
commit
6f6b39ecec
Notes:
github-actions[bot]
2025-04-14 20:57:20 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/6f6b39ecec8 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4357
3 changed files with 36 additions and 0 deletions
|
@ -0,0 +1,6 @@
|
|||
Harness status: OK
|
||||
|
||||
Found 1 tests
|
||||
|
||||
1 Fail
|
||||
Fail enqueue() must not synchronously call write algorithm
|
|
@ -0,0 +1,15 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
|
||||
<script>
|
||||
self.GLOBAL = {
|
||||
isWindow: function() { return true; },
|
||||
isWorker: function() { return false; },
|
||||
isShadowRealm: function() { return false; },
|
||||
};
|
||||
</script>
|
||||
<script src="../../resources/testharness.js"></script>
|
||||
<script src="../../resources/testharnessreport.js"></script>
|
||||
|
||||
<div id=log></div>
|
||||
<script src="../../streams/piping/general-addition.any.js"></script>
|
|
@ -0,0 +1,15 @@
|
|||
// META: global=window,worker,shadowrealm
|
||||
'use strict';
|
||||
|
||||
promise_test(async t => {
|
||||
/** @type {ReadableStreamDefaultController} */
|
||||
var con;
|
||||
let synchronous = false;
|
||||
new ReadableStream({ start(c) { con = c }}, { highWaterMark: 0 }).pipeTo(
|
||||
new WritableStream({ write() { synchronous = true; } })
|
||||
)
|
||||
// wait until start algorithm finishes
|
||||
await Promise.resolve();
|
||||
con.enqueue();
|
||||
assert_false(synchronous, 'write algorithm must not run synchronously');
|
||||
}, "enqueue() must not synchronously call write algorithm");
|
Loading…
Add table
Reference in a new issue