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

Commit fe935dfb authored by Zak Cohen's avatar Zak Cohen
Browse files

TAPL test update - don't run all apps in overview tests with actions.

Overview actions removes the all apps from overview. Don't run the tests
that depend on these.
Ultimately need to add more tests for the actions.

Test: tapl local
Change-Id: I2471d10af7bc03a40a94f99aa16354b85bdb3ad7
parent 43a16157
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -3,8 +3,8 @@ package com.android.quickstep;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;

import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.testing.TestInformationHandler;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController;
@@ -64,6 +64,12 @@ public class QuickstepTestInformationHandler extends TestInformationHandler {
                        taskBaseIntentComponents);
                return response;
            }

            case TestProtocol.REQUEST_OVERVIEW_ACTIONS_ENABLED: {
                response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD,
                        FeatureFlags.ENABLE_OVERVIEW_ACTIONS.get());
                return response;
            }
        }

        return super.call(method);
+12 −2
Original line number Diff line number Diff line
@@ -81,6 +81,11 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {

    @Test
    public void testAllAppsFromOverview() throws Exception {
        // When actions are enabled, all apps isn't present in overview
        if (mLauncher.overviewActionsEnabled()) {
            return;
        }

        // Test opening all apps from Overview.
        assertNotNull("switchToAllApps() returned null",
                mLauncher.getWorkspace().switchToOverview().switchToAllApps());
@@ -141,8 +146,8 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
                launcher -> assertEquals("Dismissing a task didn't remove 1 task from Overview",
                        numTasks - 1, getTaskCount(launcher)));

        if (!TestHelpers.isInLauncherProcess() ||
                getFromLauncher(launcher -> !launcher.getDeviceProfile().isLandscape)) {
        if (!mLauncher.overviewActionsEnabled() && (!TestHelpers.isInLauncherProcess()
                || getFromLauncher(launcher -> !launcher.getDeviceProfile().isLandscape))) {
            // Test switching to all apps and back.
            final AllAppsFromOverview allApps = overview.switchToAllApps();
            assertNotNull("overview.switchToAllApps() returned null (1)", allApps);
@@ -185,6 +190,11 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {

    @Test
    public void testAppIconLaunchFromAllAppsFromOverview() throws Exception {
        // All apps doesn't exist in Overview when actions are enabled
        if (mLauncher.overviewActionsEnabled()) {
            return;
        }

        final AllApps allApps =
                mLauncher.getWorkspace().switchToOverview().switchToAllApps();
        assertTrue("Launcher internal state is not All Apps",
+2 −0
Original line number Diff line number Diff line
@@ -89,6 +89,8 @@ public final class TestProtocol {
    public static final String REQUEST_ENABLE_DEBUG_TRACING = "enable-debug-tracing";
    public static final String REQUEST_DISABLE_DEBUG_TRACING = "disable-debug-tracing";

    public static final String REQUEST_OVERVIEW_ACTIONS_ENABLED = "overview-actions-enabled";

    public static final String PERMANENT_DIAG_TAG = "TaplTarget";

    public static final String NO_BACKGROUND_TO_OVERVIEW_TAG = "b/138251824";
+6 −1
Original line number Diff line number Diff line
@@ -541,7 +541,7 @@ public final class LauncherInstrumentation {
                    return waitForLauncherObject(APPS_RES_ID);
                }
                case OVERVIEW: {
                    if (mDevice.isNaturalOrientation()) {
                    if (mDevice.isNaturalOrientation() && !overviewActionsEnabled()) {
                        waitForLauncherObject(APPS_RES_ID);
                    } else {
                        waitUntilGone(APPS_RES_ID);
@@ -1197,6 +1197,11 @@ public final class LauncherInstrumentation {
        getTestInfo(TestProtocol.REQUEST_ENABLE_DEBUG_TRACING);
    }

    public boolean overviewActionsEnabled() {
        return getTestInfo(TestProtocol.REQUEST_OVERVIEW_ACTIONS_ENABLED).getBoolean(
                TestProtocol.TEST_INFO_RESPONSE_FIELD);
    }

    public void disableDebugTracing() {
        getTestInfo(TestProtocol.REQUEST_DISABLE_DEBUG_TRACING);
    }