Automatic update from web-platform-tests Move LoAF WPTs out of /tentative This was shipped a couple of years ago, and missing this step was an oversight. Bug: 40247862 Change-Id: I7d04f89cd59c0fc0aa41048a3896d3f856aa8b45 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7166870 Reviewed-by: Yoav Weiss (@Shopify) <yoavweiss@chromium.org> Commit-Queue: Noam Rosenthal <nrosenthal@google.com> Reviewed-by: Dominic Farolino <dom@chromium.org> Cr-Commit-Position: refs/heads/main@{#1546493} -- wpt-commits: b4590125690caea31ff21da8fc36d4b1aa72bdbe wpt-pr: 56090
58 lines
2.1 KiB
HTML
58 lines
2.1 KiB
HTML
<!DOCTYPE HTML>
|
|
<meta charset=utf-8>
|
|
<title>Long Animation Frame Timing: basic</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: basic</h1>
|
|
<div id="log"></div>
|
|
<script>
|
|
|
|
promise_test(async t => {
|
|
await expect_long_frame((t, busy_wait) => busy_wait(), t);
|
|
}, 'A long busy wait is a long animation frame');
|
|
|
|
promise_test(async t => {
|
|
await expect_long_frame((t, busy_wait) => requestAnimationFrame(busy_wait), t);
|
|
}, 'A long busy wait in a requestAnimationFrame is a long animation frame');
|
|
|
|
promise_test(async t => {
|
|
const segment_duration = very_long_frame_duration / 2;
|
|
const entry = await expect_long_frame(async (t, busy_wait) => {
|
|
busy_wait(segment_duration);
|
|
await new Promise(resolve => requestAnimationFrame(() => {
|
|
busy_wait(segment_duration)
|
|
resolve();
|
|
}));
|
|
}, t);
|
|
|
|
assert_not_equals(entry, "timeout");
|
|
assert_greater_than_equal(entry.renderStart - entry.startTime, segment_duration);
|
|
}, 'A long busy wait split between a task and a requestAnimationFrame is a long animation frame');
|
|
|
|
promise_test(async t => {
|
|
const segment_duration = very_long_frame_duration / 3;
|
|
const entry = await expect_long_frame(async (t, busy_wait) => {
|
|
const element = document.createElement("div");
|
|
document.body.appendChild(element);
|
|
t.add_cleanup(() => element.remove());
|
|
busy_wait(segment_duration);
|
|
requestAnimationFrame(() => {
|
|
busy_wait(segment_duration);
|
|
});
|
|
|
|
new ResizeObserver(() => {
|
|
busy_wait(segment_duration);
|
|
}).observe(element);
|
|
}, t);
|
|
|
|
assert_not_equals(entry, "timeout");
|
|
assert_greater_than_equal(entry.renderStart - entry.startTime, segment_duration);
|
|
assert_greater_than_equal(entry.styleAndLayoutStart - entry.renderStart, segment_duration);
|
|
}, 'ResizeObservers should create a long-frame and affect layoutStartTime');
|
|
</script>
|
|
</body>
|