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
--- 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);
});