Bug 1442150 - Wait for one more frame if the animation starts at the current timeline time in the first test case. r=birtles
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Tue, 06 Mar 2018 10:55:05 +0900
changeset 461654 cbd57b06f2f168707703a47d362884582383c5e8
parent 461653 532ce5be3ae237b58f39ec2c14d8327bb203b597
child 461655 614d32cc355566911aa905794a364c74c9585525
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1442150
milestone60.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 1442150 - Wait for one more frame if the animation starts at the current timeline time in the first test case. r=birtles MozReview-Commit-ID: DVOiauPDqhM
dom/animation/test/chrome/test_running_on_compositor.html
--- a/dom/animation/test/chrome/test_running_on_compositor.html
+++ b/dom/animation/test/chrome/test_running_on_compositor.html
@@ -63,16 +63,27 @@ function assert_animation_is_not_running
 }
 
 promise_test(async t => {
   // FIXME: When we implement Element.animate, use that here instead of CSS
   // so that we remove any dependency on the CSS mapping.
   var div = addDiv(t, { style: 'animation: anim 100s' });
   var animation = div.getAnimations()[0];
 
+  // If the animation starts at the current timeline time, we need to wait for
+  // one more frame to avoid receiving the fake timer-based MozAfterPaint event.
+  // FIXME: Bug 1419226: Drop this 'animation.ready' and 'waitForFrame'.  Once
+  // MozAfterPaint is fired reliably, we just need to wait for a MozAfterPaint
+  // here.
+  await animation.ready;
+
+  if (animationStartsRightNow(animation)) {
+    await waitForFrame();
+  }
+
   await waitForPaints();
 
   assert_animation_is_running_on_compositor(animation,
      'Animation reports that it is running on the compositor'
      + ' during playback');
 
   div.style.animationPlayState = 'paused';