Bug 1685829 - Migrate test_interrupted_reflow.html to async/await style. r=botond

Depends on D101282

Differential Revision: https://phabricator.services.mozilla.com/D101283
This commit is contained in:
Kartikaya Gupta 2021-01-11 21:19:13 +00:00
Родитель eecf43b986
Коммит 69ebcd8280
1 изменённых файлов: 6 добавлений и 7 удалений

Просмотреть файл

@ -594,7 +594,7 @@ function getAsyncScrollOffsets(aPaintsToIgnore) {
return offsets;
}
function* test(testDriver) {
async function test() {
var utils = SpecialPowers.DOMWindowUtils;
// The APZ test data accumulates whenever a test turns it on. We just want
@ -609,9 +609,8 @@ function* test(testDriver) {
var maxScroll = elm.scrollTopMax;
elm.scrollTop = maxScroll;
yield waitForAllPaints(function() {
flushApzRepaints(testDriver);
});
await promiseAllPaintsDone();
await promiseApzRepaintsFlushed();
// Take control of the refresh driver
utils.advanceTimeAndRefresh(0);
@ -628,7 +627,7 @@ function* test(testDriver) {
utils.advanceTimeAndRefresh(0);
// On android, and maybe non-e10s platforms generally, we need to manually
// kick the paint to send the layer transaction to the compositor.
yield waitForAllPaints(function() { setTimeout(testDriver, 0); });
await promiseAllPaintsDone();
// Read the main-thread scroll offset; although this is temporarily 0,0 that
// temporary value is never exposed to content - instead reading this value
@ -639,7 +638,7 @@ function* test(testDriver) {
// .. and now flush everything to make sure the state gets pushed over to the
// compositor and APZ as well.
utils.restoreNormalRefresh();
yield waitForApzFlushedRepaints(testDriver);
await promiseApzFlushedRepaints();
// Now we pull the compositor data and check it. What we expect to see is that
// the scroll position goes to maxScroll, then drops to 0 and then goes back
@ -710,7 +709,7 @@ if (isApzEnabled()) {
pushPrefs([["apz.test.logging_enabled", true],
["apz.displayport_expiry_ms", 0]])
.then(waitUntilApzStable)
.then(runContinuation(test))
.then(test)
.then(SimpleTest.finish, SimpleTest.finishWithFailure);
}