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 <style> | |
19 div.anim { | |
20 position: relative; | |
21 left: 0px; | |
22 } | |
23 </style> | |
24 | |
25 <div id="anim" class="anim"></div> | |
26 | |
27 <script src="../bootstrap.js"></script> | |
28 <script> | |
29 "use strict"; | |
30 var player = document.timeline.play(new Animation( | |
31 document.getElementById("anim"), [{left: "100px"}, {left: "200px"}], 1.0)); | |
32 | |
33 // Test that repeatedly setting AnimationPlayer.paused to true does not affect t
he | |
34 // AnimationPlayer's currentTime. | |
35 timing_test(function() { | |
36 at(0.1, function() { | |
37 player.pause(); | |
38 assert_equals(player.currentTime, 0.1); | |
39 }); | |
40 }, | |
41 "AnimationPlayer.currentTime should be " + | |
42 "unaffected by repeatedly setting AnimationPlayer.paused to true"); | |
43 | |
44 // Test that repeatedly setting AnimationPlayer.paused to false has no effect. | |
45 timing_test(function() { | |
46 at(0.2, function() { | |
47 player.play(); | |
48 assert_equals(player.currentTime, 0.1); | |
49 }); | |
50 }, | |
51 "AnimationPlayer.currentTime should be " + | |
52 "unaffected by repeatedly setting AnimationPlayer.paused to false"); | |
53 | |
54 </script> | |
OLD | NEW |