From 13398478668d01129ce9fa4746b2c242976f4cbe Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Wed, 3 Jan 2024 15:37:34 -0800 Subject: [PATCH] Waiting for Normal state after pressing Esc in AllApps Bug: 313926097 Flag: N/A Test: presubmit Change-Id: Iace454f28067492623929c8160ee9b30aaa53e1f --- tests/tapl/com/android/launcher3/tapl/AllApps.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java index 0e785659a6..1b67f67cc1 100644 --- a/tests/tapl/com/android/launcher3/tapl/AllApps.java +++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java @@ -21,6 +21,7 @@ import static android.view.KeyEvent.KEYCODE_META_RIGHT; import static com.android.launcher3.tapl.LauncherInstrumentation.DEFAULT_POLL_INTERVAL; import static com.android.launcher3.tapl.LauncherInstrumentation.WAIT_TIME_MS; +import static com.android.launcher3.testing.shared.TestProtocol.NORMAL_STATE_ORDINAL; import android.graphics.Point; import android.graphics.Rect; @@ -399,7 +400,10 @@ public abstract class AllApps extends LauncherInstrumentation.VisibleContainer try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck()) { mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_ALT_ESC_DOWN); mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_ALT_ESC_UP); - mLauncher.getDevice().pressKeyCode(KEYCODE_ESCAPE); + mLauncher.runToState( + () -> mLauncher.getDevice().pressKeyCode(KEYCODE_ESCAPE), + NORMAL_STATE_ORDINAL, + "pressing esc key"); try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer( "pressed esc key")) { verifyVisibleContainerOnDismiss();