Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f806125f authored by vadimt's avatar vadimt
Browse files

TAPL: switching dismissing tasks to a model-time gesture

Change-Id: I4068c4102cd881b89b680c61699ba78832499a3d
parent 3bd876ba
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -692,7 +692,7 @@ public final class LauncherInstrumentation {

    // Inject a swipe gesture. Inject exactly 'steps' motion points, incrementing event time by a
    // fixed interval each time.
    private void linearGesture(int startX, int startY, int endX, int endY, int steps) {
    void linearGesture(int startX, int startY, int endX, int endY, int steps) {
        final long downTime = SystemClock.uptimeMillis();
        final Point start = new Point(startX, startY);
        final Point end = new Point(endX, endY);
+6 −3
Original line number Diff line number Diff line
@@ -16,7 +16,8 @@

package com.android.launcher3.tapl;

import androidx.test.uiautomator.Direction;
import android.graphics.Rect;

import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.Until;

@@ -26,7 +27,6 @@ import com.android.launcher3.testing.TestProtocol;
 * A recent task in the overview panel carousel.
 */
public final class OverviewTask {
    static final int FLING_SPEED = 3000;
    private static final long WAIT_TIME_MS = 60000;
    private final LauncherInstrumentation mLauncher;
    private final UiObject2 mTask;
@@ -51,7 +51,10 @@ public final class OverviewTask {
                "want to dismiss a task")) {
            verifyActiveContainer();
            // Dismiss the task via flinging it up.
            mTask.fling(Direction.DOWN, (int) (FLING_SPEED * mLauncher.getDisplayDensity()));
            final Rect taskBounds = mTask.getVisibleBounds();
            final int centerX = taskBounds.centerX();
            final int centerY = taskBounds.centerY();
            mLauncher.linearGesture(centerX, centerY, centerX, 0, 10);
            mLauncher.waitForIdle();
        }
    }