| Index: pkg/polymer/lib/elements/web-animations-js/test/testcases/auto-test-start-time-iterations.html
|
| diff --git a/pkg/polymer/lib/elements/web-animations-js/test/testcases/auto-test-start-time-iterations.html b/pkg/polymer/lib/elements/web-animations-js/test/testcases/auto-test-start-time-iterations.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8ef336dbfdd7bf61adbf3f1535b56906598206a8
|
| --- /dev/null
|
| +++ b/pkg/polymer/lib/elements/web-animations-js/test/testcases/auto-test-start-time-iterations.html
|
| @@ -0,0 +1,107 @@
|
| +<!--
|
| +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;
|
| +}
|
| +
|
| +.anim {
|
| + left: 0px;
|
| + width: 100px;
|
| + height: 25px;
|
| + background-color: #FAA;
|
| + position: relative;
|
| +}
|
| +
|
| +.expected {
|
| + border-right: 1px solid black;
|
| +}
|
| +
|
| +#normal {
|
| + top: 50px;
|
| +}
|
| +
|
| +#reverse {
|
| + top: 150px;
|
| +}
|
| +
|
| +#alternate {
|
| + top: 250px;
|
| +}
|
| +
|
| +#alternate-reverse {
|
| + top: 350px;
|
| +}
|
| +
|
| +</style>
|
| +
|
| +<div>Right edge of each box should align with black line at end of test. Note
|
| +that the position of the last element in each group is approximate.</div>
|
| +
|
| +<div class="animContainer" id="normal">
|
| + <div style="width: 600px;" class="expected"><div id="normal_a" class="anim"></div></div>
|
| + <div style="width: 600px;" class="expected"><div id="normal_b" class="anim"></div></div>
|
| +</div>
|
| +
|
| +<div class="animContainer" id="reverse">
|
| + <div style="width: 200px;" class="expected"><div id="reverse_a" class="anim"></div></div>
|
| + <div style="width: 200px;" class="expected"><div id="reverse_b" class="anim"></div></div>
|
| +</div>
|
| +
|
| +<div class="animContainer" id="alternate">
|
| + <div style="width: 200px;" class="expected"><div id="alternate_a" class="anim"></div></div>
|
| + <div style="width: 200px;" class="expected"><div id="alternate_b" class="anim"></div></div>
|
| +</div>
|
| +
|
| +<div class="animContainer" id="alternate-reverse">
|
| + <div style="width: 600px;" class="expected"><div id="alternate-reverse_a" class="anim"></div></div>
|
| + <div style="width: 600px;" class="expected"><div id="alternate-reverse_b" class="anim"></div></div>
|
| +</div>
|
| +
|
| +<script src="../bootstrap.js"></script>
|
| +<script>
|
| +"use strict";
|
| +
|
| +var directions = ["normal", "reverse", "alternate", "alternate-reverse"];
|
| +
|
| +var animation = [{left: "100px"}, {left: "500px"}];
|
| +
|
| +for (var i = 0; i < directions.length; i++) {
|
| + var direction = directions[i];
|
| + var container = document.getElementById(direction);
|
| +
|
| + // Interaction of default start time with parent iterations. At the time of
|
| + // addition, the child picks up a start time of zero. The parent then updates
|
| + // its duration and its iteration time jumps, causing the child to start
|
| + // playing part way through the animation.
|
| + var intrinsicGroup = new ParGroup([], {iterations: 2.0, direction: direction});
|
| + document.timeline.play(intrinsicGroup);
|
| + var fixedGroup = new ParGroup([], {iterations: 2.0, direction: direction, duration: 4.0});
|
| + document.timeline.play(fixedGroup);
|
| +
|
| + timing_test(function() {
|
| + at(0.75, (function(container, direction, intrinsicGroup, fixedGroup) {
|
| + return function() {
|
| + intrinsicGroup.append(new Animation(document.getElementById(direction + '_a'), animation, {duration: 1.0, fill: 'forwards'}));
|
| + fixedGroup.append(new Animation(document.getElementById(direction + '_b'), animation, {duration: 1.0, fill: 'forwards'}));
|
| + };
|
| + })(container, direction, intrinsicGroup, fixedGroup));
|
| + });
|
| +}
|
| +</script>
|
|
|