Bug 1212720 - Part 4: Remove all cancelAllAnimationsOnEnd. It is not needed any more. r=bbirtles
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Tue, 22 Dec 2015 00:50:00 -0500
changeset 278920 f2fefee9f84e2bf7603ca39dd12f34a8b25d7106
parent 278919 bf320c73ab1a316873dba82cbea85fc28fe671d5
child 278921 dd7c4f457433d5a9f65a4a6007dbfe389081c248
push id29860
push usercbook@mozilla.com
push dateThu, 07 Jan 2016 10:51:20 +0000
treeherdermozilla-central@e0bcd16e1d4b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbirtles
bugs1212720
milestone46.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1212720 - Part 4: Remove all cancelAllAnimationsOnEnd. It is not needed any more. r=bbirtles
dom/animation/test/css-animations/file_document-get-animations.html
dom/animation/test/testcommon.js
--- a/dom/animation/test/css-animations/file_document-get-animations.html
+++ b/dom/animation/test/css-animations/file_document-get-animations.html
@@ -140,18 +140,16 @@ test(function(t) {
     assert_equals(anim.effect.target, expectedResults[i][0],
                   'Target of animation in position ' + i + ' after changes');
     assert_equals(anim.animationName, expectedResults[i][1],
                   'Name of animation in position ' + i + ' after changes');
   });
 }, 'Order of CSS Animations - across and within elements');
 
 test(function(t) {
-  cancelAllAnimationsOnEnd(t);
-
   var div = addDiv(t, { style: 'animation: animLeft 100s, animTop 100s' });
   var animLeft = document.getAnimations()[0];
   assert_equals(animLeft.animationName, 'animLeft',
                 'Originally, animLeft animation comes first');
 
   // Disassociate animLeft from markup and restart
   div.style.animation = 'animTop 100s';
   animLeft.play();
@@ -160,18 +158,16 @@ test(function(t) {
   assert_equals(animations.length, 2,
                 'getAnimations returns markup-bound and free animations');
   assert_equals(animations[0].animationName, 'animTop',
                 'Markup-bound animations come first');
   assert_equals(animations[1], animLeft, 'Free animations come last');
 }, 'Order of CSS Animations - markup-bound vs free animations');
 
 test(function(t) {
-  cancelAllAnimationsOnEnd(t);
-
   var div = addDiv(t, { style: 'animation: animLeft 100s, animTop 100s' });
   var animLeft = document.getAnimations()[0];
   var animTop  = document.getAnimations()[1];
 
   // Disassociate both animations from markup and restart in opposite order
   div.style.animation = '';
   animTop.play();
   animLeft.play();
@@ -234,18 +230,16 @@ test(function(t) {
 test(function(t) {
   var div = addDiv(t, { style: 'animation: animLeft 100s' });
   div.getAnimations()[0].cancel();
   assert_equals(document.getAnimations().length, 0,
                 'CSS animations cancelled by the API are not returned');
 }, 'CSS Animations cancelled via the API are not returned');
 
 test(function(t) {
-  cancelAllAnimationsOnEnd(t);
-
   var div = addDiv(t, { style: 'animation: animLeft 100s' });
   var anim = div.getAnimations()[0];
   anim.cancel();
   anim.play();
   assert_equals(document.getAnimations().length, 1,
                 'CSS animations cancelled and restarted by the API are ' +
                 'returned');
 }, 'CSS Animations cancelled and restarted via the API are returned');
--- a/dom/animation/test/testcommon.js
+++ b/dom/animation/test/testcommon.js
@@ -25,28 +25,16 @@ function addDiv(t, attrs) {
         div.parentNode.removeChild(div);
       }
     });
   }
   return div;
 }
 
 /**
- * Some tests cause animations to continue to exist even after their target
- * element has been removed from the document tree. To ensure that these
- * animations do not impact other tests we should cancel them when the test
- * is complete.
- */
-function cancelAllAnimationsOnEnd(t) {
-  t.add_cleanup(function() {
-    document.getAnimations().forEach(animation => animation.cancel());
-  });
-}
-
-/**
  * Promise wrapper for requestAnimationFrame.
  */
 function waitForFrame() {
   return new Promise(function(resolve, reject) {
     window.requestAnimationFrame(resolve);
   });
 }