Skip to content

Commit 5c0bdbe

Browse files
author
Louis Chang
committed
Wait before asserts activity's removal
The finishing activity may not always be removed right after the top activity resumed. Bug: 309505574 Bug: 306375648 Test: atest ActivityStarterTests Change-Id: Idf9efeadbef6b75eed48aa75fd6c9d5496db3c00 Merged-In: Idf9efeadbef6b75eed48aa75fd6c9d5496db3c00
1 parent e150689 commit 5c0bdbe

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

tests/framework/base/windowmanager/src/android/server/wm/lifecycle/ActivityStarterTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,9 +684,8 @@ public void testActivityWithFinishOnTaskLaunch() {
684684
.execute();
685685
mWmState.waitForActivityState(STANDARD_ACTIVITY, STATE_RESUMED);
686686

687-
// Make sure the activity is finished.
688-
assertEquals("Instance of the activity in its task must be cleared", 0,
689-
mWmState.getActivityCountInTask(taskId, FINISH_ON_TASK_LAUNCH_ACTIVITY));
687+
// Make sure the activity is removed.
688+
mWmState.waitAndAssertActivityRemoved(FINISH_ON_TASK_LAUNCH_ACTIVITY);
690689
}
691690

692691
@Test

0 commit comments

Comments
 (0)