tor-browser

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

loaf-iframe-same-origin.html (1477B)


      1 <!DOCTYPE HTML>
      2 <meta charset=utf-8>
      3 <title>Long Animation Frame Timing: iframes (same-origin)</title>
      4 <meta name="timeout" content="long">
      5 <body>
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <script src="/common/get-host-info.sub.js"></script>
      9 <script src="/common/utils.js"></script>
     10 <script src="/common/dispatcher/dispatcher.js"></script>
     11 <script src="resources/utils.js"></script>
     12 <div id="log"></div>
     13 <script>
     14 const host_info = get_host_info();
     15 const {ORIGIN, REMOTE_ORIGIN, HTTP_NOTSAMESITE_ORIGIN} = host_info;
     16 
     17 promise_test(async t => {
     18    const [executor] = await prepare_exec_iframe(t, ORIGIN);
     19    await expect_no_long_frame(() => executor.execute_script((duration) => {
     20        const deadline = performance.now() + duration;
     21        while (performance.now() < deadline) {}
     22    }, [very_long_frame_duration]), t);
     23 }, 'A long busy wait without render in a same-origin iframe is not a long animation frame');
     24 
     25 promise_test(async t => {
     26    const [executor] = await prepare_exec_iframe(t, ORIGIN);
     27    await expect_long_frame(() => executor.execute_script(async (duration) => {
     28        await new Promise(resolve => window.requestAnimationFrame(resolve));
     29        const deadline = performance.now() + duration;
     30        while (performance.now() < deadline) {}
     31    }, [very_long_frame_duration]), t);
     32 }, 'A long busy wait in a same-origin requestAnimationFrame is a long animation frame');
     33 
     34 </script>
     35 </body>