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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/web-animations-api/player.html
diff --git a/LayoutTests/web-animations-api/player.html b/LayoutTests/web-animations-api/player.html
index 59803ef35e8f6a11050fff42e54176de04d2caa0..ce94dd659855e1a19ff4b5aa0eead490b72bc37d 100644
--- a/LayoutTests/web-animations-api/player.html
+++ b/LayoutTests/web-animations-api/player.html
@@ -42,4 +42,12 @@ test(function() {
var player = element.animate([{left: '0px', offset: 0}, {left: '100px', offset: 1}], {iterations: Infinity, duration: 10});
assert_throws('INVALID_STATE_ERR', function() { player.finish(); });
}, 'Player.finish() raises exception if source content end is infinity');
+
+test(function() {
+ var player = element.animate([{left: '0px', offset: 0}, {left: '100px', offset: 1}], 10000);
+ for (var attr of ['startTime', 'currentTime', 'playbackRate']) {
+ assert_throws(new TypeError, function() { player[attr] = NaN; }, attr);
+ assert_throws(new TypeError, function() { player[attr] = Infinity; }, attr);
+ }
+}, 'Player.startTime/currentTime/playbackRate throw if passed non-finite numbers.');
</script>

Powered by Google App Engine
This is Rietveld 408576698