Merge "Fixing pressHome when a context menu is visible" into ub-launcher3-qt-dev
am: 666b60a074
Change-Id: I2191c4ed1b405e13a55cf35c7398e021b80c9063
This commit is contained in:
@@ -100,6 +100,14 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
|
|||||||
executeOnLauncher(
|
executeOnLauncher(
|
||||||
launcher -> assertTrue("Launcher internal state didn't switch to Showing Menu",
|
launcher -> assertTrue("Launcher internal state didn't switch to Showing Menu",
|
||||||
OptionsPopupView.getOptionsPopup(launcher) != null));
|
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) {
|
public static void runAllAppsTest(AbstractLauncherUiTest test, AllApps allApps) {
|
||||||
|
|||||||
@@ -400,13 +400,22 @@ public final class LauncherInstrumentation {
|
|||||||
// accessibility events prior to pressing Home.
|
// accessibility events prior to pressing Home.
|
||||||
final String action;
|
final String action;
|
||||||
if (getNavigationModel() == NavigationModel.ZERO_BUTTON) {
|
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)) {
|
if (hasLauncherObject(WORKSPACE_RES_ID)) {
|
||||||
log(action = "already at home");
|
log(action = "already at home");
|
||||||
} else {
|
} else {
|
||||||
log(action = "swiping up to home");
|
log(action = "swiping up to home");
|
||||||
final int finalState = mDevice.hasObject(By.pkg(getLauncherPackageName()))
|
final int finalState = mDevice.hasObject(By.pkg(getLauncherPackageName()))
|
||||||
? NORMAL_STATE_ORDINAL : BACKGROUND_APP_STATE_ORDINAL;
|
? NORMAL_STATE_ORDINAL : BACKGROUND_APP_STATE_ORDINAL;
|
||||||
final Point displaySize = getRealDisplaySize();
|
|
||||||
|
|
||||||
swipeToState(
|
swipeToState(
|
||||||
displaySize.x / 2, displaySize.y - 1,
|
displaySize.x / 2, displaySize.y - 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user