OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
4 | 4 |
5 <div id='element'></div> | 5 <div id='element'></div> |
6 | 6 |
7 <script> | 7 <script> |
8 var element = document.getElementById('element'); | 8 var element = document.getElementById('element'); |
9 test(function() { | 9 test(function() { |
10 var player = element.animate([{left: '0px', offset: 0}, {left: '100px', offs
et: 1}], 10000); | 10 var player = element.animate([{left: '0px', offset: 0}, {left: '100px', offs
et: 1}], 10000); |
(...skipping 24 matching lines...) Expand all Loading... |
35 assert_equals(player.playbackRate, -2); | 35 assert_equals(player.playbackRate, -2); |
36 | 36 |
37 player.cancel(); | 37 player.cancel(); |
38 assert_equals(animation.player, null); | 38 assert_equals(animation.player, null); |
39 }, 'Player sanity tests'); | 39 }, 'Player sanity tests'); |
40 | 40 |
41 test(function() { | 41 test(function() { |
42 var player = element.animate([{left: '0px', offset: 0}, {left: '100px', offs
et: 1}], {iterations: Infinity, duration: 10}); | 42 var player = element.animate([{left: '0px', offset: 0}, {left: '100px', offs
et: 1}], {iterations: Infinity, duration: 10}); |
43 assert_throws('INVALID_STATE_ERR', function() { player.finish(); }); | 43 assert_throws('INVALID_STATE_ERR', function() { player.finish(); }); |
44 }, 'Player.finish() raises exception if source content end is infinity'); | 44 }, 'Player.finish() raises exception if source content end is infinity'); |
| 45 |
| 46 test(function() { |
| 47 var player = element.animate([{left: '0px', offset: 0}, {left: '100px', offs
et: 1}], 10000); |
| 48 for (var attr of ['startTime', 'currentTime', 'playbackRate']) { |
| 49 assert_throws(new TypeError, function() { player[attr] = NaN; }, attr); |
| 50 assert_throws(new TypeError, function() { player[attr] = Infinity; }, at
tr); |
| 51 } |
| 52 }, 'Player.startTime/currentTime/playbackRate throw if passed non-finite numbers
.'); |
45 </script> | 53 </script> |
OLD | NEW |