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

Commit 06344e79 authored by Vadim Tryshev's avatar Vadim Tryshev Committed by vadimt
Browse files

Slowing down workspace test fling

This will eliminate test flakiness

Test: tapl tests
Change-Id: I258f5e134771a93519fa1474ae09df3eac8a825f
parent 8fa51172
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -424,4 +424,8 @@ public final class LauncherInstrumentation {
        mInstrumentation.sendPointerSync(event);
        event.recycle();
    }

    float getDisplayDensity() {
        return mInstrumentation.getTargetContext().getResources().getDisplayMetrics().density;
    }
}
 No newline at end of file
+3 −2
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import androidx.test.uiautomator.UiObject2;
 * Operations on the workspace screen.
 */
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;

@@ -124,7 +125,7 @@ public final class Workspace extends Home {
     */
    public void flingForward() {
        final UiObject2 workspace = verifyActiveContainer();
        workspace.fling(Direction.RIGHT);
        workspace.fling(Direction.RIGHT, (int) (FLING_SPEED * mLauncher.getDisplayDensity()));
        mLauncher.waitForIdle();
        verifyActiveContainer();
    }
@@ -135,7 +136,7 @@ public final class Workspace extends Home {
     */
    public void flingBackward() {
        final UiObject2 workspace = verifyActiveContainer();
        workspace.fling(Direction.LEFT);
        workspace.fling(Direction.LEFT, (int) (FLING_SPEED * mLauncher.getDisplayDensity()));
        mLauncher.waitForIdle();
        verifyActiveContainer();
    }