diff options
Diffstat (limited to 'testing/web-platform/tests/long-animation-frame/tentative/loaf-stream.html')
-rw-r--r-- | testing/web-platform/tests/long-animation-frame/tentative/loaf-stream.html | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-stream.html b/testing/web-platform/tests/long-animation-frame/tentative/loaf-stream.html new file mode 100644 index 0000000000..e35bc2f9aa --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-stream.html @@ -0,0 +1,39 @@ +<!DOCTYPE HTML> +<meta charset=utf-8> +<title>Long Animation Frame Timing: stream promise resolvers</title> +<meta name="timeout" content="long"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/get-host-info.sub.js"></script> +<script src="resources/utils.js"></script> + +<body> +<h1>Long Animation Frame: stream promise resolvers</h1> +<div id="log"></div> +<script> + +test_promise_script(async t => { + const response = await fetch("/common/dummy.xml"); + await response.body.getReader().read(); + busy_wait(very_long_frame_duration); +}, "resolve", "ReadableStreamDefaultReader.read.then"); + +test_promise_script(async t => { + const response = await fetch("/common/dummy.xml"); + await response.body.getReader({ mode: "byob" }).read(new Int32Array(1000)); + busy_wait(very_long_frame_duration); +}, "resolve", "ReadableStreamBYOBReader.read.then"); + +test_promise_script(async t => { + const response = await fetch("/common/dummy.xml"); + const {readable, writable} = new TransformStream({ + start() {}, + transform() { + busy_wait(very_long_frame_duration); + } + }); + response.body.pipeTo(writable); + await readable.getReader().read(); +}, "resolve", "StreamPromise.resolve"); +</script> +</body> |