Merge "Add test to check swiping from app to overview without unstashing taskbar." into main

This commit is contained in:
Pat Manning
2023-09-18 15:39:23 +00:00
committed by Android (Google) Code Review
3 changed files with 18 additions and 6 deletions
@@ -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,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
@@ -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);
}
}
}