Waiting for Normal state after pressing Esc in AllApps

Bug: 313926097
Flag: N/A
Test: presubmit
Change-Id: Iace454f28067492623929c8160ee9b30aaa53e1f
This commit is contained in:
Vadim Tryshev committed 2024-01-03 15:38:00 -08:00
1 parent df20ea0ed4
commit 1339847866
1 file changed
+5 -1
@@ -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();