diff options
author | vadimt <vadimt@google.com> | 2019-03-19 12:16:39 -0700 |
---|---|---|
committer | vadimt <vadimt@google.com> | 2019-03-19 12:16:39 -0700 |
commit | 6fe4e93d4a6802433241b7030c33a2e162f9280d (patch) | |
tree | 244ef71de84be351fc91bf0036105e2e7087e882 /tests/tapl/com/android/launcher3/tapl/AllAppsFromOverview.java | |
parent | 0825e414f05c525e46a58c32d534989b20da6a41 (diff) | |
download | android_packages_apps_Trebuchet-6fe4e93d4a6802433241b7030c33a2e162f9280d.tar.gz android_packages_apps_Trebuchet-6fe4e93d4a6802433241b7030c33a2e162f9280d.tar.bz2 android_packages_apps_Trebuchet-6fe4e93d4a6802433241b7030c33a2e162f9280d.zip |
Stop using magic constant 0.6 for returning from all apps to overview
Bug: 123904290
Change-Id: If1b6caf562484649ee107532ffe21d25deff4b97
Diffstat (limited to 'tests/tapl/com/android/launcher3/tapl/AllAppsFromOverview.java')
-rw-r--r-- | tests/tapl/com/android/launcher3/tapl/AllAppsFromOverview.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/AllAppsFromOverview.java b/tests/tapl/com/android/launcher3/tapl/AllAppsFromOverview.java index 264281502..dcc51b50b 100644 --- a/tests/tapl/com/android/launcher3/tapl/AllAppsFromOverview.java +++ b/tests/tapl/com/android/launcher3/tapl/AllAppsFromOverview.java @@ -23,6 +23,8 @@ import android.graphics.Point; import androidx.annotation.NonNull; import androidx.test.uiautomator.UiObject2; +import com.android.launcher3.TestProtocol; + /** * Operations on AllApps opened from Overview. */ @@ -45,7 +47,11 @@ public final class AllAppsFromOverview extends AllApps { final UiObject2 qsb = mLauncher.waitForObjectInContainer( allAppsContainer, "search_container_all_apps"); final Point start = qsb.getVisibleCenter(); - final int endY = (int) (mLauncher.getDevice().getDisplayHeight() * 0.6); + final int swipeHeight = mLauncher.getTestInfo( + TestProtocol.REQUEST_ALL_APPS_TO_OVERVIEW_SWIPE_HEIGHT). + getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); + + final int endY = start.y + swipeHeight + mLauncher.getTouchSlop(); LauncherInstrumentation.log("AllAppsFromOverview.switchBackToOverview before swipe"); mLauncher.swipe(start.x, start.y, start.x, endY, OVERVIEW_STATE_ORDINAL); |