Ensure waitOnMainUntil runs on the main thread

Test: n/a
Bug: 296390700
Change-Id: I1c0a024ef6e645e6f3d9b2b041879455903be533
This commit is contained in:
Cosmin Băieș
2023-08-17 16:58:51 +02:00
parent 92e3f280e7
commit 30874b7782

View File

@@ -154,7 +154,7 @@ public final class ImeStressTestUtil {
* <p>The given {@code pred} will be called on the main thread.
*/
public static void waitOnMainUntil(String message, Callable<Boolean> pred) {
eventually(() -> assertWithMessage(message).that(pred.call()).isTrue(), TIMEOUT);
eventually(() -> assertWithMessage(message).that(callOnMainSync(pred)).isTrue(), TIMEOUT);
}
/** Waits until IME is shown, or throws on timeout. */