loaf-idle.html (1095B)
1 <!DOCTYPE HTML> 2 <meta charset=utf-8> 3 <title>Long Animation Frame Timing: requestIdleCallback</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: requestIdleCallback</h1> 11 <div id="log"></div> 12 <script> 13 setup(() => 14 assert_implements(window.requestIdleCallback, 15 'requestIdleCallback is not supported.')); 16 17 /* 18 promise_test(async t => { 19 await expect_no_long_frame(() => requestIdleCallback(busy_wait), t); 20 }, 'A long busy wait in an idle callback is not a long animation frame'); 21 */ 22 23 promise_test(async t => { 24 const segment_duration = very_long_frame_duration / 2; 25 requestIdleCallback(() => { 26 busy_wait(segment_duration); 27 requestAnimationFrame(() => { 28 busy_wait(segment_duration); 29 }); 30 }); 31 await expect_long_frame(() => {}, t); 32 }, 'A long busy wait split between an idle callback and a ' + 33 'requestAnimationFrame is a long animation frame'); 34 35 </script> 36 </body>