blob: 19b6e956231e223a3810138302885c3ad35296f3 [file] [log] [blame] [edit]
<!DOCTYPE HTML>
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
<style>
#box {
width: 100px;
height: 100px;
background-color: silver;
}
#box.animating {
animation: spinner 0.25s steps(2) 1;
}
@keyframes spinner {
from { transform:rotate(0deg); }
to { transform:rotate(360deg); }
}
</style>
<script>
window.jsTestIsAsync = true;
let count = 0;
window.addEventListener('load', () => {
if (!window.internals) {
finishJSTest();
return;
}
window.internals.setSpeculativeTilingDelayDisabledForTesting(true);
let box = document.getElementById('box');
box.addEventListener('animationstart', () => {
internals.startTrackingRenderingUpdates();
shouldBe('count', '0');
}, false);
box.addEventListener('animationend', () => {
// As long as the rendering count remains under 15, which matches 0.25s with
// a refresh rate of 60fps, then this test is positive.
count = internals.renderingUpdateCount();
shouldBeTrue('count <= 10');
if (count > 10)
debug(`Saw ${count} updates`);
finishJSTest();
}, false);
box.classList.add('animating');
}, false);
</script>
</head>
<body>
<div id="box"></div>
<div id="console"></div>
<script src="../resources/js-test-post.js"></script>
</body>
</html>