mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Import ReadableStreamPipeTo synchronous writing tests
This commit is contained in:
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
@@ -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");
|
||||
Reference in New Issue
Block a user