summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/long-animation-frame/tentative/loaf-event-blocking-duration.html
blob: ed31244a1d6dc1e186e89e11453e620aadf124f4 (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
<!DOCTYPE HTML>
<meta charset=utf-8>
<title>Long Animation Frame Timing: blocking duration with events</title>
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="resources/utils.js"></script>

<body>
<h1>Long Animation Frame: blocking duration with events</h1>
<div id="log"></div>
<output id="output"></output>
<script>
promise_test(async t => {
  const [entry, script] = await expect_long_frame_with_script(async () => {
    const button = document.createElement("button");
    button.innerText = "click";
    button.addEventListener("click", () => busy_wait());
    document.body.append(button);
    t.add_cleanup(() => button.remove());
    await test_driver.click(button);
  }, (script) => script.invoker === "BUTTON.onclick", t);
  assert_greater_than(entry.duration, 50);
  assert_greater_than_equal(entry.blockingDuration, 300);
}, "LoAF generated by events should generate correct blockingDuration");
</script>
</body>