Bug 1343589 - Add a test that the playback rate is unaffected when an exception is thrown
The spec has been updated to clarify that this is the expected behavior:
https://github.com/w3c/web-animations/commit/c80c9984cac1091c428c7d3203479698e0d745c1
MozReview-Commit-ID: 6TsNg7HWdRX
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -207833,17 +207833,17 @@
"53a4a6c6c6d07e00fecc50e5de831862e7bf4b2e",
"testharness"
],
"web-animations/timing-model/animations/current-time.html": [
"b1ea8e490cbfb69fd71b91a90e7e2d9ce99f42d3",
"testharness"
],
"web-animations/timing-model/animations/reversing-an-animation.html": [
- "91d0704525d4aeacb0a31592e29bf7aab9908660",
+ "9f8e9adb260f4b3cea834bbec6b603c50acbb9fd",
"testharness"
],
"web-animations/timing-model/animations/set-the-animation-start-time.html": [
"84afa495b1a4c467e27b1394f6449a18c58ed98d",
"testharness"
],
"web-animations/timing-model/animations/set-the-target-effect-of-an-animation.html": [
"840be610db4bce6d6fd1c22710e494a75ee95eba",
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/web-animations/timing-model/animations/reversing-an-animation.html.ini
@@ -0,0 +1,5 @@
+[reversing-an-animation.html]
+ type: testharness
+ [When reversing throws an exception, the playback rate remains unchanged]
+ expected: FAIL
+ bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1343589
--- a/testing/web-platform/tests/web-animations/timing-model/animations/reversing-an-animation.html
+++ b/testing/web-platform/tests/web-animations/timing-model/animations/reversing-an-animation.html
@@ -117,16 +117,26 @@ test(function(t) {
function () { animation.reverse(); },
'reverse() should throw InvalidStateError ' +
'if the playbackRate > 0 and the currentTime < 0 ' +
'and the target effect is positive infinity');
}, 'Reversing an animation when playbackRate > 0 and currentTime < 0 ' +
'and the target effect end is positive infinity should throw an exception');
test(function(t) {
+ var animation = createDiv(t).animate({}, { duration: 100 * MS_PER_SEC,
+ iterations: Infinity });
+ animation.currentTime = -200 * MS_PER_SEC;
+
+ try { animation.reverse(); } catch(e) { }
+
+ assert_equals(animation.playbackRate, 1, 'playbackRate remains unchanged');
+}, 'When reversing throws an exception, the playback rate remains unchanged');
+
+test(function(t) {
var div = createDiv(t);
var animation = div.animate({}, {duration: 100 * MS_PER_SEC,
iterations: Infinity});
animation.playbackRate = -1;
animation.currentTime = -200 * MS_PER_SEC;
animation.reverse();
assert_equals(animation.currentTime, 0,