From 78e1461748dfde753c8181d93885c13f7e24b6e5 Mon Sep 17 00:00:00 2001 From: Andrew Cole Date: Wed, 5 Apr 2023 10:11:47 -0700 Subject: [PATCH] Improving a flakey uninstall from allapps test. Previously the test froze the all apps list before the uninstall action, but what we are testing here is that the all apps list does change. Also included is a small refactor to use the same wait method for this test and a second test. Test: Ran Locally on Device Bug: b/258071914 Change-Id: Ic18be39130fbd7b7e1214d6fc60c1afa30ddf078 --- .../android/launcher3/ui/TaplTestsLauncher3.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java index ae12861d30..f30538d408 100644 --- a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java +++ b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java @@ -525,14 +525,8 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { try { Workspace workspace = mLauncher.getWorkspace(); final HomeAllApps allApps = workspace.switchToAllApps(); - allApps.freeze(); - try { - workspace = allApps.getAppIcon(DUMMY_APP_NAME).uninstall(); - // After the toast clears, then the model tries to commit the uninstall transaction - mLauncher.waitForModelQueueCleared(); - } finally { - allApps.unfreeze(); - } + workspace = allApps.getAppIcon(DUMMY_APP_NAME).uninstall(); + waitForLauncherUIUpdate(); verifyAppUninstalledFromAllApps(workspace, DUMMY_APP_NAME); } finally { TestUtil.uninstallDummyApp(); @@ -633,6 +627,10 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { private void installDummyAppAndWaitForUIUpdate() throws IOException { TestUtil.installDummyApp(); + waitForLauncherUIUpdate(); + } + + private void waitForLauncherUIUpdate() { // Wait for model thread completion as it may be processing // the install event from the SystemService mLauncher.waitForModelQueueCleared();