Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Side by Side Diff: LayoutTests/web-animations-api/player.html

Issue 939623002: Add TypeChecking=Unrestricted to Web Animation APIs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Drop AnimationAnimationPlayerTest.SetCurrentTimeUnrestrictedDouble Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698