callback-multicalls.html (864B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>AnimationTiming Test: multiple calls to requestAnimationFrame with the same callback</title> 4 <link rel="author" title="Intel" href="http://www.intel.com"> 5 <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-window-requestanimationframe"> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <div id="log"></div> 9 <script> 10 11 async_test(function(t) { 12 var counter = 0; 13 window.requestAnimationFrame(callback); 14 15 function callback() { 16 ++counter; 17 if (counter == 2) { 18 t.done(); 19 } else { 20 window.requestAnimationFrame(callback); 21 } 22 }; 23 24 }, "Check that multiple calls to requestAnimationFrame with the same callback will result in multiple entries being in the list with that same callback."); 25 26 </script>