Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ecc6997 authored by Alex Chau's avatar Alex Chau
Browse files

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
parent 2403b863
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -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);
    }
}