tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

loaf-stream.html (1347B)


      1 <!DOCTYPE HTML>
      2 <meta charset=utf-8>
      3 <title>Long Animation Frame Timing: stream promise resolvers</title>
      4 <meta name="timeout" content="long">
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 <script src="/common/get-host-info.sub.js"></script>
      8 <script src="resources/utils.js"></script>
      9 
     10 <body>
     11 <h1>Long Animation Frame: stream promise resolvers</h1>
     12 <div id="log"></div>
     13 <script>
     14 
     15 test_promise_script(async (t, busy_wait) => {
     16    const response = await fetch("/common/dummy.xml");
     17    await response.body.getReader().read();
     18    busy_wait(very_long_frame_duration);
     19 }, "resolve", "ReadableStreamDefaultReader.read.then");
     20 
     21 test_promise_script(async (t, busy_wait) => {
     22    const response = await fetch("/common/dummy.xml");
     23    await response.body.getReader({ mode: "byob" }).read(new Int32Array(1000));
     24    busy_wait(very_long_frame_duration);
     25 }, "resolve", "ReadableStreamBYOBReader.read.then");
     26 
     27 test_promise_script(async (t, busy_wait) => {
     28    const response = await fetch("/common/dummy.xml");
     29    const {readable, writable} = new TransformStream({
     30      start() {},
     31      transform() {
     32        busy_wait(very_long_frame_duration);
     33      }
     34    });
     35    response.body.pipeTo(writable);
     36    await readable.getReader().read();
     37 }, "resolve", "StreamPromise.resolve");
     38 </script>
     39 </body>