Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: LayoutTests/svg/animations/svg-animation-policy-once.html

Issue 802143002: AnimationPolicy setting is applied to SVG animation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: apply new concept Created 5 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
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("once");
8
9 embedSVGTestCase("resources/animation-policy.svg");
10 function timerFiredSecond()
11 {
12 // It should be true because animation is freezed by animation policy.
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);
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) {
56 testRunner.dumpAsText();
57 testRunner.waitUntilDone();
58 }
59
60 // Check SVG is not paused.
61 shouldBeFalse("rootSVGElement.animationsPaused()");
62 setTimeout(runTest(), 0);
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698