From 6ecc69974b29941da92f9bd2300ae4b4d33b49f7 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Wed, 2 Mar 2022 19:07:38 +0000 Subject: [PATCH] Increase PromiseIconUiTest timeout temporarily - PromiseIcon installSession takes a long time to be created in certain device, incrase the timeout until b/222319304 is fixed Bug: 202985412 Test: labtest Change-Id: I51e6136b5a79e68f509745035206a6752f7318af --- .../android/launcher3/compat/PromiseIconUiTest.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/src/com/android/launcher3/compat/PromiseIconUiTest.java b/tests/src/com/android/launcher3/compat/PromiseIconUiTest.java index f34a29e9f8..92e3e64e4b 100644 --- a/tests/src/com/android/launcher3/compat/PromiseIconUiTest.java +++ b/tests/src/com/android/launcher3/compat/PromiseIconUiTest.java @@ -34,6 +34,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import java.util.UUID; +import java.util.concurrent.TimeUnit; /** @@ -44,6 +45,8 @@ import java.util.UUID; public class PromiseIconUiTest extends AbstractLauncherUiTest { private int mSessionId = -1; + // TODO(b/202985412): Revert to default timeout when PackageManager bug is fixed. + private static final long PROMISE_ICON_TIMEOUT = TimeUnit.SECONDS.toMillis(60); @Override public void setUp() throws Exception { @@ -85,7 +88,8 @@ public class PromiseIconUiTest extends AbstractLauncherUiTest { // Verify promise icon is added waitForLauncherCondition("Test Promise App not found on workspace", launcher -> - launcher.getWorkspace().getFirstMatch(findPromiseApp) != null); + launcher.getWorkspace().getFirstMatch(findPromiseApp) != null, + PROMISE_ICON_TIMEOUT); // Remove session mTargetContext.getPackageManager().getPackageInstaller().abandonSession(mSessionId); @@ -93,7 +97,8 @@ public class PromiseIconUiTest extends AbstractLauncherUiTest { // Verify promise icon is removed waitForLauncherCondition("Test Promise App not removed from workspace", launcher -> - launcher.getWorkspace().getFirstMatch(findPromiseApp) == null); + launcher.getWorkspace().getFirstMatch(findPromiseApp) == null, + PROMISE_ICON_TIMEOUT); } @Test @@ -111,6 +116,7 @@ public class PromiseIconUiTest extends AbstractLauncherUiTest { // Verify promise icon is not added waitForLauncherCondition("Test Promise App not found on workspace", launcher -> - launcher.getWorkspace().getFirstMatch(findPromiseApp) == null); + launcher.getWorkspace().getFirstMatch(findPromiseApp) == null, + PROMISE_ICON_TIMEOUT); } }