REGRESSION (r230574): Interrupted hardware transitions don't behave correctly
[WebKit-https.git] / LayoutTests / transitions / transition-drt-api-delay.html
1 <!DOCTYPE html>
2
3 <html>
4 <head>
5   <style>
6     #target {
7       position: relative;
8       left: 100px;
9       height: 50px;
10       width: 50px;
11       background-color: green;
12       -webkit-transition-property: left;
13       -webkit-transition-duration: 4s;
14       -webkit-transition-timing-function: linear;
15       -webkit-transition-delay: 1s;
16     }
17     
18     #target.moved {
19       left: 200px;
20     }
21    </style>
22    <script src="resources/transition-test-helpers.js"></script>
23    <script>
24     function endTest() {
25       if (window.testRunner) {
26         var target = document.getElementById('target');
27         internals.pauseTransitionAtTimeOnElement("left", 2.0, target);
28         var left = window.getComputedStyle(target).left;
29         var result = "PASS";
30         if (left != "125px") {
31           result = "FAIL - expected 125px got " + left;
32         }
33         document.getElementById('result').innerHTML = "<p>" + result + "</p>";
34         testRunner.notifyDone();
35       }
36     }
37     
38     function startTest() {
39       if (window.testRunner) {
40         testRunner.dumpAsText();
41         testRunner.waitUntilDone();
42       }
43       
44       document.getElementById("target").className = "moved";
45       waitForAnimationStart(endTest, 1);
46     }
47    </script>
48 </head>
49 <body onload="startTest()">
50   <h1>Test for transition delay on testRunner API</h1>
51   
52   <p>This test works only in DumpRenderTree. It uses an API exposed
53     only there to jump to a particular time in a running transition.
54     Tests bug <a href="https://bugs.webkit.org/show_bug.cgi?id=22368">22368</a>
55   </p>
56
57   <div id="target"></div>
58
59   <div id="result"></div>
60
61 </body>
62 </html>