summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/long-animation-frame/tentative/loaf-idle.html
blob: bc9f910bb14858527fd6727cdf4b8278df859faf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE HTML>
<meta charset=utf-8>
<title>Long Animation Frame Timing: requestIdleCallback</title>
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/utils.js"></script>

<body>
<h1>Long Animation Frame: requestIdleCallback</h1>
<div id="log"></div>
<script>
setup(() =>
  assert_implements(window.requestIdleCallback,
    'requestIdleCallback is not supported.'));

/*
promise_test(async t => {
    await expect_no_long_frame(() => requestIdleCallback(busy_wait), t);
}, 'A long busy wait in an idle callback is not a long animation frame');
*/

promise_test(async t => {
    const segment_duration = very_long_frame_duration / 2;
    requestIdleCallback(() => {
        busy_wait(segment_duration);
        requestAnimationFrame(() => {
            busy_wait(segment_duration);
        });
    });
    await expect_long_frame(() => {}, t);
}, 'A long busy wait split between an idle callback and a ' +
   'requestAnimationFrame is a long animation frame');

</script>
</body>