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

Unified Diff: LayoutTests/svg/animations/script-tests/repeatn-remove-add-animation.js

Issue 23823006: [SVG] Handle repeat(n) event for svg animations (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaselined Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/svg/animations/script-tests/repeatn-remove-add-animation.js
diff --git a/LayoutTests/svg/animations/script-tests/repeatn-remove-add-animation.js b/LayoutTests/svg/animations/script-tests/repeatn-remove-add-animation.js
new file mode 100755
index 0000000000000000000000000000000000000000..9325b002f5fe8b6d9a339957988fd5958eda2ea3
--- /dev/null
+++ b/LayoutTests/svg/animations/script-tests/repeatn-remove-add-animation.js
@@ -0,0 +1,70 @@
+description("This removes and adds an animation element while the animation is repeating");
+embedSVGTestCase("resources/repeatn-remove-add-animation.svg");
+
+// Setup animation test
+function sample1() {
+ expectFillColor(rect1, 0, 255, 0);
+ expectFillColor(rect2, 255, 0, 0);
+ expectFillColor(rect3, 255, 0, 0);
+ expectFillColor(rect4, 255, 0, 0);
+}
+
+function sample2() {
+ expectFillColor(rect1, 0, 255, 0);
+ expectFillColor(rect2, 0, 255, 0);
+ expectFillColor(rect3, 255, 0, 0);
+ expectFillColor(rect4, 255, 0, 0);
+}
+
+function sample3() {
+ expectFillColor(rect1, 0, 255, 0);
+ expectFillColor(rect2, 0, 255, 0);
+ expectFillColor(rect3, 0, 255, 0);
+ expectFillColor(rect4, 255, 0, 0);
+}
+
+function sample4() {
+ expectFillColor(rect1, 0, 255, 0);
+ expectFillColor(rect2, 0, 255, 0);
+ expectFillColor(rect3, 0, 255, 0);
+ expectFillColor(rect4, 0, 255, 0);
+}
+
+function recreate() {
+ var anim1 = rootSVGElement.ownerDocument.getElementById("anim");
+ anim1.parentNode.removeChild(anim1);
+ var anim2 = createSVGElement("animate");
+ anim2.setAttribute("id", "anim");
+ anim2.setAttribute("attributeName", "visibility");
+ anim2.setAttribute("to", "visible");
+ anim2.setAttribute("begin", "0s");
+ anim2.setAttribute("dur", "2s");
+ anim2.setAttribute("repeatCount", "4");
+ rootSVGElement.appendChild(anim2);
+}
+
+function executeTest() {
+ var rects = rootSVGElement.ownerDocument.getElementsByTagName("rect");
+ rect1 = rects[0];
+ rect2 = rects[1];
+ rect3 = rects[2];
+ rect4 = rects[3];
+
+ const expectedValues = [
+ // [animationId, time, sampleCallback]
+ ["anim", 0.0, sample1],
+ ["anim", 0.001, sample1],
+ ["anim", 2.0, sample1],
+ ["anim", 2.001, sample2],
+ ["anim", 4.0, sample2],
+ ["anim", 4.001, sample3],
+ ["anim", 5.0, recreate],
+ ["anim", 6.0, sample3],
+ ["anim", 6.001, sample4]
+ ];
+
+ runAnimationTest(expectedValues);
+}
+
+window.animationStartsImmediately = true;
+var successfullyParsed = true;
« no previous file with comments | « LayoutTests/svg/animations/resources/repeatn-remove-add-animation.svg ('k') | Source/core/svg/animation/SMILTimeContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698