Slowing down dismiss gesture to reduce flakiness

Change-Id: I13a1d2053e841994df537896c4fe397f68fa4a65
This commit is contained in:
Vadim Tryshev 2018-08-30 16:01:47 -07:00 committed by vadimt
parent cf50c1b01d
commit ceedc95d4c
1 changed files with 2 additions and 1 deletions

View File

@ -24,6 +24,7 @@ import androidx.test.uiautomator.Until;
* A recent task in the overview panel carousel.
*/
public final class OverviewTask {
static final int FLING_SPEED = 3000;
private final LauncherInstrumentation mLauncher;
private final UiObject2 mTask;
private final BaseOverview mOverview;
@ -45,7 +46,7 @@ public final class OverviewTask {
public void dismiss() {
verifyActiveContainer();
// Dismiss the task via flinging it up.
mTask.fling(Direction.DOWN);
mTask.fling(Direction.DOWN, (int) (FLING_SPEED * mLauncher.getDisplayDensity()));
mLauncher.waitForIdle();
}