Bug 1421476 - Use waitForNextFrame() instead of waitForFrame() in file_restyles.html. r?birtles
MozReview-Commit-ID: K5tjO1tgoeN
--- a/dom/animation/test/mozilla/file_restyles.html
+++ b/dom/animation/test/mozilla/file_restyles.html
@@ -604,34 +604,34 @@ waitForAllPaints(() => {
var animation = div.animate({ backgroundColor: [ 'red', 'blue' ] },
100 * MS_PER_SEC);
await animation.ready;
div.style.display = 'none';
// We need to wait a frame to apply display:none style.
- await waitForFrame();
+ await waitForNextFrame();
is(animation.playState, 'running',
'Script animations keep running even when the target element has ' +
'"display: none" style');
ok(!SpecialPowers.wrap(animation).isRunningOnCompositor,
'Script animations on "display:none" element should not run on the ' +
'compositor');
var markers = await observeStyling(5);
is(markers.length, 0,
'Script animations on "display: none" element should not update styles');
div.style.display = '';
// We need to wait a frame to unapply display:none style.
- await waitForFrame();
+ await waitForNextFrame();
var markers = await observeStyling(5);
is(markers.length, 5,
'Script animations restored from "display: none" state should update ' +
'styles');
await ensureElementRemoval(div);
});
@@ -640,17 +640,17 @@ waitForAllPaints(() => {
var div = addDiv(null);
var animation = div.animate({ opacity: [ 0, 1 ] }, 100 * MS_PER_SEC);
await animation.ready;
div.style.display = 'none';
// We need to wait a frame to apply display:none style.
- await waitForFrame();
+ await waitForNextFrame();
is(animation.playState, 'running',
'Opacity script animations keep running even when the target element ' +
'has "display: none" style');
ok(!SpecialPowers.wrap(animation).isRunningOnCompositor,
'Opacity script animations on "display:none" element should not ' +
'run on the compositor');
@@ -658,17 +658,17 @@ waitForAllPaints(() => {
var markers = await observeStyling(5);
is(markers.length, 0,
'Opacity script animations on "display: none" element should not ' +
'update styles');
div.style.display = '';
// We need to wait a frame to unapply display:none style.
- await waitForFrame();
+ await waitForNextFrame();
ok(SpecialPowers.wrap(animation).isRunningOnCompositor,
'Opacity script animations restored from "display: none" should be ' +
'run on the compositor');
await ensureElementRemoval(div);
});
@@ -831,17 +831,17 @@ waitForAllPaints(() => {
var markers = await observeStyling(5);
is(markers.length, 0,
'Opacity animation on orphaned element should not cause restyles');
document.body.appendChild(div);
// Need a frame to give the animation a chance to be sent to the
// compositor.
- await waitForFrame();
+ await waitForNextFrame();
ok(SpecialPowers.wrap(animation).isRunningOnCompositor,
'The opacity animation which is no longer overridden by the ' +
'!important rule begins running on the compositor even if the ' +
'!important rule had been dropped before the target element was ' +
'removed');
await ensureElementRemoval(div);