Expect state transition to overview while holding the swipe from home
- When swiping from home to overview, overview launches while the finger is still holding the gesture, which is different from swiping from app to overview
Bug: 193440212
Test: TaplTestQuickStep.testOverview and TaplTestQuickStep.testBackground
Change-Id: Ie45e9cb5e599175a56ed368bef107b84db919a34
diff --git a/tests/tapl/com/android/launcher3/tapl/Background.java b/tests/tapl/com/android/launcher3/tapl/Background.java
index 75b87b7..b290bb1 100644
--- a/tests/tapl/com/android/launcher3/tapl/Background.java
+++ b/tests/tapl/com/android/launcher3/tapl/Background.java
@@ -71,6 +71,10 @@
return mLauncher.isTablet();
}
+ protected boolean zeroButtonToOverviewGestureStateTransitionWhileHolding() {
+ return false;
+ }
+
protected void goToOverviewUnchecked() {
switch (mLauncher.getNavigationModel()) {
case ZERO_BUTTON: {
@@ -90,21 +94,32 @@
mLauncher.sendPointer(
downTime, downTime, MotionEvent.ACTION_DOWN, start, gestureScope);
- mLauncher.executeAndWaitForLauncherEvent(
- () -> mLauncher.movePointer(
- downTime,
- downTime,
- ZERO_BUTTON_SWIPE_UP_GESTURE_DURATION,
- start,
- end,
- gestureScope),
- event -> TestProtocol.PAUSE_DETECTED_MESSAGE.equals(event.getClassName()),
- () -> "Pause wasn't detected", "swiping and holding");
- mLauncher.runToState(
- () -> mLauncher.sendPointer(
- downTime, SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, end,
- gestureScope),
- OVERVIEW_STATE_ORDINAL, "sending UP event");
+ Runnable swipeAndHold = () -> mLauncher.movePointer(
+ downTime,
+ downTime,
+ ZERO_BUTTON_SWIPE_UP_GESTURE_DURATION,
+ start,
+ end,
+ gestureScope);
+ String swipeAndHoldAction = "swiping and holding";
+ Runnable up = () -> mLauncher.sendPointer(
+ downTime, SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, end,
+ gestureScope);
+ String upAction = "sending UP event";
+ if (zeroButtonToOverviewGestureStateTransitionWhileHolding()) {
+ mLauncher.runToState(swipeAndHold, OVERVIEW_STATE_ORDINAL, swipeAndHoldAction);
+ try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(upAction)) {
+ up.run();
+ }
+ } else {
+ mLauncher.executeAndWaitForLauncherEvent(
+ swipeAndHold,
+ event -> TestProtocol.PAUSE_DETECTED_MESSAGE.equals(
+ event.getClassName()),
+ () -> "Pause wasn't detected",
+ swipeAndHoldAction);
+ mLauncher.runToState(up, OVERVIEW_STATE_ORDINAL, upAction);
+ }
break;
}
diff --git a/tests/tapl/com/android/launcher3/tapl/Home.java b/tests/tapl/com/android/launcher3/tapl/Home.java
index 0060844..ee9dd1a 100644
--- a/tests/tapl/com/android/launcher3/tapl/Home.java
+++ b/tests/tapl/com/android/launcher3/tapl/Home.java
@@ -63,4 +63,8 @@
return true;
}
+ @Override
+ protected boolean zeroButtonToOverviewGestureStateTransitionWhileHolding() {
+ return true;
+ }
}
\ No newline at end of file