Bug 1466031 - Drop test_animation-finish.html; r?hiro
These tests are all covered elsewhere:
* The "Test exceptions when finishing infinite animation" test is covered by
the "Finishing an infinite animation throws" test in
finishing-an-animation.html in the Web Animations web-platform-tests.
* The "Test finish() while paused" test is covered by the "Finishing a paused
animation resolves the start time" test in finishing-an-animation.html in
the Web Animations web-platform-tests.
* The "Test finish() while pause-pending with positive playbackRate" test is
covered by the "Finishing a pause-pending animation resolves the pending
task immediately and update the start time" test in
finishing-an-animation.html in the Web Animations web-platform-tests.
* The 'Test finish() while pause-pending with negative playbackRate" test is
covered by the "Finishing a pause-pending animation with negative playback
rate resolves the pending task immediately" test in
finishing-an-animation.html in the Web Animations web-platform-tests.
In fact, it very much looks like these tests were copied to Web Animations'
web-platform-tests at some point without deleting the original.
MozReview-Commit-ID: 7fztPNLnuHs
deleted file mode 100644
--- a/dom/animation/test/css-animations/test_animation-finish.html
+++ /dev/null
@@ -1,95 +0,0 @@
-<!doctype html>
-<meta charset=utf-8>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="../testcommon.js"></script>
-<style>
-@keyframes anim {
- from { margin-left: 100px; }
- to { margin-left: 200px; }
-}
-</style>
-<body>
-<div id="log"></div>
-<script>
-
-'use strict';
-
-const ANIM_PROP_VAL = 'anim 100s';
-const ANIM_DURATION = 100000; // ms
-
-test(t => {
- const div = addDiv(t);
- div.style.animation = ANIM_PROP_VAL;
- div.style.animationIterationCount = 'infinite';
- const animation = div.getAnimations()[0];
-
- let threw = false;
- try {
- animation.finish();
- } catch (e) {
- threw = true;
- assert_equals(e.name, 'InvalidStateError',
- 'Exception should be an InvalidStateError exception when ' +
- 'trying to finish an infinite animation');
- }
- assert_true(threw,
- 'Expect InvalidStateError exception trying to finish an ' +
- 'infinite animation');
-}, 'Test exceptions when finishing infinite animation');
-
-promise_test(async t => {
- const div = addDiv(t);
- div.style.animation = ANIM_PROP_VAL + ' paused';
- const animation = div.getAnimations()[0];
- await animation.ready;
-
- animation.finish();
- assert_equals(animation.playState, 'finished',
- 'The play state of a paused animation should become ' +
- '"finished" after finish() is called');
- assert_times_equal(animation.startTime,
- animation.timeline.currentTime - ANIM_DURATION,
- 'The start time of a paused animation should be set ' +
- 'after calling finish()');
-}, 'Test finish() while paused');
-
-test(t => {
- const div = addDiv(t);
- div.style.animation = ANIM_PROP_VAL + ' paused';
- const animation = div.getAnimations()[0];
-
- // Update playbackRate so we can test that the calculated startTime
- // respects it
- animation.playbackRate = 2;
-
- // While animation is still pause-pending call finish()
- animation.finish();
-
- assert_equals(animation.playState, 'finished',
- 'The play state of a pause-pending animation should become ' +
- '"finished" after finish() is called');
- assert_times_equal(animation.startTime,
- animation.timeline.currentTime - ANIM_DURATION / 2,
- 'The start time of a pause-pending animation should ' +
- 'be set after calling finish()');
-}, 'Test finish() while pause-pending with positive playbackRate');
-
-test(t => {
- const div = addDiv(t);
- div.style.animation = ANIM_PROP_VAL + ' paused';
- const animation = div.getAnimations()[0];
-
- animation.playbackRate = -2;
- animation.finish();
-
- assert_equals(animation.playState, 'finished',
- 'The play state of a pause-pending animation should become ' +
- '"finished" after finish() is called');
- assert_equals(animation.startTime, animation.timeline.currentTime,
- 'The start time of a pause-pending animation should be ' +
- 'set after calling finish()');
-}, 'Test finish() while pause-pending with negative playbackRate');
-
-</script>
-</body>
--- a/dom/animation/test/mochitest.ini
+++ b/dom/animation/test/mochitest.ini
@@ -14,17 +14,16 @@ support-files =
../../../layout/style/test/property_database.js
testcommon.js
!/dom/events/test/event_leak_utils.js
[css-animations/test_animations-dynamic-changes.html]
[css-animations/test_animation-cancel.html]
[css-animations/test_animation-computed-timing.html]
[css-animations/test_animation-currenttime.html]
-[css-animations/test_animation-finish.html]
[css-animations/test_animation-finished.html]
[css-animations/test_animation-id.html]
[css-animations/test_animation-pausing.html]
[css-animations/test_animation-playstate.html]
[css-animations/test_animation-ready.html]
[css-animations/test_animation-reverse.html]
[css-animations/test_animation-starttime.html]
[css-animations/test_cssanimation-animationname.html]