simon.fraser@apple.com | 4803cdd | 2011-04-26 03:25:14 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
simon.fraser@apple.com | 5f535b9 | 2008-11-21 00:44:20 +0000 | [diff] [blame] | 2 | |
simon.fraser@apple.com | 4803cdd | 2011-04-26 03:25:14 +0000 | [diff] [blame] | 3 | <html> |
simon.fraser@apple.com | 5f535b9 | 2008-11-21 00:44:20 +0000 | [diff] [blame] | 4 | <head> |
simon.fraser@apple.com | 5f535b9 | 2008-11-21 00:44:20 +0000 | [diff] [blame] | 5 | <style> |
simon.fraser@apple.com | 3d92c2b | 2011-04-26 21:49:10 +0000 | [diff] [blame] | 6 | #target { |
simon.fraser@apple.com | 5f535b9 | 2008-11-21 00:44:20 +0000 | [diff] [blame] | 7 | position: relative; |
| 8 | left: 100px; |
dino@apple.com | 60c426a | 2008-12-03 20:00:58 +0000 | [diff] [blame] | 9 | height: 50px; |
| 10 | width: 50px; |
| 11 | background-color: green; |
simon.fraser@apple.com | 5f535b9 | 2008-11-21 00:44:20 +0000 | [diff] [blame] | 12 | -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.com | 3d92c2b | 2011-04-26 21:49:10 +0000 | [diff] [blame] | 18 | #target.moved { |
simon.fraser@apple.com | 5f535b9 | 2008-11-21 00:44:20 +0000 | [diff] [blame] | 19 | left: 200px; |
| 20 | } |
simon.fraser@apple.com | 6510a13 | 2009-08-03 19:40:12 +0000 | [diff] [blame] | 21 | </style> |
simon.fraser@apple.com | 4803cdd | 2011-04-26 03:25:14 +0000 | [diff] [blame] | 22 | <script src="resources/transition-test-helpers.js"></script> |
simon.fraser@apple.com | 3d92c2b | 2011-04-26 21:49:10 +0000 | [diff] [blame] | 23 | <script> |
simon.fraser@apple.com | 5f535b9 | 2008-11-21 00:44:20 +0000 | [diff] [blame] | 24 | function endTest() { |
rniwa@webkit.org | cc082ecd | 2012-06-16 03:42:58 +0000 | [diff] [blame] | 25 | if (window.testRunner) { |
| 26 | testRunner.pauseTransitionAtTimeOnElementWithId("left", 2.0, "target"); |
simon.fraser@apple.com | 5f535b9 | 2008-11-21 00:44:20 +0000 | [diff] [blame] | 27 | 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.org | cc082ecd | 2012-06-16 03:42:58 +0000 | [diff] [blame] | 33 | testRunner.notifyDone(); |
simon.fraser@apple.com | 5f535b9 | 2008-11-21 00:44:20 +0000 | [diff] [blame] | 34 | } |
| 35 | } |
| 36 | |
| 37 | function startTest() { |
rniwa@webkit.org | cc082ecd | 2012-06-16 03:42:58 +0000 | [diff] [blame] | 38 | if (window.testRunner) { |
| 39 | testRunner.dumpAsText(); |
| 40 | testRunner.waitUntilDone(); |
simon.fraser@apple.com | 5f535b9 | 2008-11-21 00:44:20 +0000 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | document.getElementById("target").className = "moved"; |
simon.fraser@apple.com | 6510a13 | 2009-08-03 19:40:12 +0000 | [diff] [blame] | 44 | waitForAnimationStart(endTest, 1); |
simon.fraser@apple.com | 5f535b9 | 2008-11-21 00:44:20 +0000 | [diff] [blame] | 45 | } |
| 46 | </script> |
| 47 | </head> |
| 48 | <body onload="startTest()"> |
rniwa@webkit.org | cc082ecd | 2012-06-16 03:42:58 +0000 | [diff] [blame] | 49 | <h1>Test for transition delay on testRunner API</h1> |
dino@apple.com | 60c426a | 2008-12-03 20:00:58 +0000 | [diff] [blame] | 50 | |
| 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.com | 5f535b9 | 2008-11-21 00:44:20 +0000 | [diff] [blame] | 55 | |
simon.fraser@apple.com | 3d92c2b | 2011-04-26 21:49:10 +0000 | [diff] [blame] | 56 | <div id="target"></div> |
simon.fraser@apple.com | 5f535b9 | 2008-11-21 00:44:20 +0000 | [diff] [blame] | 57 | |
simon.fraser@apple.com | 3d92c2b | 2011-04-26 21:49:10 +0000 | [diff] [blame] | 58 | <div id="result"></div> |
simon.fraser@apple.com | 5f535b9 | 2008-11-21 00:44:20 +0000 | [diff] [blame] | 59 | |
| 60 | </body> |
| 61 | </html> |