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.
This commit is contained in:
Brian Birtles 2015-03-17 18:38:12 +09:00
parent 90986d4597
commit e3f0c2f97e

View File

@ -60,13 +60,18 @@ async_test(function(t) {
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');