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

Unified Diff: third_party/WebKit/LayoutTests/web-animations-api/infinite-end-time.html

Issue 1716673002: Web Animations: Throw exceptions for play/pause/reverse/finish with infinite end time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/Animation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/web-animations-api/infinite-end-time.html
diff --git a/third_party/WebKit/LayoutTests/web-animations-api/infinite-end-time.html b/third_party/WebKit/LayoutTests/web-animations-api/infinite-end-time.html
new file mode 100644
index 0000000000000000000000000000000000000000..5c5e2cefcf71af670461f8ebc3606cb30d36b809
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/web-animations-api/infinite-end-time.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<body>
+<script>
+function infiniteAnimation() {
+ var anim = document.body.animate([],
+ {duration: 1000, iterations: Infinity});
+ anim.cancel();
+ return anim;
+}
+
+test(function() {
+ var anim = infiniteAnimation();
+ try {
+ anim.finish();
+ assert_unreached();
+ } catch (e) {
+ assert_equals(e.code, DOMException.INVALID_STATE_ERR);
+ }
+}, "finishing an infinite animation");
+
+test(function() {
+ var anim = infiniteAnimation();
+ anim.playbackRate = -1;
+ try {
+ anim.pause();
+ assert_unreached();
+ } catch (e) {
+ assert_equals(e.code, DOMException.INVALID_STATE_ERR);
+ }
+}, "pausing a reversed infinite animation");
+
+test(function() {
+ var anim = infiniteAnimation();
+ anim.playbackRate = -1;
+ try {
+ anim.play();
+ assert_unreached();
+ } catch (e) {
+ assert_equals(e.code, DOMException.INVALID_STATE_ERR);
+ }
+}, "playing a reversed infinite animation");
+
+test(function() {
+ var anim = infiniteAnimation();
+ try {
+ anim.reverse();
+ assert_unreached();
+ } catch (e) {
+ assert_equals(e.code, DOMException.INVALID_STATE_ERR);
+ }
+}, "reversing an infinite animation");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/Animation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698