Index: pkg/polymer/lib/elements/web-animations-js/test/testcases/test-dynamic-load.html |
diff --git a/pkg/polymer/lib/elements/web-animations-js/test/testcases/test-dynamic-load.html b/pkg/polymer/lib/elements/web-animations-js/test/testcases/test-dynamic-load.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ea5a3b9562800836a3a985ec42edf7abd2b0118c |
--- /dev/null |
+++ b/pkg/polymer/lib/elements/web-animations-js/test/testcases/test-dynamic-load.html |
@@ -0,0 +1,65 @@ |
+<!-- |
+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"> |
+<style> |
+.anim { |
+ left: 0px; |
+ width: 100px; |
+ height: 100px; |
+ background-color: #FAA; |
+ position: absolute; |
+} |
+ |
+.expected { |
+ width: 100px; |
+ height: 100px; |
+ position: absolute; |
+ border-right: 1px solid black; |
+} |
+ |
+#a { |
+ top: 50px |
+} |
+</style> |
+ |
+<div>Right edge of box should align with black line at end of test.</div> |
+<div id="a" class="anim"></div> |
+<div id="a-expected" style="top: 50px; left: 200px;" class="expected"></div> |
+ |
+<script src="../bootstrap.js" nopolyfill></script> |
+<script> |
+"use strict"; |
+ |
+timing_test(function() { |
+ at(0.00, function() { assert_styles(".anim", {"left": "0px"}) }); |
+ at(0.25, function() { assert_styles(".anim", {"left": "100px"}) }); |
+ at(0.50, function() { assert_styles(".anim", {"left": "200px"}) }); |
+ }, "Check left position"); |
+ |
+window.addEventListener('load', function() { |
+ var s = document.createElement('script'); |
+ s.src = "../../web-animations.js"; |
+ s.addEventListener('load', function() { |
+ document.timeline.play(new Animation(a, |
+ [{left: "0px"}, {left: "200px"}], |
+ {duration: 0.5, fill: 'forwards'} |
+ )); |
+ |
+ }) |
+ document.head.appendChild(s); |
+}); |
+</script> |