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
2023-12-31 13:33:51 -08:00
parent ff03dd19c7
commit b4ff22754a
2 changed files with 14 additions and 3 deletions

View File

@@ -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));
}

View File

@@ -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);
}