Bug 1466031 - Drop test_animation-finish.html; r?hiro draft
authorBrian Birtles <birtles@gmail.com>
Fri, 01 Jun 2018 16:27:00 +0900
changeset 802579 0e5a5af0a6bc3b36bc6d346dfecc78022a71231a
parent 802578 6af04a83b6c97714fd106df0146fd220bf3debd7
child 802580 5da3dc64806f4b4b5c9fb7fa608e9e1d629998db
push id111920
push userbmo:bbirtles@mozilla.com
push dateFri, 01 Jun 2018 07:32:08 +0000
reviewershiro
bugs1466031
milestone62.0a1
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
dom/animation/test/css-animations/test_animation-finish.html
dom/animation/test/mochitest.ini
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]