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

Commit 237f3a66 authored by Pat Manning's avatar Pat Manning
Browse files

Add test to check swiping from app to overview without unstashing taskbar.

Follow up to ag/24420598

Fix: 293419351
Test: TaplTestsTransientTaskbar.
Flag: ENABLE_CURSOR_HOVER_STATES
Change-Id: Id5c6b441f45e4e17baa29bc2e1de10a1863d754e
parent 7ef2d061
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -44,9 +44,7 @@ public class QuickstepTestInformationHandler extends TestInformationHandler {
            }

            case TestProtocol.REQUEST_BACKGROUND_TO_OVERVIEW_SWIPE_HEIGHT: {
                final float swipeHeight =
                        LayoutUtils.getShelfTrackingDistance(mContext, mDeviceProfile,
                                PagedOrientationHandler.PORTRAIT);
                final float swipeHeight = mDeviceProfile.heightPx / 2f;
                response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, (int) swipeHeight);
                return response;
            }
+16 −0
Original line number Diff line number Diff line
@@ -16,11 +16,13 @@

package com.android.quickstep;

import static com.android.launcher3.config.FeatureFlags.ENABLE_CURSOR_HOVER_STATES;
import static com.android.launcher3.testing.shared.TestProtocol.FLAKY_QUICK_SWITCH_TO_PREVIOUS_APP;
import static com.android.launcher3.ui.TaplTestsLauncher3.getAppPackageName;
import static com.android.launcher3.util.rule.TestStabilityRule.LOCAL;
import static com.android.launcher3.util.rule.TestStabilityRule.PLATFORM_POSTSUBMIT;
import static com.android.quickstep.TaskbarModeSwitchRule.Mode.PERSISTENT;
import static com.android.quickstep.TaskbarModeSwitchRule.Mode.TRANSIENT;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -50,6 +52,7 @@ import com.android.launcher3.tapl.OverviewTaskMenu;
import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
import com.android.launcher3.ui.TaplTestsLauncher3;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.TestUtil;
import com.android.launcher3.util.Wait;
import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord;
import com.android.launcher3.util.rule.TestStabilityRule;
@@ -242,6 +245,19 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
                isInState(() -> LauncherState.OVERVIEW));
    }

    @Test
    @TaskbarModeSwitch(mode = TRANSIENT)
    public void testSwitchToOverviewWithStashedTaskbar() throws Exception {
        try (AutoCloseable flag = TestUtil.overrideFlag(ENABLE_CURSOR_HOVER_STATES, true)) {
            startTestAppsWithCheck();
            // Set ignoreTaskbarVisibility, as transient taskbar will be stashed after app launch.
            mLauncher.setIgnoreTaskbarVisibility(true);
            mLauncher.getLaunchedAppState().switchToOverview();
        } finally {
            mLauncher.setIgnoreTaskbarVisibility(false);
        }
    }

    @Ignore
    @Test
    @NavigationModeSwitch
+1 −3
Original line number Diff line number Diff line
@@ -66,12 +66,10 @@ public class TaplTestsTransientTaskbar extends AbstractTaplTestsTaskbar {

    @Test
    @TaskbarModeSwitch(mode = TRANSIENT)
    public void testClickHoveredTaskbarToGoHome() {
    public void testClickHoveredTaskbarToGoHome() throws Exception {
        try (AutoCloseable flag = TestUtil.overrideFlag(ENABLE_CURSOR_HOVER_STATES, true)) {
            getTaskbar().getAppIcon(TEST_APP_NAME).launch(TEST_APP_PACKAGE);
            mLauncher.getLaunchedAppState().clickStashedTaskbarToGoHome();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}