TAPL: add setIgnoreTaskbarVisibility in LauncherInstrumentation
As now FlickerTests is leveraging TAPL to interact devices CUJs,
we realized in LauncherInstrumentation will verify task bar visibility
automatically to expect it always visible when quick-switch, which is
not always reliable since the task bar may be hidden by manual or
when the activity requests to show IME.
Add setIgnoreTaskbarVisibility in LauncherInstrumentation for the caller
to ignore taskbar visibility if the test does not need to verify it.
Bug: 228012334
Bug: 240306344
Test: atest FlickerTests:SwitchImeWindowsFromGestureNavTest
in tablet device
Test: atest NexusLauncherOutOfProcTests:com.android.quickstep.\
TaplTestsQuickstep#testQuickSwitchToPreviousAppForTablet
Change-Id: Id0a35561523d733b8434acb702ec7dcaa466a1c2
This commit is contained in:
@@ -309,6 +309,28 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
|
||||
launchedAppState.switchToOverview();
|
||||
}
|
||||
|
||||
@Test
|
||||
@ScreenRecord // b/242163205
|
||||
public void testQuickSwitchToPreviousAppForTablet() throws Exception {
|
||||
assumeTrue(mLauncher.isTablet());
|
||||
startTestActivity(2);
|
||||
startImeTestActivity();
|
||||
|
||||
// Set ignoreTaskbarVisibility to true to verify the task bar visibility explicitly.
|
||||
mLauncher.setIgnoreTaskbarVisibility(true);
|
||||
|
||||
// Expect task bar invisible when the launched app was the IME activity.
|
||||
LaunchedAppState launchedAppState = getAndAssertLaunchedApp();
|
||||
launchedAppState.assertTaskbarHidden();
|
||||
|
||||
// Quick-switch to the test app with swiping to right.
|
||||
launchedAppState.quickSwitchToPreviousApp();
|
||||
|
||||
// Expect task bar visible when the launched app was the test activity.
|
||||
launchedAppState = getAndAssertLaunchedApp();
|
||||
launchedAppState.assertTaskbarVisible();
|
||||
}
|
||||
|
||||
private boolean isTestActivityRunning(int activityNumber) {
|
||||
return mDevice.wait(Until.hasObject(By.pkg(getAppPackageName())
|
||||
.text("TestActivity" + activityNumber)),
|
||||
|
||||
Reference in New Issue
Block a user