Slowing down gestures to get rid of flakiness
Change-Id: If36476e21629fba1a0cf26fb9d2c172097a9c0b5
This commit is contained in:
@@ -29,7 +29,7 @@ import com.android.launcher3.TestProtocol;
|
||||
public class AllApps extends LauncherInstrumentation.VisibleContainer {
|
||||
private static final int MAX_SCROLL_ATTEMPTS = 40;
|
||||
private static final int MIN_INTERACT_SIZE = 100;
|
||||
private static final int FLING_SPEED = 12000;
|
||||
private static final int FLING_SPEED = 3000;
|
||||
|
||||
private final int mHeight;
|
||||
|
||||
@@ -120,7 +120,7 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer {
|
||||
final UiObject2 allAppsContainer = verifyActiveContainer();
|
||||
// Start the gesture in the center to avoid starting at elements near the top.
|
||||
allAppsContainer.setGestureMargins(0, 0, 0, mHeight / 2);
|
||||
allAppsContainer.fling(Direction.DOWN, FLING_SPEED);
|
||||
allAppsContainer.fling(Direction.DOWN, (int) (FLING_SPEED * mLauncher.getDisplayDensity()));
|
||||
verifyActiveContainer();
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer {
|
||||
final UiObject2 allAppsContainer = verifyActiveContainer();
|
||||
// Start the gesture in the center, for symmetry with forward.
|
||||
allAppsContainer.setGestureMargins(0, mHeight / 2, 0, 0);
|
||||
allAppsContainer.fling(Direction.UP, FLING_SPEED);
|
||||
allAppsContainer.fling(Direction.UP, (int) (FLING_SPEED * mLauncher.getDisplayDensity()));
|
||||
verifyActiveContainer();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.util.List;
|
||||
* Common overview pane for both Launcher and fallback recents
|
||||
*/
|
||||
public class BaseOverview extends LauncherInstrumentation.VisibleContainer {
|
||||
private static final int DEFAULT_FLING_SPEED = 15000;
|
||||
private static final int FLING_SPEED = 1500;
|
||||
private static final int FLINGS_FOR_DISMISS_LIMIT = 5;
|
||||
|
||||
BaseOverview(LauncherInstrumentation launcher) {
|
||||
@@ -46,7 +46,7 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer {
|
||||
public void flingForward() {
|
||||
final UiObject2 overview = verifyActiveContainer();
|
||||
LauncherInstrumentation.log("Overview.flingForward before fling");
|
||||
overview.fling(Direction.LEFT, DEFAULT_FLING_SPEED);
|
||||
overview.fling(Direction.LEFT, (int) (FLING_SPEED * mLauncher.getDisplayDensity()));
|
||||
mLauncher.waitForIdle();
|
||||
verifyActiveContainer();
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer {
|
||||
public void flingBackward() {
|
||||
final UiObject2 overview = verifyActiveContainer();
|
||||
LauncherInstrumentation.log("Overview.flingBackward before fling");
|
||||
overview.fling(Direction.RIGHT, DEFAULT_FLING_SPEED);
|
||||
overview.fling(Direction.RIGHT, (int) (FLING_SPEED * mLauncher.getDisplayDensity()));
|
||||
mLauncher.waitForIdle();
|
||||
verifyActiveContainer();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import androidx.test.uiautomator.UiObject2;
|
||||
* All widgets container.
|
||||
*/
|
||||
public final class Widgets extends LauncherInstrumentation.VisibleContainer {
|
||||
private static final int FLING_SPEED = 6000;
|
||||
private static final int FLING_SPEED = 1500;
|
||||
|
||||
Widgets(LauncherInstrumentation launcher) {
|
||||
super(launcher);
|
||||
@@ -36,7 +36,7 @@ public final class Widgets extends LauncherInstrumentation.VisibleContainer {
|
||||
public void flingForward() {
|
||||
final UiObject2 widgetsContainer = verifyActiveContainer();
|
||||
widgetsContainer.setGestureMargin(100);
|
||||
widgetsContainer.fling(Direction.DOWN, FLING_SPEED);
|
||||
widgetsContainer.fling(Direction.DOWN, (int) (FLING_SPEED * mLauncher.getDisplayDensity()));
|
||||
verifyActiveContainer();
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public final class Widgets extends LauncherInstrumentation.VisibleContainer {
|
||||
public void flingBackward() {
|
||||
final UiObject2 widgetsContainer = verifyActiveContainer();
|
||||
widgetsContainer.setGestureMargin(100);
|
||||
widgetsContainer.fling(Direction.UP, FLING_SPEED);
|
||||
widgetsContainer.fling(Direction.UP, (int) (FLING_SPEED * mLauncher.getDisplayDensity()));
|
||||
mLauncher.waitForIdle();
|
||||
verifyActiveContainer();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user