Bug 1113425 part 3 - Make test_deferred_start.html wait an extra frame; r=mattwoodrow
authorBrian Birtles <birtles@gmail.com>
Tue, 17 Mar 2015 18:38:12 +0900
changeset 234154 34cd34ba168b51ee2f629c6f4eb6809728127fea
parent 234153 bb3866dea03ed809a07d7e57c5c405c4c3469fe5
child 234155 ffc332980766ddd94bab26558c85f21c2f5a5949
push id57050
push userbbirtles@mozilla.com
push dateWed, 18 Mar 2015 02:36:35 +0000
treeherdermozilla-inbound@ffc332980766 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1113425
milestone39.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 1113425 part 3 - Make test_deferred_start.html wait an extra frame; r=mattwoodrow This is needed to avoid intermittent failures on Mulet and B2G ICS Emulator.
dom/animation/test/mozilla/test_deferred_start.html
--- a/dom/animation/test/mozilla/test_deferred_start.html
+++ b/dom/animation/test/mozilla/test_deferred_start.html
@@ -55,23 +55,28 @@ async_test(function(t) {
     var player = div.getAnimationPlayers()[0];
 
     player.ready.then(function() {
       promiseCallbackDone = true;
     }).catch(function() {
       assert_unreached('ready promise was rejected');
     });
 
-  // We need to wait for up to two frames since the animation may not start
-  // until the beginning of the next refresh driver tick and it won't queue
-  // the ready Promise callback until that point.
-  }).then(waitForFrame).then(waitForFrame).then(t.step_func(function() {
+  // We need to wait for up to three frames. This is because in some
+  // cases it can take up to two frames for the initial layout
+  // to take place. Even after that happens we don't actually resolve the
+  // ready promise until the following tick.
+  })
+  .then(waitForFrame)
+  .then(waitForFrame)
+  .then(waitForFrame)
+  .then(t.step_func(function() {
     assert_true(promiseCallbackDone,
-                'ready promise callback was called before the next'
-                + ' requestAnimationFrame callback');
+                'ready promise for an empty animation was resolved'
+                + ' within three animation frames');
     t.done();
   }));
 }, 'AnimationPlayer.ready is resolved for an empty animation');
 
 // Test that compositor animations with delays get synced correctly
 //
 // NOTE: It is important that we DON'T use
 // SpecialPowers.DOMWindowUtils.advanceTimeAndRefresh here since that takes