blob: 330bf84d80ca984c4c6c8740c0b8e811593a953a [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<style>
#testDiv {
transition: transform 30s linear, color 2s, left 4s linear, top 4s linear;
position: absolute;
}
</style>
</head>
<body>
<script src="../../resources/js-test.js"></script>
<div id="testDiv">TEST</div>
<script>
description("Tests that CSS animations that are created while the page is hidden are properly resumed when the page becomes visible.");
jsTestIsAsync = true;
function registerAnimation()
{
testDiv.style.transform = "rotate(170deg) scale(0.2781941414347284)";
}
onload = function() {
internals.suspendAnimations();
setTimeout(function() {
registerAnimation();
setTimeout(function() {
shouldBeTrue("internals.animationsAreSuspended()");
shouldBe("internals.numberOfActiveAnimations()", "0");
internals.resumeAnimations();
shouldBecomeEqual("internals.numberOfActiveAnimations()", "1", finishJSTest);
}, 500);
}, 0);
}
</script>
</body>
</html>