Loading quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java +2 −2 Original line number Diff line number Diff line Loading @@ -106,10 +106,10 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { }); return response; case TestProtocol.REQUEST_STASHED_TASKBAR_HEIGHT: { case TestProtocol.REQUEST_TASKBAR_FROM_NAV_THRESHOLD: { final Resources resources = mContext.getResources(); response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, resources.getDimensionPixelSize(R.dimen.taskbar_stashed_size)); resources.getDimensionPixelSize(R.dimen.taskbar_from_nav_threshold)); return response; } Loading quickstep/tests/src/com/android/quickstep/AbstractTaplTestsTaskbar.java +6 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import com.android.launcher3.util.LauncherLayoutBuilder; import com.android.launcher3.util.TestUtil; import org.junit.After; import org.junit.Assert; import org.junit.Assume; import java.util.List; Loading Loading @@ -86,6 +87,11 @@ public class AbstractTaplTestsTaskbar extends AbstractQuickStepTest { taskbarIconNames, hotseatIconNames); } if (!isTaskbarInTransientMode(mTargetContext)) { Assert.assertEquals("Persistent taskbar should fill screen width", taskbar.getVisibleBounds().width(), mLauncher.getRealDisplaySize().x); } return taskbar; } Loading quickstep/tests/src/com/android/quickstep/TaplTestsPersistentTaskbar.java +7 −13 Original line number Diff line number Diff line Loading @@ -20,9 +20,10 @@ import static com.android.quickstep.TaskbarModeSwitchRule.Mode.PERSISTENT; import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch; import com.android.quickstep.TaskbarModeSwitchRule.TaskbarModeSwitch; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; Loading @@ -32,17 +33,10 @@ public class TaplTestsPersistentTaskbar extends AbstractTaplTestsTaskbar { @Test @TaskbarModeSwitch(mode = PERSISTENT) public void testHideShowTaskbar() { getTaskbar().hide(); mLauncher.getLaunchedAppState().showTaskbar(); } @Test @TaskbarModeSwitch(mode = PERSISTENT) @Ignore // b/301575789 public void testHideTaskbarPersistsOnRecreate() { getTaskbar().hide(); mLauncher.recreateTaskbar(); mLauncher.getLaunchedAppState().assertTaskbarHidden(); @PortraitLandscape @NavigationModeSwitch public void testTaskbarFillsWidth() { // Width check is performed inside TAPL whenever getTaskbar() is called. getTaskbar(); } } quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +45 −21 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.quickstep; import static com.android.quickstep.TaskbarModeSwitchRule.Mode.PERSISTENT; import static com.android.quickstep.TaskbarModeSwitchRule.Mode.TRANSIENT; import static org.junit.Assert.assertEquals; Loading Loading @@ -298,7 +297,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @Test @ScreenRecord // b/242163205 @PlatinumTest(focusArea = "launcher") @TaskbarModeSwitch(mode = PERSISTENT) @TaskbarModeSwitch public void testQuickSwitchToPreviousAppForTablet() throws Exception { assumeTrue(mLauncher.isTablet()); startTestActivity(2); Loading @@ -307,6 +306,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { // Set ignoreTaskbarVisibility to true to verify the task bar visibility explicitly. mLauncher.setIgnoreTaskbarVisibility(true); try { // Expect task bar invisible when the launched app was the IME activity. LaunchedAppState launchedAppState = getAndAssertLaunchedApp(); launchedAppState.assertTaskbarHidden(); Loading @@ -316,10 +316,19 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { assertTestActivityIsRunning(2, "The first app we should have quick switched to is not running"); // Expect task bar visible when the launched app was the test activity. launchedAppState = getAndAssertLaunchedApp(); boolean isTransientTaskbar = mLauncher.isTransientTaskbar(); if (isTransientTaskbar) { launchedAppState.assertTaskbarHidden(); } else { // Expect taskbar visible when the launched app was the test activity. launchedAppState.assertTaskbarVisible(); } } finally { // Reset ignoreTaskbarVisibility to ensure other tests still verify it. mLauncher.setIgnoreTaskbarVisibility(false); } } @Test @NavigationModeSwitch Loading Loading @@ -354,7 +363,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @Test @PortraitLandscape @TaskbarModeSwitch(mode = PERSISTENT) @TaskbarModeSwitch() @PlatinumTest(focusArea = "launcher") @ScreenRecord public void testOverviewForTablet() throws Exception { Loading Loading @@ -449,6 +458,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @Test @PortraitLandscape @TaskbarModeSwitch public void testTaskbarDeadzonesForTablet() throws Exception { assumeTrue(mLauncher.isTablet()); Loading @@ -461,6 +471,19 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { launcher -> assertTrue("Should have at least 3 tasks", getTaskCount(launcher) >= 3)); if (mLauncher.isTransientTaskbar()) { // On transient taskbar, it should dismiss when tapping outside taskbar bounds. overview.touchTaskbarBottomCorner(/* tapRight= */ false); assertTrue("Launcher internal state should be Normal", isInState(() -> LauncherState.NORMAL)); overview = mLauncher.getWorkspace().switchToOverview(); // On transient taskbar, it should dismiss when tapping outside taskbar bounds. overview.touchTaskbarBottomCorner(/* tapRight= */ true); assertTrue("Launcher internal state should be Normal", isInState(() -> LauncherState.NORMAL)); } else { // On persistent taskbar, it should not dismiss when tapping the taskbar overview.touchTaskbarBottomCorner(/* tapRight= */ false); assertTrue("Launcher internal state should be Overview", Loading @@ -471,6 +494,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { assertTrue("Launcher internal state should be Overview", isInState(() -> LauncherState.OVERVIEW)); } } @Test public void testDisableRotationCheckForPhone() throws Exception { Loading quickstep/tests/src/com/android/quickstep/TaplTestsTransientTaskbar.java +9 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import static org.junit.Assume.assumeTrue; import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.quickstep.TaskbarModeSwitchRule.TaskbarModeSwitch; import org.junit.Test; Loading Loading @@ -64,4 +65,12 @@ public class TaplTestsTransientTaskbar extends AbstractTaplTestsTaskbar { getTaskbar().getAppIcon(TEST_APP_NAME).launch(TEST_APP_PACKAGE); mLauncher.getLaunchedAppState().clickStashedTaskbarToGoHome(); } @Test @TaskbarModeSwitch(mode = TRANSIENT) @PortraitLandscape public void testSwipeToStashAndUnstash() { getTaskbar().swipeDownToStash(); mLauncher.getLaunchedAppState().swipeUpToUnstashTaskbar(); } } Loading
quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java +2 −2 Original line number Diff line number Diff line Loading @@ -106,10 +106,10 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { }); return response; case TestProtocol.REQUEST_STASHED_TASKBAR_HEIGHT: { case TestProtocol.REQUEST_TASKBAR_FROM_NAV_THRESHOLD: { final Resources resources = mContext.getResources(); response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, resources.getDimensionPixelSize(R.dimen.taskbar_stashed_size)); resources.getDimensionPixelSize(R.dimen.taskbar_from_nav_threshold)); return response; } Loading
quickstep/tests/src/com/android/quickstep/AbstractTaplTestsTaskbar.java +6 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import com.android.launcher3.util.LauncherLayoutBuilder; import com.android.launcher3.util.TestUtil; import org.junit.After; import org.junit.Assert; import org.junit.Assume; import java.util.List; Loading Loading @@ -86,6 +87,11 @@ public class AbstractTaplTestsTaskbar extends AbstractQuickStepTest { taskbarIconNames, hotseatIconNames); } if (!isTaskbarInTransientMode(mTargetContext)) { Assert.assertEquals("Persistent taskbar should fill screen width", taskbar.getVisibleBounds().width(), mLauncher.getRealDisplaySize().x); } return taskbar; } Loading
quickstep/tests/src/com/android/quickstep/TaplTestsPersistentTaskbar.java +7 −13 Original line number Diff line number Diff line Loading @@ -20,9 +20,10 @@ import static com.android.quickstep.TaskbarModeSwitchRule.Mode.PERSISTENT; import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch; import com.android.quickstep.TaskbarModeSwitchRule.TaskbarModeSwitch; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; Loading @@ -32,17 +33,10 @@ public class TaplTestsPersistentTaskbar extends AbstractTaplTestsTaskbar { @Test @TaskbarModeSwitch(mode = PERSISTENT) public void testHideShowTaskbar() { getTaskbar().hide(); mLauncher.getLaunchedAppState().showTaskbar(); } @Test @TaskbarModeSwitch(mode = PERSISTENT) @Ignore // b/301575789 public void testHideTaskbarPersistsOnRecreate() { getTaskbar().hide(); mLauncher.recreateTaskbar(); mLauncher.getLaunchedAppState().assertTaskbarHidden(); @PortraitLandscape @NavigationModeSwitch public void testTaskbarFillsWidth() { // Width check is performed inside TAPL whenever getTaskbar() is called. getTaskbar(); } }
quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +45 −21 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.quickstep; import static com.android.quickstep.TaskbarModeSwitchRule.Mode.PERSISTENT; import static com.android.quickstep.TaskbarModeSwitchRule.Mode.TRANSIENT; import static org.junit.Assert.assertEquals; Loading Loading @@ -298,7 +297,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @Test @ScreenRecord // b/242163205 @PlatinumTest(focusArea = "launcher") @TaskbarModeSwitch(mode = PERSISTENT) @TaskbarModeSwitch public void testQuickSwitchToPreviousAppForTablet() throws Exception { assumeTrue(mLauncher.isTablet()); startTestActivity(2); Loading @@ -307,6 +306,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { // Set ignoreTaskbarVisibility to true to verify the task bar visibility explicitly. mLauncher.setIgnoreTaskbarVisibility(true); try { // Expect task bar invisible when the launched app was the IME activity. LaunchedAppState launchedAppState = getAndAssertLaunchedApp(); launchedAppState.assertTaskbarHidden(); Loading @@ -316,10 +316,19 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { assertTestActivityIsRunning(2, "The first app we should have quick switched to is not running"); // Expect task bar visible when the launched app was the test activity. launchedAppState = getAndAssertLaunchedApp(); boolean isTransientTaskbar = mLauncher.isTransientTaskbar(); if (isTransientTaskbar) { launchedAppState.assertTaskbarHidden(); } else { // Expect taskbar visible when the launched app was the test activity. launchedAppState.assertTaskbarVisible(); } } finally { // Reset ignoreTaskbarVisibility to ensure other tests still verify it. mLauncher.setIgnoreTaskbarVisibility(false); } } @Test @NavigationModeSwitch Loading Loading @@ -354,7 +363,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @Test @PortraitLandscape @TaskbarModeSwitch(mode = PERSISTENT) @TaskbarModeSwitch() @PlatinumTest(focusArea = "launcher") @ScreenRecord public void testOverviewForTablet() throws Exception { Loading Loading @@ -449,6 +458,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @Test @PortraitLandscape @TaskbarModeSwitch public void testTaskbarDeadzonesForTablet() throws Exception { assumeTrue(mLauncher.isTablet()); Loading @@ -461,6 +471,19 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { launcher -> assertTrue("Should have at least 3 tasks", getTaskCount(launcher) >= 3)); if (mLauncher.isTransientTaskbar()) { // On transient taskbar, it should dismiss when tapping outside taskbar bounds. overview.touchTaskbarBottomCorner(/* tapRight= */ false); assertTrue("Launcher internal state should be Normal", isInState(() -> LauncherState.NORMAL)); overview = mLauncher.getWorkspace().switchToOverview(); // On transient taskbar, it should dismiss when tapping outside taskbar bounds. overview.touchTaskbarBottomCorner(/* tapRight= */ true); assertTrue("Launcher internal state should be Normal", isInState(() -> LauncherState.NORMAL)); } else { // On persistent taskbar, it should not dismiss when tapping the taskbar overview.touchTaskbarBottomCorner(/* tapRight= */ false); assertTrue("Launcher internal state should be Overview", Loading @@ -471,6 +494,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { assertTrue("Launcher internal state should be Overview", isInState(() -> LauncherState.OVERVIEW)); } } @Test public void testDisableRotationCheckForPhone() throws Exception { Loading
quickstep/tests/src/com/android/quickstep/TaplTestsTransientTaskbar.java +9 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import static org.junit.Assume.assumeTrue; import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.quickstep.TaskbarModeSwitchRule.TaskbarModeSwitch; import org.junit.Test; Loading Loading @@ -64,4 +65,12 @@ public class TaplTestsTransientTaskbar extends AbstractTaplTestsTaskbar { getTaskbar().getAppIcon(TEST_APP_NAME).launch(TEST_APP_PACKAGE); mLauncher.getLaunchedAppState().clickStashedTaskbarToGoHome(); } @Test @TaskbarModeSwitch(mode = TRANSIENT) @PortraitLandscape public void testSwipeToStashAndUnstash() { getTaskbar().swipeDownToStash(); mLauncher.getLaunchedAppState().swipeUpToUnstashTaskbar(); } }