tor-browser

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

loaf-buffered.html (1069B)


      1 <!DOCTYPE HTML>
      2 <meta charset=utf-8>
      3 <title>Long Animation Frame Timing: basic</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: buffered</h1>
     11 <div id="log"></div>
     12 <script>
     13 promise_test(async t => {
     14    busy_wait(very_long_frame_duration);
     15    await new Promise(resolve => t.step_timeout(resolve, 0));
     16    const result = await new Promise(resolve => {
     17        new PerformanceObserver(t.step_func(entries => {
     18            for (const e of entries.getEntries()) {
     19                if (e.duration >= very_long_frame_duration)
     20                    resolve("entry-found");
     21            }
     22        })).observe({type: 'long-animation-frame', buffered: true});
     23        t.step_timeout(() => resolve("timeout"), waiting_for_long_frame_timeout);
     24    });
     25    assert_equals(result, "entry-found");
     26 }, 'PerformanceObserver with buffered flag can see previous long-animation-frame entries.');
     27 </script>
     28 </body>