Bug 1807659. Wait for a refresh driver tick in gfx/layers/apz/test/mochitest/helper_zoom_keyboardscroll.html after all actions. r=botond

Didn't investigate why this was failing exactly, but promiseApzFlushedRepaints does not wait for a refresh driver tick and I remember from fixing some other scrolling tests a while back that sometimes you need to wait for a refresh driver tick for things to be completed (don't remember the details).

Differential Revision: https://phabricator.services.mozilla.com/D165546
This commit is contained in:
Timothy Nikkel 2022-12-28 01:19:37 +00:00
parent a003f4e458
commit 76d7c07c5f

View file

@ -25,6 +25,7 @@
// Zoom in
SpecialPowers.getDOMWindowUtils(window).setResolutionAndScaleTo(2.0);
await promiseApzFlushedRepaints();
await promiseFrame();
is(await getResolution(), 2.0, "should have zoomed (6)");
@ -36,6 +37,7 @@
window.synthesizeKey("KEY_ArrowRight");
await promiseApzFlushedRepaints();
await promiseFrame();
is(await getResolution(), 2.0, "should be zoomed (11)");
@ -47,6 +49,7 @@
window.synthesizeKey("KEY_ArrowDown");
await promiseApzFlushedRepaints();
await promiseFrame();
is(await getResolution(), 2.0, "should be zoomed (16)");
@ -58,6 +61,7 @@
// Zoom back out
SpecialPowers.getDOMWindowUtils(window).setResolutionAndScaleTo(1.0);
await promiseApzFlushedRepaints();
await promiseFrame();
is(await getResolution(), 1.0, "should not be zoomed (21)");
}