From 1c5e0589d75b97caaa25dfbef91c1e3637b09168 Mon Sep 17 00:00:00 2001 From: Nataniel Borges Date: Tue, 26 Jul 2022 14:09:43 +0000 Subject: [PATCH] Stabilize quickswitch tests Previously the tests relied only on TAPL to know when the quick switch was over. However, this is not reliable since TAPL can't differentiate between the snapshot starting window and the app window, causing flickers. This Cl introduces the wait for the app window to be visible (and snapshot or splash screen not to be visible) to stabilize the test Bug: 240264838 Test: atest FlickerTests Change-Id: I44772a47a9fd0078ea4618f9c1523c2a23e07f14 --- .../wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsBackTest.kt | 1 + .../flicker/quickswitch/QuickSwitchBetweenTwoAppsForwardTest.kt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsBackTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsBackTest.kt index 386c0cb4f5414..a9fb0f261465c 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsBackTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsBackTest.kt @@ -83,6 +83,7 @@ open class QuickSwitchBetweenTwoAppsBackTest( transitions { tapl.launchedAppState.quickSwitchToPreviousApp() wmHelper.StateSyncBuilder() + .withFullScreenApp(testApp1) .withNavOrTaskBarVisible() .withStatusBarVisible() .waitForAndVerify() diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsForwardTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsForwardTest.kt index cefcb354ff5a0..3b602126399d9 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsForwardTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsForwardTest.kt @@ -79,6 +79,7 @@ open class QuickSwitchBetweenTwoAppsForwardTest( testApp2.launchViaIntent(wmHelper) tapl.launchedAppState.quickSwitchToPreviousApp() wmHelper.StateSyncBuilder() + .withFullScreenApp(testApp1) .withNavOrTaskBarVisible() .withStatusBarVisible() .waitForAndVerify() @@ -89,6 +90,7 @@ open class QuickSwitchBetweenTwoAppsForwardTest( transitions { tapl.launchedAppState.quickSwitchToPreviousAppSwipeLeft() wmHelper.StateSyncBuilder() + .withFullScreenApp(testApp2) .withNavOrTaskBarVisible() .withStatusBarVisible() .waitForAndVerify()