| 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 .anim { | |
| 21 position: absolute; | |
| 22 width: 50px; | |
| 23 height: 50px; | |
| 24 top: 0px; | |
| 25 border-radius: 50%; | |
| 26 } | |
| 27 </style> | |
| 28 <div class='anim' id='a' style='left: 0px; background-color: lightsteelblue'></d
iv> | |
| 29 <div class='anim' id='b' style='left: 450px; background-color: red'></div> | |
| 30 <script src='../bootstrap.js'></script> | |
| 31 <script> | |
| 32 'use strict'; | |
| 33 var downRed = new AnimationGroup( | |
| 34 [new Animation(document.querySelector('#a'), {top: '600px'}, 4)]); | |
| 35 var downBlue = new AnimationGroup( | |
| 36 [new Animation(document.querySelector('#b'), {top: '600px'}, 4)], | |
| 37 {delay: 1}); | |
| 38 document.timeline.play(downRed); | |
| 39 document.timeline.play(downBlue); | |
| 40 document.timeline._pauseAnimationsForTesting(2); | |
| 41 | |
| 42 timing_test(function() { | |
| 43 at(0, function() { | |
| 44 assert_styles('#a', {'top':'300px'}) | |
| 45 assert_styles('#b', {'top':'150px'}) | |
| 46 }); | |
| 47 at(12, function() { | |
| 48 assert_styles('#a', {'top':'300px'}) | |
| 49 assert_styles('#b', {'top':'150px'}) | |
| 50 }); | |
| 51 }, 'Pausing all animations should work when players have different start delays.
') | |
| 52 </script> | |
| OLD | NEW |