Skip to content

Commit 893310a

Browse files
committed
Bug 1865314 [wpt PR 43227] - LoAF: count tasks with UI events towards blockingDuration, a=testonly
Automatic update from web-platform-tests LoAF: count tasks with UI events towards blockingDuration Apparently UI events are sent in a task that's not associated with a frame (using the input task source), so the AnimationFrameTimingMonitor thought that it was a task unrelated to the current widget. Fixed by applying the task duration if this task produced any UI events. Bug: 1501836 Change-Id: I482ada6850e0b97e7e1fc6237e75905881017587 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5033867 Reviewed-by: Michal Mocny <mmocnychromium.org> Commit-Queue: Noam Rosenthal <nrosenthalchromium.org> Cr-Original-Commit-Position: refs/heads/main{#1225647} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5039591 Cr-Commit-Position: refs/heads/main{#1226100} -- wpt-commits: 9d656455225c3a5c0c2decb7ee865e8c61c9c186 wpt-pr: 43227 UltraBlame original commit: 27a8c8dc026a50f873270ffe208950e9a6e42e32
1 parent 8a40984 commit 893310a

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!DOCTYPE HTML>
2+
<meta charset=utf-8>
3+
<title>Long Animation Frame Timing: blocking duration with events</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/testdriver.js"></script>
8+
<script src="/resources/testdriver-vendor.js"></script>
9+
<script src="/resources/testdriver-actions.js"></script>
10+
<script src="resources/utils.js"></script>
11+
12+
<body>
13+
<h1>Long Animation Frame: blocking duration with events</h1>
14+
<div id="log"></div>
15+
<output id="output"></output>
16+
<script>
17+
promise_test(async t => {
18+
const [entry, script] = await expect_long_frame_with_script(async () => {
19+
const button = document.createElement("button");
20+
button.innerText = "click";
21+
button.addEventListener("click", () => busy_wait());
22+
document.body.append(button);
23+
t.add_cleanup(() => button.remove());
24+
await test_driver.click(button);
25+
}, (script) => script.name === "BUTTON.onclick", t);
26+
assert_greater_than(entry.duration, 50);
27+
assert_greater_than_equal(entry.blockingDuration, 300);
28+
}, "LoAF generated by events should generate correct blockingDuration");
29+
</script>
30+
</body>

0 commit comments

Comments
 (0)