diff --git a/Tests/LibWeb/Text/expected/wpt-import/streams/piping/general-addition.any.txt b/Tests/LibWeb/Text/expected/wpt-import/streams/piping/general-addition.any.txt new file mode 100644 index 00000000000..384673a5c59 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/streams/piping/general-addition.any.txt @@ -0,0 +1,6 @@ +Harness status: OK + +Found 1 tests + +1 Fail +Fail enqueue() must not synchronously call write algorithm \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/streams/piping/general-addition.any.html b/Tests/LibWeb/Text/input/wpt-import/streams/piping/general-addition.any.html new file mode 100644 index 00000000000..52c1cde1702 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/streams/piping/general-addition.any.html @@ -0,0 +1,15 @@ + + + + + + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/streams/piping/general-addition.any.js b/Tests/LibWeb/Text/input/wpt-import/streams/piping/general-addition.any.js new file mode 100644 index 00000000000..cf4aa9bea6a --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/streams/piping/general-addition.any.js @@ -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");