[Web Animations] Expose Web Animations CSS integration as an experimental feature
[WebKit-https.git] / LayoutTests / fast / animation / css-animation-resuming-when-visible.html
1 <!DOCTYPE html><!-- webkit-test-runner [ enableWebAnimationsCSSIntegration=true ] -->
2 <html>
3 <head>
4 <style>
5 #testDiv {
6     transition: transform 30s linear, color 2s, left 4s linear, top 4s linear;
7     position: absolute;
8 }
9 </style>
10 </head>
11 <body>
12 <script src="../../resources/js-test.js"></script>
13 <div id="testDiv">TEST</div>
14 <script>
15 description("Tests that CSS animations that are created while the page is hidden are properly resumed when the page becomes visible.");
16 jsTestIsAsync = true;
17
18 function registerAnimation()
19 {
20     testDiv.style.transform = "rotate(170deg) scale(0.2781941414347284)";
21 }
22
23 onload = function() {
24     internals.suspendAnimations();
25
26     setTimeout(function() {
27         registerAnimation();
28         setTimeout(function() {
29             shouldBeTrue("internals.animationsAreSuspended()");
30             shouldBe("internals.numberOfActiveAnimations()", "0");
31
32             internals.resumeAnimations();
33             shouldBecomeEqual("internals.numberOfActiveAnimations()", "1", finishJSTest);
34         }, 500);
35     }, 0);
36 }
37
38 </script>
39 </body>
40 </html>