Waiting for the state to settle after clear-all-tasks action

Bug: 313926097
Flag: N/A
Test: presubmit
Change-Id: Idbbf48d5814fa457b3542ff972bfb86d31f04377
This commit is contained in:
Vadim Tryshev committed 2023-12-31 18:36:20 -08:00
1 parent ff03dd19c7
commit b4ff22754a
2 files changed
+14 -3

No files matched your search

@@ -280,7 +280,6 @@ public class FallbackRecentsTest {
// Test dismissing all tasks.
pressHomeAndGoToOverview().dismissAllTasks();
waitForRecentsActivityStop(); // dismissAllTasks() will close Recents
assertTrue("Fallback Launcher not visible", TestHelpers.wait(Until.hasObject(By.pkg(
mOtherLauncherActivity.packageName).text(FALLBACK_LAUNCHER_TITLE)), WAIT_TIME_MS));
}
@@ -17,6 +17,7 @@
package com.android.launcher3.tapl;
import static com.android.launcher3.tapl.LauncherInstrumentation.TASKBAR_RES_ID;
import static com.android.launcher3.testing.shared.TestProtocol.NORMAL_STATE_ORDINAL;
import android.graphics.Rect;
@@ -128,8 +129,19 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer {
flingForwardImpl();
}
mLauncher.clickLauncherObject(
mLauncher.waitForObjectInContainer(verifyActiveContainer(), clearAllSelector));
final Runnable clickClearAll = () -> mLauncher.clickLauncherObject(
mLauncher.waitForObjectInContainer(verifyActiveContainer(),
clearAllSelector));
if (mLauncher.is3PLauncher()) {
mLauncher.executeAndWaitForLauncherStop(
clickClearAll,
"clicking 'Clear All'");
} else {
mLauncher.runToState(
clickClearAll,
NORMAL_STATE_ORDINAL,
"clicking 'Clear All'");
}
mLauncher.waitUntilLauncherObjectGone(clearAllSelector);
}