Automatic update from web-platform-tests LoAF: durations fix See bug for details. Bug: 502073069 Change-Id: I39b9328f87899b9f302c3d3fe36aaa7d5dc90010 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7749166 Reviewed-by: Noam Rosenthal <nrosenthal@google.com> Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Cr-Commit-Position: refs/heads/main@{#1613631} -- wpt-commits: 03b7ca40f8bd1cf92ba9de327a1d92b1ba5e798b wpt-pr: 59141
44 lines
1.8 KiB
HTML
44 lines
1.8 KiB
HTML
<!DOCTYPE HTML>
|
|
<meta charset=utf-8>
|
|
<title>Long Animation Frame Timing: nested scripts</title>
|
|
<meta name="timeout" content="long">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/common/utils.js"></script>
|
|
<script src="resources/utils.js"></script>
|
|
|
|
<body>
|
|
<h1>Long Animation Frame: nested scripts</h1>
|
|
<div id="log"></div>
|
|
<div id="dummy"></div>
|
|
<script>
|
|
promise_test(async t => {
|
|
const [entry, script] = await expect_long_frame_with_script((t, busy_wait) => {
|
|
const script_element = document.createElement("script");
|
|
script_element.async = true;
|
|
script_element.src = "resources/loaf-after-callback.js";
|
|
t.add_cleanup(() => script_element.remove());
|
|
document.body.appendChild(script_element);
|
|
}, script =>
|
|
script.invoker === new URL("resources/loaf-after-callback.js", location.href).href,
|
|
t);
|
|
// Allow small epsilon for time clamping.
|
|
assert_greater_than_equal(script.duration + 1, very_long_frame_duration);
|
|
}, "a callback inside a script block should not mask LoAFs that come afterwards")
|
|
|
|
promise_test(async t => {
|
|
const [entry, script] = await expect_long_frame_with_script((t, busy_wait) => {
|
|
const script_element = document.createElement("script");
|
|
script_element.async = true;
|
|
script_element.src = "resources/loaf-in-microtask-after-callback.js";
|
|
t.add_cleanup(() => script_element.remove());
|
|
document.body.appendChild(script_element);
|
|
}, script =>
|
|
script.invoker === new URL("resources/loaf-in-microtask-after-callback.js", location.href).href,
|
|
t);
|
|
// Allow small epsilon for time clamping.
|
|
assert_greater_than_equal(script.duration + 1, very_long_frame_duration);
|
|
}, "a callback inside a script block should not mask LoAFs in a microtask")
|
|
</script>
|
|
</body>
|