Bug 1329077 - Drop redundant waitForIdleCallback(). r?boris draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Sat, 20 May 2017 20:33:59 +0900
changeset 581967 039d6d3e4c1bf916e9176dc4c61491436e7b6d04
parent 581966 46c0a643304095a32fca82f816bcff768aa870c3
child 629632 200276622e642d030272727af8ff8c04069bae76
push id59931
push userhikezoe@mozilla.com
push dateSat, 20 May 2017 11:34:33 +0000
reviewersboris
bugs1329077
milestone55.0a1
Bug 1329077 - Drop redundant waitForIdleCallback(). r?boris We have already waitForIdle() in testcommon.js. MozReview-Commit-ID: 64XTU2g8CO7
dom/animation/test/chrome/test_animation_performance_warning.html
--- a/dom/animation/test/chrome/test_animation_performance_warning.html
+++ b/dom/animation/test/chrome/test_animation_performance_warning.html
@@ -35,27 +35,16 @@ SpecialPowers.pushPrefEnv({ "set": [
                             ["general.useragent.locale", "en-US"],
                             // Need to set devPixelsPerPx explicitly to gain
                             // consistent pixel values in warning messages
                             // regardless of platform DPIs.
                             ["layout.css.devPixelsPerPx", 1],
                           ] },
                           start);
 
-/**
- * Promise wrapper for requestIdleCallback.
- * NOTE: DON'T move this function into testcommon.js until requestIdleCallback
- * is enabled by default on all channels.
- */
-function waitForIdleCallback() {
-  return new Promise(function(resolve, reject) {
-    window.requestIdleCallback(resolve);
-  });
-}
-
 function compare_property_state(a, b) {
   if (a.property > b.property) {
     return -1;
   } else if (a.property < b.property) {
     return 1;
   }
   if (a.runningOnCompositor != b.runningOnCompositor) {
     return a.runningOnCompositor ? 1 : -1;
@@ -958,17 +947,17 @@ function testSynchronizedAnimations() {
     // In this test we want to set up two transitions during the "Events"
     // stage but only flush style for one such that the second one is actually
     // generated during the "Style" stage of the *next* tick.
     //
     // Web content often generates transitions in this way (that is, it doesn't
     // pay regard to when style is flushed and nor should it). However, we
     // still want transitions generated in this way to be synchronized.
     let timeForFirstFrame;
-    return waitForIdleCallback()
+    return waitForIdle()
       .then(() => {
         timeForFirstFrame = document.timeline.currentTime;
         elemA.style.transform = 'translate(100px)';
         // Flush style to trigger first transition
         getComputedStyle(elemA).transform;
         elemB.style.marginLeft = '100px';
         // DON'T flush style here (this includes calling getAnimations!)
         return waitForFrame();