Bug 1803992 - Call BrowserTestUtils.waitForContentEvent before awaiting "apz-repaints-flushed" in content. r=botond

It will ensure that the BrowserTestUtils.waitForContentEvent has finished
setting up the event listener in content before sending native pan events.

Differential Revision: https://phabricator.services.mozilla.com/D165344
This commit is contained in:
Hiroyuki Ikezoe 2022-12-21 22:43:19 +00:00
parent a798663417
commit 79ff9afbce

View file

@ -36,16 +36,16 @@ add_task(async () => {
URL_ROOT + "helper_content_response_timeout.html"
);
await SpecialPowers.spawn(tab.linkedBrowser, [], async () => {
await content.wrappedJSObject.promiseApzFlushedRepaints();
await content.wrappedJSObject.waitUntilApzStable();
});
let scrollPromise = BrowserTestUtils.waitForContentEvent(
tab.linkedBrowser,
"scroll"
);
await SpecialPowers.spawn(tab.linkedBrowser, [], async () => {
await content.wrappedJSObject.promiseApzFlushedRepaints();
await content.wrappedJSObject.waitUntilApzStable();
});
// Note that below function uses `WaitForObserver` version of sending a
// pan-start event function so that the notification can be sent in the parent
// process, thus we can get the notification even if the content process is