Ensure TestLauncher is actaully shown in goToOverviewFromHome

- The previous activity can be other test activity with same package name, the check should be more speciifc on the launcher activity itself

Bug: 223278795
Test: com.android.quickstep.FallbackRecentsTest#goToOverviewFromHome
Change-Id: Ie9b88fa0ee16a5b1aec23258b09ab2a22450ac38
This commit is contained in:
Alex Chau
2022-04-05 18:47:01 +01:00
parent d5d06190a7
commit 499723636d
@@ -79,6 +79,8 @@ import java.util.function.Function;
@RunWith(AndroidJUnit4.class)
public class FallbackRecentsTest {
private static final String FALLBACK_LAUNCHER_TITLE = "Test launcher";
private final UiDevice mDevice;
private final LauncherInstrumentation mLauncher;
private final ActivityInfo mOtherLauncherActivity;
@@ -169,7 +171,7 @@ public class FallbackRecentsTest {
public void goToOverviewFromHome() {
mDevice.pressHome();
assertTrue("Fallback Launcher not visible", mDevice.wait(Until.hasObject(By.pkg(
mOtherLauncherActivity.packageName)), WAIT_TIME_MS));
mOtherLauncherActivity.packageName).text(FALLBACK_LAUNCHER_TITLE)), WAIT_TIME_MS));
mLauncher.getLaunchedAppState().switchToOverview();
}
@@ -258,7 +260,7 @@ public class FallbackRecentsTest {
// Test dismissing all tasks.
pressHomeAndGoToOverview().dismissAllTasks();
assertTrue("Fallback Launcher not visible", TestHelpers.wait(Until.hasObject(By.pkg(
mOtherLauncherActivity.packageName)), WAIT_TIME_MS));
mOtherLauncherActivity.packageName).text(FALLBACK_LAUNCHER_TITLE)), WAIT_TIME_MS));
}
private int getCurrentOverviewPage(RecentsActivity recents) {