summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorvadimt <vadimt@google.com>2019-05-23 17:41:07 -0700
committervadimt <vadimt@google.com>2019-05-24 19:28:40 -0700
commit2d6cd80bc9c125d5212695da99c1b1ed47611443 (patch)
tree2e423dcdde08231492ad2ae354e196bfafa255ce /tests
parent55d1e44c47d118e23c0ec452c5e5b31e8cd32690 (diff)
downloadandroid_packages_apps_Trebuchet-2d6cd80bc9c125d5212695da99c1b1ed47611443.tar.gz
android_packages_apps_Trebuchet-2d6cd80bc9c125d5212695da99c1b1ed47611443.tar.bz2
android_packages_apps_Trebuchet-2d6cd80bc9c125d5212695da99c1b1ed47611443.zip
Launcher reports whe 0-button swipe-up gesture pause is detected.
This eliminates an unreliable timeout. Also removing an unnecessary check for harness that is done by the called method. Change-Id: If954580060415cbb2952532c16ea0ae4dc7b9469
Diffstat (limited to 'tests')
-rw-r--r--tests/tapl/com/android/launcher3/tapl/Background.java13
-rw-r--r--tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java2
2 files changed, 10 insertions, 5 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/Background.java b/tests/tapl/com/android/launcher3/tapl/Background.java
index e1537e94a..ce952983f 100644
--- a/tests/tapl/com/android/launcher3/tapl/Background.java
+++ b/tests/tapl/com/android/launcher3/tapl/Background.java
@@ -32,7 +32,6 @@ import com.android.launcher3.testing.TestProtocol;
*/
public class Background extends LauncherInstrumentation.VisibleContainer {
private static final int ZERO_BUTTON_SWIPE_UP_GESTURE_DURATION = 500;
- private static final int ZERO_BUTTON_SWIPE_UP_HOLD_DURATION = 400;
Background(LauncherInstrumentation launcher) {
super(launcher);
@@ -72,9 +71,15 @@ public class Background extends LauncherInstrumentation.VisibleContainer {
final long downTime = SystemClock.uptimeMillis();
mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_DOWN, start);
- mLauncher.movePointer(
- downTime, downTime, ZERO_BUTTON_SWIPE_UP_GESTURE_DURATION, start, end);
- LauncherInstrumentation.sleep(ZERO_BUTTON_SWIPE_UP_HOLD_DURATION);
+ mLauncher.executeAndWaitForEvent(
+ () -> mLauncher.movePointer(
+ downTime,
+ downTime,
+ ZERO_BUTTON_SWIPE_UP_GESTURE_DURATION,
+ start,
+ end),
+ event -> TestProtocol.PAUSE_DETECTED_MESSAGE.equals(event.getClassName()),
+ "Pause wasn't detected");
mLauncher.sendPointer(
downTime, SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, end);
break;
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index 8d69b3783..a442e2b02 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -364,7 +364,7 @@ public final class LauncherInstrumentation {
}
}
- private Parcelable executeAndWaitForEvent(Runnable command,
+ Parcelable executeAndWaitForEvent(Runnable command,
UiAutomation.AccessibilityEventFilter eventFilter, String message) {
try {
final AccessibilityEvent event =