diff options
author | vadimt <vadimt@google.com> | 2019-05-28 17:31:03 -0700 |
---|---|---|
committer | vadimt <vadimt@google.com> | 2019-05-28 17:31:03 -0700 |
commit | aa8019308b75ccb9558021aeb1f89ecaf6c7b21f (patch) | |
tree | f2711366ec982ff5903dfa4fbf5b97cc17019db4 | |
parent | ebd5e88164ef3a59cfe5f75a9eaeb95222ded7fa (diff) | |
download | android_packages_apps_Trebuchet-aa8019308b75ccb9558021aeb1f89ecaf6c7b21f.tar.gz android_packages_apps_Trebuchet-aa8019308b75ccb9558021aeb1f89ecaf6c7b21f.tar.bz2 android_packages_apps_Trebuchet-aa8019308b75ccb9558021aeb1f89ecaf6c7b21f.zip |
Fixing pressHome when a context menu is visible
Bug: 132460627
Change-Id: I78064166fccd3a29bcb3fa6175bd4937ae032a98
-rw-r--r-- | tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java | 8 | ||||
-rw-r--r-- | tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java | 11 |
2 files changed, 18 insertions, 1 deletions
diff --git a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java index d4cfe3aa2..4e4ba7329 100644 --- a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java +++ b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java @@ -100,6 +100,14 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { executeOnLauncher( launcher -> assertTrue("Launcher internal state didn't switch to Showing Menu", OptionsPopupView.getOptionsPopup(launcher) != null)); + // Check that pressHome works when the menu is shown. + mLauncher.pressHome(); + } + + @Test + public void testPressHomeOnAllAppsContextMenu() throws Exception { + mLauncher.getWorkspace().switchToAllApps().getAppIcon("TestActivity7").openMenu(); + mLauncher.pressHome(); } public static void runAllAppsTest(AbstractLauncherUiTest test, AllApps allApps) { diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index a442e2b02..f7befd140 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -400,13 +400,22 @@ public final class LauncherInstrumentation { // accessibility events prior to pressing Home. final String action; if (getNavigationModel() == NavigationModel.ZERO_BUTTON) { + final Point displaySize = getRealDisplaySize(); + + if (hasLauncherObject("deep_shortcuts_container")) { + linearGesture( + displaySize.x / 2, displaySize.y - 1, + displaySize.x / 2, 0, + ZERO_BUTTON_STEPS_FROM_BACKGROUND_TO_HOME); + assertTrue("Context menu is still visible afterswiping up to home", + !hasLauncherObject("deep_shortcuts_container")); + } if (hasLauncherObject(WORKSPACE_RES_ID)) { log(action = "already at home"); } else { log(action = "swiping up to home"); final int finalState = mDevice.hasObject(By.pkg(getLauncherPackageName())) ? NORMAL_STATE_ORDINAL : BACKGROUND_APP_STATE_ORDINAL; - final Point displaySize = getRealDisplaySize(); swipeToState( displaySize.x / 2, displaySize.y - 1, |