Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | |
| 2 <script src="../../resources/js-test.js"></script> | |
| 3 <script src="resources/SVGTestCase.js"></script> | |
|
fs
2014/12/25 17:32:07
Are these really needed except for the "embedSVGTe
je_julie(Not used)
2014/12/27 07:08:53
I removed that script external link and I added AP
| |
| 4 <script src="resources/SVGAnimationTestCase.js"></script> | |
| 5 <script> | |
| 6 if (window.internals) | |
| 7 internals.settings.setImageAnimationPolicy("once"); | |
| 8 | |
| 9 embedSVGTestCase("resources/animation-policy.svg"); | |
| 10 function timerFiredSecond() | |
| 11 { | |
| 12 // It should be true because animation is freezed by animation policy. | |
|
fs
2014/12/25 17:32:07
Nit: s/freezed/frozen/
You could probably also s/
je_julie(Not used)
2014/12/27 07:08:53
Done.
| |
| 13 shouldBeTrue("rootSVGElement.animationsPaused()"); | |
| 14 | |
| 15 if (window.testRunner) | |
| 16 testRunner.notifyDone(); | |
| 17 } | |
| 18 | |
| 19 function timerFiredFirst() | |
| 20 { | |
| 21 // It should be true because animation is freezed by animation policy. | |
| 22 shouldBeTrue("rootSVGElement.animationsPaused()"); | |
| 23 | |
| 24 rootSVGElement.pauseAnimations(); | |
| 25 shouldBeTrue("rootSVGElement.animationsPaused()"); | |
| 26 | |
| 27 // It should be animated after SVG is resumed. | |
| 28 rootSVGElement.unpauseAnimations(); | |
| 29 shouldBeFalse("rootSVGElement.animationsPaused()"); | |
| 30 rootSVGElement.setCurrentTime(5.0); | |
| 31 shouldBe("rootSVGElement.getCurrentTime()", "5.0"); | |
| 32 shouldBeCloseEnough("rect.y.animVal.value", "100"); | |
| 33 shouldBeFalse("rootSVGElement.animationsPaused()"); | |
| 34 | |
| 35 setTimeout(timerFiredSecond, 3000); | |
| 36 } | |
| 37 | |
| 38 function runTest() { | |
| 39 // SVG is not suspened. | |
| 40 rootSVGElement.setCurrentTime(2.5); | |
| 41 shouldBeFalse("rootSVGElement.animationsPaused()"); | |
| 42 shouldBe("rootSVGElement.getCurrentTime()", "2.5"); | |
| 43 shouldBeCloseEnough("rect.y.animVal.value", "100"); | |
| 44 | |
| 45 // setTimeout. It will be fired after animation is freezed. | |
| 46 // It's to check working after animation policy timer is fired. | |
| 47 // animation policy timer is 3 secs. | |
| 48 setTimeout(timerFiredFirst, 3000); | |
|
fs
2014/12/25 17:32:07
A 6+ seconds test - ouch =/ Could we at the very l
je_julie(Not used)
2014/12/27 07:08:53
I updated test flow a little bit.
I rearranged tes
| |
| 49 } | |
| 50 | |
| 51 function prepareTest() { | |
| 52 rect = rootSVGElement.ownerDocument.getElementsByTagName("rect")[0]; | |
| 53 description("This tests svg animation with animation policy once"); | |
| 54 | |
| 55 if (window.testRunner) { | |
|
fs
2014/12/25 17:32:07
Might as well do this just after the setImageAnima
je_julie(Not used)
2014/12/27 07:08:53
Done.
| |
| 56 testRunner.dumpAsText(); | |
| 57 testRunner.waitUntilDone(); | |
| 58 } | |
| 59 | |
| 60 // Check SVG is not paused. | |
| 61 shouldBeFalse("rootSVGElement.animationsPaused()"); | |
| 62 setTimeout(runTest(), 0); | |
|
fs
2014/12/25 17:32:07
Drop the () - or the setTimeout?
je_julie(Not used)
2014/12/27 07:08:53
Done.
| |
| 63 } | |
| 64 </script> | |
| 65 <body onload="prepareTest()"> | |
| 66 <h1>SVG with animation policy, once</h1> | |
| 67 <p id="description"></p> | |
| 68 <div id="console"></div> | |
| 69 </body> | |
| OLD | NEW |