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

Unified Diff: LayoutTests/svg/animations/svg-animation-policy-none.html

Issue 802143002: AnimationPolicy setting is applied to SVG animation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/svg/animations/svg-animation-policy-none.html
diff --git a/LayoutTests/svg/animations/svg-animation-policy-none.html b/LayoutTests/svg/animations/svg-animation-policy-none.html
new file mode 100644
index 0000000000000000000000000000000000000000..e083771d08115e7ba9dfa9366c9ed52c809f2c5f
--- /dev/null
+++ b/LayoutTests/svg/animations/svg-animation-policy-none.html
@@ -0,0 +1,65 @@
+<!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>

Powered by Google App Engine
This is Rietveld 408576698