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

Commit e5d9cc88 authored by Winson Chung's avatar Winson Chung
Browse files

Reset the frozen recents list state prior to test runs

- A quickswitch will freeze the spatial order of the recents list
  (to allow quickswitching back) for up to 5s, but this can affect
  runs of other tests due to the list being in the wrong order

Bug: 298544839
Test: atest NexusLauncherTests:com.android.quickstep.TaplTestsQuickstep
Change-Id: I5d01991821c6b79ceac47fefffed60ef4a18b248
parent 98128dc6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
    public static void initialize(
            AbstractLauncherUiTest test, boolean clearWorkspace) throws Exception {
        test.reinitializeLauncherData(clearWorkspace);
        test.mLauncher.resetFreezeRecentTaskList();
        test.mDevice.pressHome();
        test.waitForLauncherCondition("Launcher didn't start", launcher -> launcher != null);
        test.waitForState("Launcher internal state didn't switch to Home",
+11 −0
Original line number Diff line number Diff line
@@ -755,6 +755,17 @@ public final class LauncherInstrumentation {
        return isTablet() ? getLauncherPackageName() : SYSTEMUI_PACKAGE;
    }

    /**
     * Resets the frozen recent tasks list if necessary from a previous quickswitch.
     */
    public void resetFreezeRecentTaskList() {
        try {
            mDevice.executeShellCommand("wm reset-freeze-recent-tasks");
        } catch (IOException e) {
            Log.e(TAG, "Failed to reset fozen recent tasks list", e);
        }
    }

    private UiObject2 verifyContainerType(ContainerType containerType) {
        waitForLauncherInitialized();