Bug 1424949 - Wait for one more frame before checking animation start time to avoid the situation that the animation just begins at the time when it's ready. r?birtles
MozReview-Commit-ID: 6bNfl10TiT6
--- a/dom/animation/test/css-animations/file_animations-dynamic-changes.html
+++ b/dom/animation/test/css-animations/file_animations-dynamic-changes.html
@@ -95,17 +95,17 @@ promise_test(function(t) {
}, 'Only the startTimes of existing animations are preserved');
promise_test(function(t) {
var div = addDiv(t);
div.style.animation = 'anim1 100s, anim1 100s';
var secondAnimation = div.getAnimations()[1];
// Wait before continuing so we can compare start times
- return secondAnimation.ready.then(waitForFrame).then(function() {
+ return secondAnimation.ready.then(waitForNextFrame).then(function() {
// Trim list of animations
div.style.animationName = 'anim1';
var animations = div.getAnimations();
assert_equals(animations.length, 1, 'List of Animations was trimmed');
assert_equals(animations[0], secondAnimation,
'Remaining Animation is the second one in the list');
assert_equals(typeof(animations[0].startTime), 'number',
'Remaining Animation has resolved startTime');