summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2023-11-02 18:03:31 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2023-11-02 18:03:31 +0000
commit6966a125cd59babfaa080db123ac460cb56a4678 (patch)
treebb902faf38dfca51e268c03388210b2c8521cade
parent259c3aebe11744a87d8abee61a616b848e727fc2 (diff)
parent4bc14274811f738ac21ad6ec564896f5a1cbec56 (diff)
downloadcts-6966a125cd59babfaa080db123ac460cb56a4678.tar.gz
Merge "Fix ActivityVisibilityTests on auto with splitscreen." into android14-tests-dev
-rw-r--r--tests/framework/base/windowmanager/src/android/server/wm/ActivityVisibilityTests.java33
1 files changed, 29 insertions, 4 deletions
diff --git a/tests/framework/base/windowmanager/src/android/server/wm/ActivityVisibilityTests.java b/tests/framework/base/windowmanager/src/android/server/wm/ActivityVisibilityTests.java
index 1bc31c11a35..98f6a169930 100644
--- a/tests/framework/base/windowmanager/src/android/server/wm/ActivityVisibilityTests.java
+++ b/tests/framework/base/windowmanager/src/android/server/wm/ActivityVisibilityTests.java
@@ -210,6 +210,12 @@ public class ActivityVisibilityTests extends ActivityManagerTestBase {
testTurnScreenOnActivity(lockScreenSession, activityClient,
false /* useWindowFlags */);
+ // On Auto split-screen multi-tasking UI, testTurnScreenOnActivity() can lead to lifecycle
+ // state transitions in Home because of device sleep and also because of config change
+ // (b/308213530).
+ // Wait for the existing TurnScreenOnActivity to finish and the home activity to be in
+ // stopped state as the display is OFF.
+ mWmState.waitForAllStoppedActivities();
// Start TURN_SCREEN_ON_ACTIVITY
launchActivity(TURN_SCREEN_ON_ACTIVITY, WINDOWING_MODE_FULLSCREEN);
mWmState.assertVisibility(TURN_SCREEN_ON_ACTIVITY, true);
@@ -398,7 +404,10 @@ public class ActivityVisibilityTests extends ActivityManagerTestBase {
mBroadcastActionTrigger.finishBroadcastReceiverActivity();
mWmState.waitAndAssertActivityRemoved(BROADCAST_RECEIVER_ACTIVITY);
- mWmState.assertHomeActivityVisible(false);
+ if (!hasAutomotiveSplitscreenMultitaskingFeature()) {
+ // TODO(b/300009006): remove this if condition when root tasks setup is moved to SysUI.
+ mWmState.assertHomeActivityVisible(false);
+ }
}
@Test
@@ -621,7 +630,12 @@ public class ActivityVisibilityTests extends ActivityManagerTestBase {
launchActivity(TURN_SCREEN_ON_ATTR_ACTIVITY, WINDOWING_MODE_FULLSCREEN);
mWmState.assertVisibility(TURN_SCREEN_ON_ATTR_ACTIVITY, true);
assertTrue("Display turns on", isDisplayOn(DEFAULT_DISPLAY));
- assertSingleLaunch(TURN_SCREEN_ON_ATTR_ACTIVITY);
+ if (hasAutomotiveSplitscreenMultitaskingFeature()) {
+ // TODO(b/300009006): remove when root tasks setup is moved to SysUI.
+ waitAndAssertResumedActivity(TURN_SCREEN_ON_ATTR_ACTIVITY);
+ } else {
+ assertSingleLaunch(TURN_SCREEN_ON_ATTR_ACTIVITY);
+ }
}
@Test
@@ -678,7 +692,13 @@ public class ActivityVisibilityTests extends ActivityManagerTestBase {
launchActivity(TURN_SCREEN_ON_SHOW_ON_LOCK_ACTIVITY, WINDOWING_MODE_FULLSCREEN);
mWmState.assertVisibility(TURN_SCREEN_ON_SHOW_ON_LOCK_ACTIVITY, true);
assertTrue("Display turns on", isDisplayOn(DEFAULT_DISPLAY));
- assertSingleLaunch(TURN_SCREEN_ON_SHOW_ON_LOCK_ACTIVITY);
+
+ if (hasAutomotiveSplitscreenMultitaskingFeature()) {
+ // TODO(b/300009006): remove when root tasks setup is moved to SysUI.
+ waitAndAssertResumedActivity(TURN_SCREEN_ON_SHOW_ON_LOCK_ACTIVITY);
+ } else {
+ assertSingleLaunch(TURN_SCREEN_ON_SHOW_ON_LOCK_ACTIVITY);
+ }
}
@Test
@@ -736,7 +756,12 @@ public class ActivityVisibilityTests extends ActivityManagerTestBase {
mInstrumentation.getUiAutomation().syncInputTransactions();
mWmState.assertVisibility(TURN_SCREEN_ON_SINGLE_TASK_ACTIVITY, true);
assertTrue("Display turns on", isDisplayOn(DEFAULT_DISPLAY));
- assertSingleLaunch(TURN_SCREEN_ON_SINGLE_TASK_ACTIVITY);
+ if (hasAutomotiveSplitscreenMultitaskingFeature()) {
+ // TODO(b/300009006): remove when root tasks setup is moved to SysUI.
+ waitAndAssertResumedActivity(TURN_SCREEN_ON_SINGLE_TASK_ACTIVITY);
+ } else {
+ assertSingleLaunch(TURN_SCREEN_ON_SINGLE_TASK_ACTIVITY);
+ }
lockScreenSession.sleepDevice();
// We should make sure test activity stopped to prevent a false alarm stop state