diff options
author | Vadim Tryshev <vadimt@google.com> | 2018-08-30 16:01:47 -0700 |
---|---|---|
committer | vadimt <vadimt@google.com> | 2019-03-25 15:45:47 -0700 |
commit | 6d862386fb7fdb620c663a6366796ea3dba743e6 (patch) | |
tree | 135ba5f268501393e8bec0c855df6e0fbd32a399 /tests/tapl/com/android/launcher3 | |
parent | 56635d4f8532ac368e25224c6b4fb79328bc3497 (diff) | |
download | android_packages_apps_Trebuchet-6d862386fb7fdb620c663a6366796ea3dba743e6.tar.gz android_packages_apps_Trebuchet-6d862386fb7fdb620c663a6366796ea3dba743e6.tar.bz2 android_packages_apps_Trebuchet-6d862386fb7fdb620c663a6366796ea3dba743e6.zip |
Slowing down some gestures for testing on virtual devices
Change-Id: Ie8b9a4eff3e9b4c133719a6292d2d251b87b90e8
Diffstat (limited to 'tests/tapl/com/android/launcher3')
3 files changed, 8 insertions, 3 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java index 122151e9d..7ab91bc86 100644 --- a/tests/tapl/com/android/launcher3/tapl/AllApps.java +++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java @@ -29,7 +29,7 @@ import com.android.launcher3.TestProtocol; public class AllApps extends LauncherInstrumentation.VisibleContainer { private static final int MAX_SCROLL_ATTEMPTS = 40; private static final int MIN_INTERACT_SIZE = 100; - private static final int FLING_SPEED = 3000; + private static final int FLING_SPEED = LauncherInstrumentation.needSlowGestures() ? 1000 : 3000; private final int mHeight; diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index f44022baa..f7de2f95c 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -26,6 +26,7 @@ import android.content.ContentResolver; import android.content.Context; import android.graphics.Point; import android.net.Uri; +import android.os.Build; import android.os.Bundle; import android.os.Parcelable; import android.os.SystemClock; @@ -161,6 +162,10 @@ public final class LauncherInstrumentation { return isSwipeUpEnabled() ? NavigationModel.TWO_BUTTON : NavigationModel.THREE_BUTTON; } + static boolean needSlowGestures() { + return Build.MODEL.contains("Cuttlefish"); + } + private boolean isSwipeUpEnabled() { final boolean swipeUpEnabledDefaultValue = SwipeUpSetting.isSwipeUpEnabledDefaultValue(); return SwipeUpSetting.isSwipeUpSettingAvailable() ? diff --git a/tests/tapl/com/android/launcher3/tapl/Workspace.java b/tests/tapl/com/android/launcher3/tapl/Workspace.java index 7d97acd75..6868e1e49 100644 --- a/tests/tapl/com/android/launcher3/tapl/Workspace.java +++ b/tests/tapl/com/android/launcher3/tapl/Workspace.java @@ -36,7 +36,7 @@ import com.android.launcher3.TestProtocol; public final class Workspace extends Home { private static final float FLING_SPEED = 3500.0F; private final UiObject2 mHotseat; - private final int ICON_DRAG_SPEED = 2000; + private final int ICON_DRAG_SPEED = LauncherInstrumentation.needSlowGestures() ? 100 : 570; Workspace(LauncherInstrumentation launcher) { super(launcher); @@ -107,7 +107,7 @@ public final class Workspace extends Home { getHotseatAppIcon("Messages"), new Point(mLauncher.getDevice().getDisplayWidth(), workspace.getVisibleBounds().centerY()), - ICON_DRAG_SPEED); + (int) (ICON_DRAG_SPEED * mLauncher.getDisplayDensity())); verifyActiveContainer(); } assertTrue("Home screen workspace didn't become scrollable", |