OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/js-test.js"></script> |
| 3 <script src="resources/SVGTestCase.js"></script> |
| 4 <script src="resources/SVGAnimationTestCase.js"></script> |
| 5 <script> |
| 6 if (window.internals) |
| 7 internals.settings.setImageAnimationPolicy("none"); |
| 8 |
| 9 function startTest() { |
| 10 // Before running runSMILTest(), we check it first, |
| 11 // because runSMILTest() calls pauseAnimations. |
| 12 // It should be True because AnimationPolicy is set with 'none'. |
| 13 shouldBeTrue("rootSVGElement.animationsPaused()"); |
| 14 runSMILTest(); |
| 15 } |
| 16 </script> |
| 17 <body onload="startTest()"> |
| 18 <h1>SVG with animation policy, none</h1> |
| 19 <p id="description"></p> |
| 20 <div id="console"></div> |
| 21 <script> |
| 22 description("This tests svg animation with animation policy none"); |
| 23 function checkValues(paused) { |
| 24 shouldBeTrue("rootSVGElement.animationsPaused()"); |
| 25 shouldBe("rootSVGElement.getCurrentTime()", "0"); |
| 26 rootSVGElement.setCurrentTime(5.0); |
| 27 shouldBe("rootSVGElement.getCurrentTime()", "0"); |
| 28 } |
| 29 |
| 30 function checkValuesOnEachState() { |
| 31 checkValues(); |
| 32 rootSVGElement.pauseAnimations(); |
| 33 checkValues(); |
| 34 rootSVGElement.unpauseAnimations(); |
| 35 checkValues(); |
| 36 } |
| 37 // Setup animation test |
| 38 function sample1() { |
| 39 shouldBe("rect.y.animVal.value", "0"); |
| 40 shouldBe("rect.y.baseVal.value", "0"); |
| 41 checkValuesOnEachState(); |
| 42 } |
| 43 |
| 44 function sample2() { |
| 45 sample1(); |
| 46 } |
| 47 |
| 48 function sample3() { |
| 49 sample1(); |
| 50 } |
| 51 |
| 52 function sample4() { |
| 53 sample1(); |
| 54 } |
| 55 |
| 56 function sample5() { |
| 57 sample1(); |
| 58 } |
| 59 |
| 60 function sample6() { |
| 61 sample1(); |
| 62 } |
| 63 </script> |
| 64 <script src="script-tests/svg-animation-policy.js"></script> |
| 65 </body> |
OLD | NEW |