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 <script src="../bootstrap.js"></script> | |
20 <script> | |
21 "use strict"; | |
22 | |
23 var globalVar = 0; | |
24 var incGlobalVar = function() { | |
25 globalVar += 1; | |
26 } | |
27 var failed = false; | |
28 | |
29 for (var i = 0; i < 100; i++) { | |
30 document.timeline.play(new Animation(null, incGlobalVar, 1)); | |
31 } | |
32 | |
33 document.timeline.play(new Animation(null, function() { | |
34 if (globalVar !== 100) { | |
35 failed = true; | |
36 } | |
37 globalVar = 0; | |
38 }, 1)); | |
39 | |
40 // ensure at least one point is sampled | |
41 at(0, function() { }); | |
42 | |
43 timing_test(function() { | |
44 at(1, function() { assert_true(!failed); }); | |
45 }, | |
46 "the 101st animation should always come 101st"); | |
47 | |
48 </script> | |
OLD | NEW |