| Index: LayoutTests/svg/animations/svg-animation-policy-once.html
|
| diff --git a/LayoutTests/svg/animations/svg-animation-policy-once.html b/LayoutTests/svg/animations/svg-animation-policy-once.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..587655b423d4e18097431a1d348b9360b128d2ba
|
| --- /dev/null
|
| +++ b/LayoutTests/svg/animations/svg-animation-policy-once.html
|
| @@ -0,0 +1,69 @@
|
| +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
| +<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("once");
|
| +
|
| +embedSVGTestCase("resources/animation-policy.svg");
|
| +function timerFiredSecond()
|
| +{
|
| + // It should be true because animation is freezed by animation policy.
|
| + shouldBeTrue("rootSVGElement.animationsPaused()");
|
| +
|
| + if (window.testRunner)
|
| + testRunner.notifyDone();
|
| +}
|
| +
|
| +function timerFiredFirst()
|
| +{
|
| + // It should be true because animation is freezed by animation policy.
|
| + shouldBeTrue("rootSVGElement.animationsPaused()");
|
| +
|
| + rootSVGElement.pauseAnimations();
|
| + shouldBeTrue("rootSVGElement.animationsPaused()");
|
| +
|
| + // It should be animated after SVG is resumed.
|
| + rootSVGElement.unpauseAnimations();
|
| + shouldBeFalse("rootSVGElement.animationsPaused()");
|
| + rootSVGElement.setCurrentTime(5.0);
|
| + shouldBe("rootSVGElement.getCurrentTime()", "5.0");
|
| + shouldBeCloseEnough("rect.y.animVal.value", "100");
|
| + shouldBeFalse("rootSVGElement.animationsPaused()");
|
| +
|
| + setTimeout(timerFiredSecond, 3000);
|
| +}
|
| +
|
| +function runTest() {
|
| + // SVG is not suspened.
|
| + rootSVGElement.setCurrentTime(2.5);
|
| + shouldBeFalse("rootSVGElement.animationsPaused()");
|
| + shouldBe("rootSVGElement.getCurrentTime()", "2.5");
|
| + shouldBeCloseEnough("rect.y.animVal.value", "100");
|
| +
|
| + // setTimeout. It will be fired after animation is freezed.
|
| + // It's to check working after animation policy timer is fired.
|
| + // animation policy timer is 3 secs.
|
| + setTimeout(timerFiredFirst, 3000);
|
| +}
|
| +
|
| +function prepareTest() {
|
| + rect = rootSVGElement.ownerDocument.getElementsByTagName("rect")[0];
|
| + description("This tests svg animation with animation policy once");
|
| +
|
| + if (window.testRunner) {
|
| + testRunner.dumpAsText();
|
| + testRunner.waitUntilDone();
|
| + }
|
| +
|
| + // Check SVG is not paused.
|
| + shouldBeFalse("rootSVGElement.animationsPaused()");
|
| + setTimeout(runTest(), 0);
|
| +}
|
| +</script>
|
| +<body onload="prepareTest()">
|
| +<h1>SVG with animation policy, once</h1>
|
| +<p id="description"></p>
|
| +<div id="console"></div>
|
| +</body>
|
|
|