summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPat Manning <patmanning@google.com>2023-05-05 17:22:21 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2023-05-05 17:22:21 +0000
commitc27605099c14aac3c6f4a7336cf7f573aa0fa780 (patch)
tree7d75f26e05476206740527829858d1c3252edf28 /tests
parentc5882bcdfc713aa04aac18dd509d72f306ad8a96 (diff)
downloadLauncher3-c27605099c14aac3c6f4a7336cf7f573aa0fa780.tar.gz
Revert "Listen for hover events over stashed taskbar."
This reverts commit c5882bcdfc713aa04aac18dd509d72f306ad8a96. Reason for revert: b/281068877 Change-Id: I431678658fc464c995df0df5e3cac5491d91b052
Diffstat (limited to 'tests')
-rw-r--r--tests/shared/com/android/launcher3/testing/shared/TestProtocol.java1
-rw-r--r--tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java98
-rw-r--r--tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java12
3 files changed, 1 insertions, 110 deletions
diff --git a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java
index 2c3ea347d7..36255b4628 100644
--- a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java
+++ b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java
@@ -90,7 +90,6 @@ public final class TestProtocol {
public static final String REQUEST_DISABLE_TRANSIENT_TASKBAR = "disable-transient-taskbar";
public static final String REQUEST_UNSTASH_TASKBAR_IF_STASHED = "unstash-taskbar-if-stashed";
public static final String REQUEST_STASHED_TASKBAR_HEIGHT = "stashed-taskbar-height";
- public static final String REQUEST_STASHED_TASKBAR_SCALE = "taskbar-stash-handle-scale";
public static final String REQUEST_RECREATE_TASKBAR = "recreate-taskbar";
public static final String REQUEST_APP_LIST_FREEZE_FLAGS = "app-list-freeze-flags";
public static final String REQUEST_APPS_LIST_SCROLL_Y = "apps-list-scroll-y";
diff --git a/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java b/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java
index d1a270450a..4a3507ed69 100644
--- a/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java
+++ b/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java
@@ -22,17 +22,13 @@ import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_DISABLE_
import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_ENABLE_BLOCK_TIMEOUT;
import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_ENABLE_MANUAL_TASKBAR_STASHING;
import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_STASHED_TASKBAR_HEIGHT;
-import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_STASHED_TASKBAR_SCALE;
import android.graphics.Point;
import android.graphics.Rect;
import android.os.SystemClock;
import android.view.MotionEvent;
-import android.view.ViewConfiguration;
import androidx.test.uiautomator.By;
-import androidx.test.uiautomator.Condition;
-import androidx.test.uiautomator.UiDevice;
import com.android.launcher3.testing.shared.TestProtocol;
@@ -44,18 +40,6 @@ public final class LaunchedAppState extends Background {
// More drag steps than Launchables to give the window manager time to register the drag.
private static final int DEFAULT_DRAG_STEPS = 35;
- // UNSTASHED_TASKBAR_HANDLE_HINT_SCALE value from TaskbarStashController.
- private static final float UNSTASHED_TASKBAR_HANDLE_HINT_SCALE = 1.1f;
-
- private final Condition<UiDevice, Boolean> mStashedTaskbarHintScaleCondition =
- device -> mLauncher.getTestInfo(REQUEST_STASHED_TASKBAR_SCALE).getFloat(
- TestProtocol.TEST_INFO_RESPONSE_FIELD) - UNSTASHED_TASKBAR_HANDLE_HINT_SCALE
- < 0.00001f;
-
- private final Condition<UiDevice, Boolean> mStashedTaskbarDefaultScaleCondition =
- device -> mLauncher.getTestInfo(REQUEST_STASHED_TASKBAR_SCALE).getFloat(
- TestProtocol.TEST_INFO_RESPONSE_FIELD) - 1f < 0.00001f;
-
LaunchedAppState(LauncherInstrumentation launcher) {
super(launcher);
}
@@ -194,86 +178,4 @@ public final class LaunchedAppState extends Background {
}
}
}
-
- /**
- * Emulate the cursor hovering the screen edge to unstash the taskbar.
- *
- * <p>This unstashing occurs when not actively hovering the taskbar.
- */
- public void hoverScreenBottomEdgeToUnstashTaskbar() {
- try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
- LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
- "cursor hover entering screen edge to unstash taskbar")) {
- mLauncher.getDevice().wait(mStashedTaskbarDefaultScaleCondition,
- ViewConfiguration.DEFAULT_LONG_PRESS_TIMEOUT);
-
- long downTime = SystemClock.uptimeMillis();
- int leftEdge = 10;
- Point taskbarUnstashArea = new Point(leftEdge, mLauncher.getRealDisplaySize().y - 1);
- mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_HOVER_ENTER,
- new Point(taskbarUnstashArea.x, taskbarUnstashArea.y), null);
-
- mLauncher.waitForSystemLauncherObject(TASKBAR_RES_ID);
- }
- }
-
- /**
- * Emulate the cursor hovering the taskbar to get unstash hint, then hovering below to unstash.
- */
- public void hoverBelowHintedTaskbarToUnstash() {
- try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
- LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
- "cursor hover entering stashed taskbar")) {
- long downTime = SystemClock.uptimeMillis();
- Point stashedTaskbarHintArea = new Point(mLauncher.getRealDisplaySize().x / 2,
- mLauncher.getRealDisplaySize().y - 1);
- mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_HOVER_ENTER,
- new Point(stashedTaskbarHintArea.x, stashedTaskbarHintArea.y), null);
-
- mLauncher.getDevice().wait(mStashedTaskbarHintScaleCondition,
- LauncherInstrumentation.WAIT_TIME_MS);
-
- try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer(
- "cursor hover enter below taskbar to unstash")) {
- downTime = SystemClock.uptimeMillis();
- Point taskbarUnstashArea = new Point(mLauncher.getRealDisplaySize().x / 2,
- mLauncher.getRealDisplaySize().y - 1);
- mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_HOVER_EXIT,
- new Point(taskbarUnstashArea.x, taskbarUnstashArea.y), null);
-
- mLauncher.waitForSystemLauncherObject(TASKBAR_RES_ID);
- }
- }
- }
-
- /**
- * Emulate the cursor entering and exiting a hover over the taskbar.
- */
- public void hoverToShowTaskbarUnstashHint() {
- try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
- LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
- "cursor hover entering stashed taskbar")) {
- long downTime = SystemClock.uptimeMillis();
- Point stashedTaskbarHintArea = new Point(mLauncher.getRealDisplaySize().x / 2,
- mLauncher.getRealDisplaySize().y - 1);
- mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_HOVER_ENTER,
- new Point(stashedTaskbarHintArea.x, stashedTaskbarHintArea.y), null);
-
- mLauncher.getDevice().wait(mStashedTaskbarHintScaleCondition,
- LauncherInstrumentation.WAIT_TIME_MS);
-
- try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer(
- "cursor hover exiting stashed taskbar")) {
- Point outsideStashedTaskbarHintArea = new Point(
- mLauncher.getRealDisplaySize().x / 2,
- mLauncher.getRealDisplaySize().y - 500);
- mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_HOVER_EXIT,
- new Point(outsideStashedTaskbarHintArea.x, outsideStashedTaskbarHintArea.y),
- null);
-
- mLauncher.getDevice().wait(mStashedTaskbarDefaultScaleCondition,
- LauncherInstrumentation.WAIT_TIME_MS);
- }
- }
- }
}
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index 80fded5872..c4f82695d5 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -107,8 +107,6 @@ public final class LauncherInstrumentation {
static final Pattern EVENT_TOUCH_DOWN_TIS = getTouchEventPatternTIS("ACTION_DOWN");
static final Pattern EVENT_TOUCH_UP_TIS = getTouchEventPatternTIS("ACTION_UP");
static final Pattern EVENT_TOUCH_CANCEL_TIS = getTouchEventPatternTIS("ACTION_CANCEL");
- static final Pattern EVENT_HOVER_ENTER_TIS = getTouchEventPatternTIS("ACTION_HOVER_ENTER");
- static final Pattern EVENT_HOVER_EXIT_TIS = getTouchEventPatternTIS("ACTION_HOVER_EXIT");
private static final Pattern EVENT_KEY_BACK_DOWN =
getKeyEventPattern("ACTION_DOWN", "KEYCODE_BACK");
@@ -142,9 +140,7 @@ public final class LauncherInstrumentation {
* Represents a point in the code at which a callback can run.
*/
public enum CALLBACK_RUN_POINT {
- CALLBACK_HOLD_BEFORE_DROP,
- CALLBACK_HOVER_ENTER,
- CALLBACK_HOVER_EXIT,
+ CALLBACK_HOLD_BEFORE_DROP
}
private Consumer<CALLBACK_RUN_POINT> mCallbackAtRunPoint = null;
@@ -1686,12 +1682,6 @@ public final class LauncherInstrumentation {
? EVENT_TOUCH_CANCEL_TIS : EVENT_TOUCH_UP_TIS);
}
break;
- case MotionEvent.ACTION_HOVER_ENTER:
- expectEvent(TestProtocol.SEQUENCE_TIS, EVENT_HOVER_ENTER_TIS);
- break;
- case MotionEvent.ACTION_HOVER_EXIT:
- expectEvent(TestProtocol.SEQUENCE_TIS, EVENT_HOVER_EXIT_TIS);
- break;
}
final MotionEvent event = getMotionEvent(downTime, currentTime, action, point.x, point.y);