Merge "Improving a flakey uninstall from allapps test." into udc-dev am: 6598fab10c

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22478023

Change-Id: Ib75f5891693b54fea42292d37a1431a7930a3a57
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Andrew Cole
2023-04-05 20:36:10 +00:00
committed by Automerger Merge Worker
@@ -525,14 +525,8 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
try { try {
Workspace workspace = mLauncher.getWorkspace(); Workspace workspace = mLauncher.getWorkspace();
final HomeAllApps allApps = workspace.switchToAllApps(); final HomeAllApps allApps = workspace.switchToAllApps();
allApps.freeze(); workspace = allApps.getAppIcon(DUMMY_APP_NAME).uninstall();
try { waitForLauncherUIUpdate();
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();
}
verifyAppUninstalledFromAllApps(workspace, DUMMY_APP_NAME); verifyAppUninstalledFromAllApps(workspace, DUMMY_APP_NAME);
} finally { } finally {
TestUtil.uninstallDummyApp(); TestUtil.uninstallDummyApp();
@@ -633,6 +627,10 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
private void installDummyAppAndWaitForUIUpdate() throws IOException { private void installDummyAppAndWaitForUIUpdate() throws IOException {
TestUtil.installDummyApp(); TestUtil.installDummyApp();
waitForLauncherUIUpdate();
}
private void waitForLauncherUIUpdate() {
// Wait for model thread completion as it may be processing // Wait for model thread completion as it may be processing
// the install event from the SystemService // the install event from the SystemService
mLauncher.waitForModelQueueCleared(); mLauncher.waitForModelQueueCleared();