5 <title>Test that animations stop on suspend</title>
6 <style type="text/css" media="screen">
8 border: 1px solid black;
20 background-color: green;
22 -webkit-animation: move 400ms alternate infinite linear;
25 @-webkit-keyframes move {
26 from { -webkit-transform: translate3d(0px, 0px, 0px); }
27 to { -webkit-transform: translate3d(400px, 0px, 0px); }
30 <script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
31 <script type="text/javascript" charset="utf-8">
33 const expectedValues = [
34 // [animation-name, time, element-id, property, expected-value, tolerance]
35 ["move", 0.2, "box", "webkitTransform", [1,0,0,1, 100, 0], 30],
36 ["move", 0.2, "iframe.subframe-box", "webkitTransform", [1,0,0,1, 100, 0], 30],
37 ["move", 0.4, "box", "webkitTransform", [1,0,0,1, 200, 0], 30],
38 ["move", 0.4, "iframe.subframe-box", "webkitTransform", [1,0,0,1, 200, 0], 30],
43 if (window.layoutTestController)
44 layoutTestController.suspendAnimations();
49 if (window.layoutTestController)
50 layoutTestController.resumeAnimations();
55 setTimeout(suspend, 100);
56 setTimeout(resume, 300);
59 runAnimationTest(expectedValues, setTimers, undefined, true);
64 <div class="box" id="box"></div>
65 <!-- The parent document may into compositing mode by the iframe. -->
66 <iframe id="iframe" src="resources/stop-animation-on-suspend-subframe.html"></iframe>
67 <div id="result"></div>