Bug 1413817 - Wait for a frame after waiting animation.finished. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Thu, 09 Nov 2017 08:06:38 +0900
changeset 695304 ce78d4e647d8a5598d9a95e0a0534383a7ddc734
parent 695303 9639e5647a44f48ed16ac9a826fe9e317f8447db
child 739560 f96e5924d626151adfcfc7f74a2867014d4e3a2b
push id88383
push userhikezoe@mozilla.com
push dateThu, 09 Nov 2017 00:26:11 +0000
reviewersbirtles
bugs1413817
milestone58.0a1
Bug 1413817 - Wait for a frame after waiting animation.finished. r?birtles We occasionally observed a restyle record on Android there, probably it's the last restyling to remove the animation. Ideally we should wait a paint and a frame there, but given that the restyle record is not always observed, just waiting a frame should be a safer way, if a paint does not happen, the test would be timed out. MozReview-Commit-ID: Flmqdq0b8kC
dom/animation/test/mozilla/file_restyles.html
--- a/dom/animation/test/mozilla/file_restyles.html
+++ b/dom/animation/test/mozilla/file_restyles.html
@@ -244,16 +244,18 @@ waitForAllPaints(() => {
 
     var animation = div.getAnimations()[0];
     var initialRect = div.getBoundingClientRect();
 
     await waitForPaintsAndFrame();
 
     await animation.finished;
 
+    await waitForFrame();
+
     var mouseX = initialRect.left + initialRect.width / 2;
     var mouseY = initialRect.top + initialRect.height / 2;
     var markers = await observeStyling(5, () => {
       // We can't use synthesizeMouse here since synthesizeMouse causes
       // layout flush.
       synthesizeMouseAtPoint(mouseX++, mouseY++,
                              { type: 'mousemove' }, window);
     });
@@ -269,16 +271,18 @@ waitForAllPaints(() => {
     var animation = div.getAnimations()[0];
 
     var initialRect = div.getBoundingClientRect();
 
     await waitForPaintsAndFrame();
 
     await animation.finished;
 
+    await waitForFrame();
+
     var mouseX = initialRect.left + initialRect.width / 2;
     var mouseY = initialRect.top + initialRect.height / 2;
     var markers = await observeStyling(5, () => {
       // We can't use synthesizeMouse here since synthesizeMouse causes
       // layout flush.
       synthesizeMouseAtPoint(mouseX++, mouseY++,
                              { type: 'mousemove' }, window);
     });