Bug 1329077 - Drop redundant waitForIdleCallback(). r?boris
We have already waitForIdle() in testcommon.js.
MozReview-Commit-ID: 64XTU2g8CO7
--- 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();