tor-browser

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

cancel-pending.html (845B)


      1 <!doctype html>
      2 <title>cancelAnimationFrame cancels a pending animation frame callback</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <link rel="help" href="https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#run-the-animation-frame-callbacks">
      6 <div id="log"></div>
      7 <script>
      8 async_test(t => {
      9  let didCall = false;
     10 
     11  function callbackOne() {
     12    cancelAnimationFrame(twoHandle);
     13    requestAnimationFrame(t.step_func(() => {
     14      assert_false(didCall, 'Should NOT have called the second callback');
     15      t.done();
     16    }));
     17  }
     18 
     19  function callbackTwo() {
     20    didCall = true;
     21  }
     22 
     23  requestAnimationFrame(callbackOne);
     24  const twoHandle = requestAnimationFrame(callbackTwo);
     25 }, 'cancelAnimationFrame cancels a pending animation frame callback');
     26 </script>