blob: e82422708402c6592864a41d57e0e19385d0447c [file] [log] [blame]
simon.fraser@apple.com4803cdd2011-04-26 03:25:14 +00001<!DOCTYPE html>
simon.fraser@apple.com5f535b92008-11-21 00:44:20 +00002
simon.fraser@apple.com4803cdd2011-04-26 03:25:14 +00003<html>
simon.fraser@apple.com5f535b92008-11-21 00:44:20 +00004<head>
simon.fraser@apple.com5f535b92008-11-21 00:44:20 +00005 <style>
simon.fraser@apple.com3d92c2b2011-04-26 21:49:10 +00006 #target {
simon.fraser@apple.com5f535b92008-11-21 00:44:20 +00007 position: relative;
8 left: 100px;
dino@apple.com60c426a2008-12-03 20:00:58 +00009 height: 50px;
10 width: 50px;
11 background-color: green;
simon.fraser@apple.com5f535b92008-11-21 00:44:20 +000012 -webkit-transition-property: left;
13 -webkit-transition-duration: 4s;
14 -webkit-transition-timing-function: linear;
15 -webkit-transition-delay: 1s;
16 }
17
simon.fraser@apple.com3d92c2b2011-04-26 21:49:10 +000018 #target.moved {
simon.fraser@apple.com5f535b92008-11-21 00:44:20 +000019 left: 200px;
20 }
simon.fraser@apple.com6510a132009-08-03 19:40:12 +000021 </style>
simon.fraser@apple.com4803cdd2011-04-26 03:25:14 +000022 <script src="resources/transition-test-helpers.js"></script>
simon.fraser@apple.com3d92c2b2011-04-26 21:49:10 +000023 <script>
simon.fraser@apple.com5f535b92008-11-21 00:44:20 +000024 function endTest() {
rniwa@webkit.orgcc082ecd2012-06-16 03:42:58 +000025 if (window.testRunner) {
26 testRunner.pauseTransitionAtTimeOnElementWithId("left", 2.0, "target");
simon.fraser@apple.com5f535b92008-11-21 00:44:20 +000027 var left = window.getComputedStyle(document.getElementById('target')).left;
28 var result = "PASS";
29 if (left != "125px") {
30 result = "FAIL - expected 125px got " + left;
31 }
32 document.getElementById('result').innerHTML = "<p>" + result + "</p>";
rniwa@webkit.orgcc082ecd2012-06-16 03:42:58 +000033 testRunner.notifyDone();
simon.fraser@apple.com5f535b92008-11-21 00:44:20 +000034 }
35 }
36
37 function startTest() {
rniwa@webkit.orgcc082ecd2012-06-16 03:42:58 +000038 if (window.testRunner) {
39 testRunner.dumpAsText();
40 testRunner.waitUntilDone();
simon.fraser@apple.com5f535b92008-11-21 00:44:20 +000041 }
42
43 document.getElementById("target").className = "moved";
simon.fraser@apple.com6510a132009-08-03 19:40:12 +000044 waitForAnimationStart(endTest, 1);
simon.fraser@apple.com5f535b92008-11-21 00:44:20 +000045 }
46 </script>
47</head>
48<body onload="startTest()">
rniwa@webkit.orgcc082ecd2012-06-16 03:42:58 +000049 <h1>Test for transition delay on testRunner API</h1>
dino@apple.com60c426a2008-12-03 20:00:58 +000050
51 <p>This test works only in DumpRenderTree. It uses an API exposed
52 only there to jump to a particular time in a running transition.
53 Tests bug <a href="https://bugs.webkit.org/show_bug.cgi?id=22368">22368</a>
54 </p>
simon.fraser@apple.com5f535b92008-11-21 00:44:20 +000055
simon.fraser@apple.com3d92c2b2011-04-26 21:49:10 +000056 <div id="target"></div>
simon.fraser@apple.com5f535b92008-11-21 00:44:20 +000057
simon.fraser@apple.com3d92c2b2011-04-26 21:49:10 +000058 <div id="result"></div>
simon.fraser@apple.com5f535b92008-11-21 00:44:20 +000059
60</body>
61</html>