3f8bbaba3da7ece279a2c4cd735d39534a1c0266
[WebKit-https.git] / LayoutTests / platform / ios-sim-deprecated / animations / restart-after-scroll.html
1 <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
2 <style>
3 @-webkit-keyframes bounce {
4     from {
5         -webkit-transform: translate3d(0,0,0);
6     }
7     to {
8         -webkit-transform: translate3d(200px,0,0);
9     }
10 }
11
12 #animator {
13     position: relative;
14     top: 0px;
15     width: 100px;
16     height: 100px;
17     background-color: blue;
18     -webkit-animation-name: bounce;
19     -webkit-animation-duration: 100ms;
20     -webkit-animation-iteration-count: infinite;
21 }
22 </style>
23 <script>
24 var hasScrolled = false;
25
26 function sawIteration(event) {
27     if (hasScrolled) {
28         document.getElementById("results").innerText = "PASS: Saw iteration after scrolling";
29         testRunner.notifyDone();
30     }
31 }
32
33 function startScroll() {
34     if (window.eventSender) {
35         eventSender.mouseMoveTo(200, 200);
36         eventSender.mouseDown();
37         eventSender.mouseMoveTo(200, 300);
38         setTimeout(endScroll, 100);
39     }
40 }
41
42 function endScroll() {
43     eventSender.mouseUp();
44     hasScrolled = true;
45 }
46
47 function startTest() {
48     var animator = document.getElementById("animator");
49     animator.addEventListener("webkitAnimationIteration", sawIteration, false);
50     setTimeout(startScroll, 100);
51 }
52
53 if (window.testRunner) {
54     testRunner.waitUntilDone();
55     testRunner.dumpAsText();
56 }
57
58 window.addEventListener("load", startTest, false);
59 </script>
60 <div id="animator"></div>
61 <div id="results"></div>