Merge "Fix flaky test" into main

This commit is contained in:
Jeremy Sim
2024-06-11 04:12:58 +00:00
committed by Android (Google) Code Review
5 changed files with 34 additions and 19 deletions
@@ -699,4 +699,11 @@ public abstract class AbstractLauncherUiTest<LAUNCHER_TYPE extends Launcher> {
UiDevice.getInstance(getInstrumentation()).pressHome();
mLauncher.waitForLauncherInitialized();
}
/** Clears all recent tasks */
protected void clearAllRecentTasks() {
if (!mLauncher.getRecentTasks().isEmpty()) {
mLauncher.goHome().switchToOverview().dismissAllTasks();
}
}
}