Skip to content

Commit

Permalink
Bug 1865314 [wpt PR 43227] - LoAF: count tasks with UI events towards…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
marco-c committed Nov 30, 2023
1 parent 8a40984 commit 893310a
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,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.name === "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>

0 comments on commit 893310a

Please sign in to comment.