Index: pkg/polymer/lib/elements/web-animations-js/test/testcases/auto-test-iteration-start.html |
diff --git a/pkg/polymer/lib/elements/web-animations-js/test/testcases/auto-test-iteration-start.html b/pkg/polymer/lib/elements/web-animations-js/test/testcases/auto-test-iteration-start.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5ca5a25a4f318ed0bb3ecb8825b1a28258e20e2f |
--- /dev/null |
+++ b/pkg/polymer/lib/elements/web-animations-js/test/testcases/auto-test-iteration-start.html |
@@ -0,0 +1,160 @@ |
+<!-- |
+Copyright 2012 Google Inc. All Rights Reserved. |
+ |
+Licensed under the Apache License, Version 2.0 (the "License"); |
+you may not use this file except in compliance with the License. |
+You may obtain a copy of the License at |
+ |
+ http://www.apache.org/licenses/LICENSE-2.0 |
+ |
+Unless required by applicable law or agreed to in writing, software |
+distributed under the License is distributed on an "AS IS" BASIS, |
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
+See the License for the specific language governing permissions and |
+limitations under the License. |
+--> |
+ |
+<!DOCTYPE html><meta charset="UTF-8"> |
+<style> |
+.animContainer { |
+ position: absolute; |
+ left: 0px; |
+ height: 100px; |
+} |
+ |
+.anim { |
+ left: 0px; |
+ width: 100px; |
+ height: 25px; |
+ background-color: lightsteelblue; |
+ position: relative; |
+} |
+ |
+#ca { |
+ top: 50px; |
+} |
+ |
+#cb { |
+ top: 250px; |
+} |
+ |
+#cc { |
+ top: 450px; |
+} |
+ |
+#cd { |
+ top: 650px; |
+} |
+ |
+.expectation { |
+ position: absolute; |
+ background-color: red; |
+ width: 100px; |
+} |
+</style> |
+ |
+<div>All squares should line up at the end of each iteration (or start if |
+reversed).</div> |
+ |
+<div class="expectation" style="top: 50px; left: 180px; height: 150px;"></div> |
+ |
+<div class="expectation" style="top: 250px; left: 160px; height: 25px;"></div> |
+<div class="expectation" style="top: 275px; left: 260px; height: 50px;"></div> |
+<div class="expectation" style="top: 325px; left: 180px; height: 25px;"></div> |
+<div class="expectation" style="top: 350px; left: 140px; height: 25px;"></div> |
+<div class="expectation" style="top: 375px; left: 116px; height: 25px;"></div> |
+ |
+<div class="expectation" style="top: 450px; left: 160px; height: 25px;"></div> |
+<div class="expectation" style="top: 475px; left: 260px; height: 50px;"></div> |
+<div class="expectation" style="top: 525px; left: 180px; height: 25px;"></div> |
+<div class="expectation" style="top: 550px; left: 140px; height: 25px;"></div> |
+<div class="expectation" style="top: 575px; left: 116px; height: 25px;"></div> |
+ |
+<div class="expectation" style="top: 650px; left: 180px; height: 150px;"></div> |
+ |
+<div class="animContainer" id="ca"> |
+ <div class="anim a" id="a"></div> |
+ <div class="anim b" id="b"></div> |
+ <div class="anim c" id="c"></div> |
+ <div class="anim d" id="d"></div> |
+ <div class="anim e" id="e"></div> |
+ <div class="anim f" id="f"></div> |
+</div> |
+ |
+<div class="animContainer" id="cb"> |
+ <div class="anim a" id="g"></div> |
+ <div class="anim b" id="h"></div> |
+ <div class="anim c" id="i"></div> |
+ <div class="anim d" id="j"></div> |
+ <div class="anim e" id="k"></div> |
+ <div class="anim f" id="l"></div> |
+</div> |
+ |
+<div class="animContainer" id="cc"> |
+ <div class="anim a" id="m"></div> |
+ <div class="anim b" id="n"></div> |
+ <div class="anim c" id="o"></div> |
+ <div class="anim d" id="p"></div> |
+ <div class="anim e" id="q"></div> |
+ <div class="anim f" id="r"></div> |
+</div> |
+ |
+<div class="animContainer" id="cd"> |
+ <div class="anim a" id="s"></div> |
+ <div class="anim b" id="t"></div> |
+ <div class="anim c" id="u"></div> |
+ <div class="anim d" id="v"></div> |
+ <div class="anim e" id="w"></div> |
+ <div class="anim f" id="x"></div> |
+</div> |
+ |
+<div style="height: 800px;"></div> |
+ |
+<script src="../bootstrap.js"></script> |
+<script> |
+"use strict"; |
+ |
+var containers = ["ca", "cb", "cc", "cd"]; |
+ |
+var directions = ["normal", "reverse", "alternate", "alternate-reverse"]; |
+var groups = []; |
+ |
+var effect100To300 = [{left: "100px"}, {left: "300px"}]; |
+var effect100To180 = [{left: "100px"}, {left: "180px"}]; |
+ |
+for (var i = 0; i < directions.length; i++) { |
+ var dir = directions[i]; |
+ groups.push( |
+ new ParGroup([], {iterations: 2, direction: dir, duration: 4, fill: 'forwards'})); |
+} |
+ |
+for (var i = 0; i < containers.length; i++) { |
+ var container = document.getElementById(containers[i]); |
+ // Test basic use. |
+ groups[i].append(new Animation(container.getElementsByClassName("a")[0], |
+ effect100To300, |
+ {duration: 1, iterations: 3.1, iterationStart: 0.3, fill: 'forwards'})); |
+ groups[i].append(new Animation(container.getElementsByClassName("b")[0], |
+ effect100To300, |
+ {duration: 1, iterations: 3.6, iterationStart: -0.2, fill: 'forwards'})); |
+ // Test that iterationStart is not clipped to iterations. |
+ groups[i].append(new Animation(container.getElementsByClassName("c")[0], |
+ effect100To300, |
+ {duration: 1, iterations: 1.6, iterationStart: 1.8, fill: 'forwards'})); |
+ // Test that nothing odd happens when iterations is an integer. |
+ groups[i].append(new Animation(container.getElementsByClassName("d")[0], |
+ effect100To300, |
+ {duration: 1, iterations: 3.0, iterationStart: 0.4, fill: 'forwards'})); |
+ // Test that nothing odd happens when (iterations - iterationStart) is an |
+ // integer. |
+ groups[i].append(new Animation(container.getElementsByClassName("e")[0], |
+ effect100To300, |
+ {duration: 1, iterations: 3.2, iterationStart: 0.2, fill: 'forwards'})); |
+ // Test that nothing odd happens when (iterations + iterationStart) is an |
+ // integer. |
+ groups[i].append(new Animation(container.getElementsByClassName("f")[0], |
+ effect100To180, |
+ {duration: 1, iterations: 2.8, iterationStart: 0.2, fill: 'forwards'})); |
+ document.timeline.play(groups[i]); |
+} |
+</script> |