Bug 1421476 - Use waitForNextFrame() instead of waitForFrame() in file_restyles.html. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Wed, 29 Nov 2017 13:05:20 +0900
changeset 704923 7ccb5ec5f59f7cff6b8a5610c20f04082eed255a
parent 704922 c64d9907446481d6ac96e1afa3d6cb45a3408776
child 704924 ff52efc400c21374fcae39b4df277103418d4b8e
push id91278
push userhikezoe@mozilla.com
push dateWed, 29 Nov 2017 04:07:53 +0000
reviewersbirtles
bugs1421476
milestone59.0a1
Bug 1421476 - Use waitForNextFrame() instead of waitForFrame() in file_restyles.html. r?birtles MozReview-Commit-ID: K5tjO1tgoeN
dom/animation/test/mozilla/file_restyles.html
--- 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);