tor-browser

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

loaf-pause-duration.html (1089B)


      1 <!DOCTYPE HTML>
      2 <meta charset=utf-8>
      3 <title>Long Animation Frame Timing: pause</title>
      4 <meta name="timeout" content="long">
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 <script src="resources/utils.js"></script>
      8 
      9 <body>
     10 <h1>Long Animation Frame: pause</h1>
     11 <div id="log"></div>
     12 <script>
     13 
     14 promise_test(async t => {
     15  const pause_duration = very_long_frame_duration / 2;
     16  [entry, script] = await expect_long_frame_with_script((t, busy_wait) => t.step_timeout(() => {
     17    busy_wait(pause_duration);
     18    const sync_xhr = new XMLHttpRequest();
     19    sync_xhr.open("GET", `/xhr/resources/delay.py?ms=${pause_duration}`, /*async=*/false);
     20    sync_xhr.send();
     21  }, 0), script => (
     22        script.invoker === "TimerHandler:setTimeout" &&
     23        script.duration >= very_long_frame_duration), t);
     24  assert_true("pauseDuration" in script);
     25  assert_greater_than(script.pauseDuration, pause_duration);
     26 }, "Synchronous XHR should be counted as pauseDuration");
     27 
     28 // TODO: Test for alert/confirm, requires WPT infra changes.
     29 </script>
     30 </body>