| <!DOCTYPE html> |
| <script src="../../resources/js-test.js"></script> |
| <script src="resources/SVGTestCase.js"></script> |
| <script src="resources/SVGAnimationTestCase.js"></script> |
| <script> |
| if (window.internals) |
| internals.settings.setImageAnimationPolicy("none"); |
| |
| function startTest() { |
| // Before running runSMILTest(), we check it first, |
| // because runSMILTest() calls pauseAnimations. |
| // It should be True because AnimationPolicy is set with 'none'. |
| shouldBeTrue("rootSVGElement.animationsPaused()"); |
| runSMILTest(); |
| } |
| </script> |
| <body onload="startTest()"> |
| <h1>SVG with animation policy, none</h1> |
| <p id="description"></p> |
| <div id="console"></div> |
| <script> |
| description("This tests svg animation with animation policy none"); |
| function checkValues(paused) { |
| shouldBeTrue("rootSVGElement.animationsPaused()"); |
| shouldBe("rootSVGElement.getCurrentTime()", "0"); |
| rootSVGElement.setCurrentTime(5.0); |
| shouldBe("rootSVGElement.getCurrentTime()", "0"); |
| } |
| |
| function checkValuesOnEachState() { |
| checkValues(); |
| rootSVGElement.pauseAnimations(); |
| checkValues(); |
| rootSVGElement.unpauseAnimations(); |
| checkValues(); |
| } |
| // Setup animation test |
| function sample1() { |
| shouldBe("rect.y.animVal.value", "0"); |
| shouldBe("rect.y.baseVal.value", "0"); |
| checkValuesOnEachState(); |
| } |
| |
| function sample2() { |
| sample1(); |
| } |
| |
| function sample3() { |
| sample1(); |
| } |
| |
| function sample4() { |
| sample1(); |
| } |
| |
| function sample5() { |
| sample1(); |
| } |
| |
| function sample6() { |
| sample1(); |
| } |
| </script> |
| <script src="script-tests/svg-animation-policy.js"></script> |
| </body> |