OLD | NEW |
(Empty) | |
| 1 <!-- |
| 2 Copyright 2013 Google Inc. All Rights Reserved. |
| 3 |
| 4 Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 you may not use this file except in compliance with the License. |
| 6 You may obtain a copy of the License at |
| 7 |
| 8 http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
| 10 Unless required by applicable law or agreed to in writing, software |
| 11 distributed under the License is distributed on an "AS IS" BASIS, |
| 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 See the License for the specific language governing permissions and |
| 14 limitations under the License. |
| 15 --> |
| 16 |
| 17 <!DOCTYPE html><meta charset="UTF-8"> |
| 18 |
| 19 <style> |
| 20 #target { |
| 21 background-color: lightsteelblue; |
| 22 width: 50px; |
| 23 height: 50px; |
| 24 position: absolute; |
| 25 left: 0px; |
| 26 } |
| 27 #expected { |
| 28 background-color: darkred; |
| 29 width: 50px; |
| 30 height: 50px; |
| 31 position: absolute; |
| 32 left: 100px; |
| 33 } |
| 34 </style> |
| 35 |
| 36 <div id="expected"></div> |
| 37 <div id="target"></div> |
| 38 |
| 39 <script src="../bootstrap.js"></script> |
| 40 <script> |
| 41 'use strict'; |
| 42 |
| 43 var test = async_test('Check second animation has fired after being triggered in
side onend callback'); |
| 44 var element = document.querySelector('#target'); |
| 45 var animation = new Animation(element, {left: '50px'}, 0.5); |
| 46 animation.addEventListener('end', function() { |
| 47 var nextAnimation = new Animation(element, {left: '100px'}, 0.5); |
| 48 nextAnimation.addEventListener('end', function() { |
| 49 test.step(function() { assert_styles("#target", {left:'100px'}); }); |
| 50 test.done(); |
| 51 }); |
| 52 document.timeline.play(nextAnimation); |
| 53 }); |
| 54 document.timeline.play(animation); |
| 55 |
| 56 timing_test(function() {at(1, function() {});}, 'Force testharness to execute to
1 second.'); |
| 57 </script> |
OLD | NEW |