| Index: pkg/polymer/lib/elements/web-animations-js/test/testcases/unit-test-get-siblings.html
|
| diff --git a/pkg/polymer/lib/elements/web-animations-js/test/testcases/unit-test-get-siblings.html b/pkg/polymer/lib/elements/web-animations-js/test/testcases/unit-test-get-siblings.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9c720086374e61a79f6e756884369bb6cbe7477b
|
| --- /dev/null
|
| +++ b/pkg/polymer/lib/elements/web-animations-js/test/testcases/unit-test-get-siblings.html
|
| @@ -0,0 +1,112 @@
|
| +<!--
|
| +Copyright 2013 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">
|
| +<div id="anim"></div>
|
| +
|
| +<script src="../bootstrap.js"></script>
|
| +<script>
|
| +"use strict";
|
| +
|
| +var parGroup = new ParGroup();
|
| +var anim = new Animation(document.getElementById("anim"), {left: "100px"},
|
| + {iterations: 3.0});
|
| +var anim1 = new Animation(document.getElementById("anim"), {top: "100px"},
|
| + {iterations: 3.0});
|
| +var anim2 = new Animation(document.getElementById("anim"), {width: "100px"},
|
| + {iterations: 3.0});
|
| +var anim3 = new Animation(document.getElementById("anim"), {height: "100px"},
|
| + {iterations: 3.0});
|
| +
|
| +test(function() {assert_equals(anim.previousSibling, null)},
|
| + "Single animation should have no previous sibling");
|
| +
|
| +test(function() {assert_equals(anim.nextSibling, null)},
|
| + "Single animation should have no next sibling");
|
| +
|
| +parGroup.append(anim);
|
| +
|
| +test(function() {assert_equals(anim.previousSibling, null)},
|
| + "Single animation in a parGroup should have no previous sibling");
|
| +
|
| +test(function() {assert_equals(anim.nextSibling, null)},
|
| + "Single animation in a parGroup should have no next sibling");
|
| +
|
| +parGroup.prepend(anim1);
|
| +
|
| +test(function() {assert_equals(anim.previousSibling, anim1)},
|
| + "Animation should have a previous sibling when there is one");
|
| +
|
| +test(function() {assert_equals(anim.nextSibling, null)},
|
| + "Animation should have no next sibling when there is none");
|
| +
|
| +parGroup.append(anim2);
|
| +
|
| +test(function() {assert_equals(anim.previousSibling, anim1)},
|
| + "Animation should have a previous sibling when there is one");
|
| +
|
| +test(function() {assert_equals(anim.nextSibling, anim2)},
|
| + "Animation should have a next sibling when there is one");
|
| +
|
| +parGroup.prepend(anim3);
|
| +
|
| +test(function() {assert_equals(anim.previousSibling, anim1)},
|
| + "Animation should have the correct previous sibling when there is more than one");
|
| +
|
| +test(function() {assert_equals(anim.nextSibling, anim2)},
|
| + "Animation should have a next sibling when there is one");
|
| +anim1.remove();
|
| +
|
| +test(function() {assert_equals(anim.previousSibling, anim3)},
|
| + "Animation should have the correct previous sibling when the old one is removed");
|
| +
|
| +test(function() {assert_equals(anim.nextSibling, anim2)},
|
| + "Animation should have a next sibling when there is one");
|
| +
|
| +anim3.remove();
|
| +parGroup.append(anim3);
|
| +
|
| +test(function() {assert_equals(anim.previousSibling, null)},
|
| + "Animation should have the no previous sibling when there is none");
|
| +
|
| +test(function() {assert_equals(anim.nextSibling, anim2)},
|
| + "Animation should have a next sibling when there is more than one");
|
| +
|
| +anim2.remove();
|
| +
|
| +test(function() {assert_equals(anim.previousSibling, null)},
|
| + "Animation should have the no previous sibling when there is none");
|
| +
|
| +test(function() {assert_equals(anim.nextSibling, anim3)},
|
| + "Animation should have the correct next sibling when the old one is removed");
|
| +
|
| +anim.before(anim1);
|
| +
|
| +test(function() {assert_equals(anim.previousSibling, anim1)},
|
| + "Animation should have the correct previous sibling when one is added");
|
| +
|
| +test(function() {assert_equals(anim.nextSibling, anim3)},
|
| + "Animation should have the correct next sibling when the old one is removed");
|
| +
|
| +anim.after(anim2);
|
| +
|
| +test(function() {assert_equals(anim.previousSibling, anim1)},
|
| + "Animation should have a previous sibling when there is one");
|
| +
|
| +test(function() {assert_equals(anim.nextSibling, anim2)},
|
| + "Animation should have the correct next sibling when a new one is added");
|
| +
|
| +</script>
|
|
|