diff options
author | Vadim Tryshev <vadimt@google.com> | 2019-04-04 23:24:10 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-04-04 23:24:10 +0000 |
commit | 2c46fcfa3af97e87a64186c5c61387a2fff1ffa9 (patch) | |
tree | 2c632cee7093a0058edd924f6846f46423397a14 /tests/tapl | |
parent | 6ec196adc4097399f3bc9aee48908d1bae2b39bb (diff) | |
parent | 01e114bbf5347b4f21cba77e90bb943a384f738c (diff) | |
download | android_packages_apps_Trebuchet-2c46fcfa3af97e87a64186c5c61387a2fff1ffa9.tar.gz android_packages_apps_Trebuchet-2c46fcfa3af97e87a64186c5c61387a2fff1ffa9.tar.bz2 android_packages_apps_Trebuchet-2c46fcfa3af97e87a64186c5c61387a2fff1ffa9.zip |
Merge "Going home via swipe in supported cases" into ub-launcher3-master
Diffstat (limited to 'tests/tapl')
-rw-r--r-- | tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 40c488d37..3a45e9342 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -16,6 +16,9 @@ package com.android.launcher3.tapl; +import static com.android.launcher3.TestProtocol.BACKGROUND_APP_STATE_ORDINAL; +import static com.android.launcher3.TestProtocol.NORMAL_STATE_ORDINAL; + import android.app.ActivityManager; import android.app.Instrumentation; import android.app.UiAutomation; @@ -344,18 +347,33 @@ public final class LauncherInstrumentation { log(action = "0-button: already in workspace"); } else if (hasLauncherObject(OVERVIEW_RES_ID)) { log(action = "0-button: from overview"); - mDevice.pressHome(); + final UiObject2 navBar = waitForSystemUiObject("navigation_bar_frame"); + + swipe( + navBar.getVisibleBounds().centerX(), navBar.getVisibleBounds().centerY(), + navBar.getVisibleBounds().centerX(), 0, + NORMAL_STATE_ORDINAL, ZERO_BUTTON_STEPS_FROM_BACKGROUND_TO_HOME); } else if (hasLauncherObject(WIDGETS_RES_ID)) { log(action = "0-button: from widgets"); mDevice.pressHome(); } else if (hasLauncherObject(APPS_RES_ID)) { log(action = "0-button: from all apps"); - mDevice.pressHome(); + final UiObject2 navBar = waitForSystemUiObject("navigation_bar_frame"); + + swipe( + navBar.getVisibleBounds().centerX(), navBar.getVisibleBounds().centerY(), + navBar.getVisibleBounds().centerX(), 0, + NORMAL_STATE_ORDINAL, ZERO_BUTTON_STEPS_FROM_BACKGROUND_TO_HOME); } else { log(action = "0-button: from another app"); assertTrue("Launcher is visible, don't know how to go home", !mDevice.hasObject(By.pkg(getLauncherPackageName()))); - mDevice.pressHome(); + final UiObject2 navBar = waitForSystemUiObject("navigation_bar_frame"); + + swipe( + navBar.getVisibleBounds().centerX(), navBar.getVisibleBounds().centerY(), + navBar.getVisibleBounds().centerX(), 0, + BACKGROUND_APP_STATE_ORDINAL, ZERO_BUTTON_STEPS_FROM_BACKGROUND_TO_HOME); } } else { log(action = "clicking home button"); |