Bug 1839964 - Call waitForRoundTrip() to make sure evaluatePromiseJS has set up the given JS. r=botond,geckoview-reviewers,m_kato

There's a race in between a call of `evaluatePromiseJS` and a call of
`flushApzRepaints` which is similar to bug 1743857. If the given JS for the
`evaluatePromiseJS` call returns a Promise and if the call site doesn't wait for
the Promise, we can't ensure the given JS has set up in the content.

Unforutnately there's no good way to avoid the race, adding `waitForRoundTrip`
seems to work.

Differential Revision: https://phabricator.services.mozilla.com/D182439
This commit is contained in:
Hiroyuki Ikezoe 2023-07-04 06:32:05 +00:00
parent 3d156124fd
commit 7118a0eee6

View File

@ -440,6 +440,10 @@ class InputResultDetailTest : BaseSessionTest() {
""".trimIndent(),
)
// Explicitly call `waitForRoundTrip()` to make sure the above event listners
// have set up in the content.
mainSession.waitForRoundTrip()
mainSession.flushApzRepaints()
val downTime = SystemClock.uptimeMillis()