Loading quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java +7 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,13 @@ public class TaplTestsTaskbar extends AbstractTaplTestsTaskbar { .dragToSplitscreen(TEST_APP_PACKAGE, CALCULATOR_APP_PACKAGE); } @Test @PortraitLandscape public void testDismissAllAppsByTappingOutsideSheet() { getTaskbar().openAllApps().dismissByTappingOutsideForTablet(/* tapRight= */ true); getTaskbar().openAllApps().dismissByTappingOutsideForTablet(/* tapRight= */ false); } private boolean isTaskbarTestModeTransient() { return TRANSIENT == mTaskbarMode; } Loading tests/tapl/com/android/launcher3/tapl/AllApps.java +24 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,8 @@ public abstract class AllApps extends LauncherInstrumentation.VisibleContainer { private static final int MAX_SCROLL_ATTEMPTS = 40; private static final String BOTTOM_SHEET_RES_ID = "bottom_sheet_background"; private final int mHeight; private final int mIconHeight; Loading Loading @@ -337,6 +339,28 @@ public abstract class AllApps extends LauncherInstrumentation.VisibleContainer { return testInfo == null ? 0 : testInfo.getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); } /** * Taps outside bottom sheet to dismiss it. Available on tablets only. * @param tapRight Tap on the right of bottom sheet if true, or left otherwise. */ public void dismissByTappingOutsideForTablet(boolean tapRight) { mLauncher.assertTrue("Device must be a tablet", mLauncher.isTablet()); try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck(); LauncherInstrumentation.Closable c = mLauncher.addContextLayer( "want to tap outside AllApps bottom sheet on the " + (tapRight ? "right" : "left"))) { final UiObject2 allAppsBottomSheet = mLauncher.waitForLauncherObject(BOTTOM_SHEET_RES_ID); mLauncher.touchOutsideContainer(allAppsBottomSheet, tapRight); try (LauncherInstrumentation.Closable tapped = mLauncher.addContextLayer( "tapped outside AllApps bottom sheet")) { verifyVisibleContainerOnDismiss(); } } } protected abstract void verifyVisibleContainerOnDismiss(); /** * Return the QSB UI object on the AllApps screen. * @return the QSB UI object. Loading tests/tapl/com/android/launcher3/tapl/HomeAllApps.java +5 −20 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import androidx.test.uiautomator.UiObject2; import com.android.launcher3.testing.shared.TestProtocol; public class HomeAllApps extends AllApps { private static final String BOTTOM_SHEET_RES_ID = "bottom_sheet_background"; HomeAllApps(LauncherInstrumentation launcher) { super(launcher); Loading Loading @@ -98,25 +97,6 @@ public class HomeAllApps extends AllApps { .getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); } /** * Taps outside bottom sheet to dismiss and return to workspace. Available on tablets only. * @param tapRight Tap on the right of bottom sheet if true, or left otherwise. */ public Workspace dismissByTappingOutsideForTablet(boolean tapRight) { try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck(); LauncherInstrumentation.Closable c = mLauncher.addContextLayer( "want to tap outside AllApps bottom sheet on the " + (tapRight ? "right" : "left"))) { final UiObject2 allAppsBottomSheet = mLauncher.waitForLauncherObject(BOTTOM_SHEET_RES_ID); mLauncher.touchOutsideContainer(allAppsBottomSheet, tapRight); try (LauncherInstrumentation.Closable tapped = mLauncher.addContextLayer( "tapped outside AllApps bottom sheet")) { return mLauncher.getWorkspace(); } } } @NonNull @Override public Qsb getQsb() { Loading @@ -128,4 +108,9 @@ public class HomeAllApps extends AllApps { return mLauncher.getTestInfo(TestProtocol.REQUEST_APPS_LIST_SCROLL_Y) .getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); } @Override protected void verifyVisibleContainerOnDismiss() { mLauncher.getWorkspace(); } } tests/tapl/com/android/launcher3/tapl/TaskbarAllApps.java +5 −0 Original line number Diff line number Diff line Loading @@ -68,4 +68,9 @@ public class TaskbarAllApps extends AllApps { public TaskbarAllAppsQsb getQsb() { return new TaskbarAllAppsQsb(mLauncher, verifyActiveContainer()); } @Override protected void verifyVisibleContainerOnDismiss() { mLauncher.getLaunchedAppState().assertTaskbarVisible(); } } Loading
quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java +7 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,13 @@ public class TaplTestsTaskbar extends AbstractTaplTestsTaskbar { .dragToSplitscreen(TEST_APP_PACKAGE, CALCULATOR_APP_PACKAGE); } @Test @PortraitLandscape public void testDismissAllAppsByTappingOutsideSheet() { getTaskbar().openAllApps().dismissByTappingOutsideForTablet(/* tapRight= */ true); getTaskbar().openAllApps().dismissByTappingOutsideForTablet(/* tapRight= */ false); } private boolean isTaskbarTestModeTransient() { return TRANSIENT == mTaskbarMode; } Loading
tests/tapl/com/android/launcher3/tapl/AllApps.java +24 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,8 @@ public abstract class AllApps extends LauncherInstrumentation.VisibleContainer { private static final int MAX_SCROLL_ATTEMPTS = 40; private static final String BOTTOM_SHEET_RES_ID = "bottom_sheet_background"; private final int mHeight; private final int mIconHeight; Loading Loading @@ -337,6 +339,28 @@ public abstract class AllApps extends LauncherInstrumentation.VisibleContainer { return testInfo == null ? 0 : testInfo.getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); } /** * Taps outside bottom sheet to dismiss it. Available on tablets only. * @param tapRight Tap on the right of bottom sheet if true, or left otherwise. */ public void dismissByTappingOutsideForTablet(boolean tapRight) { mLauncher.assertTrue("Device must be a tablet", mLauncher.isTablet()); try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck(); LauncherInstrumentation.Closable c = mLauncher.addContextLayer( "want to tap outside AllApps bottom sheet on the " + (tapRight ? "right" : "left"))) { final UiObject2 allAppsBottomSheet = mLauncher.waitForLauncherObject(BOTTOM_SHEET_RES_ID); mLauncher.touchOutsideContainer(allAppsBottomSheet, tapRight); try (LauncherInstrumentation.Closable tapped = mLauncher.addContextLayer( "tapped outside AllApps bottom sheet")) { verifyVisibleContainerOnDismiss(); } } } protected abstract void verifyVisibleContainerOnDismiss(); /** * Return the QSB UI object on the AllApps screen. * @return the QSB UI object. Loading
tests/tapl/com/android/launcher3/tapl/HomeAllApps.java +5 −20 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import androidx.test.uiautomator.UiObject2; import com.android.launcher3.testing.shared.TestProtocol; public class HomeAllApps extends AllApps { private static final String BOTTOM_SHEET_RES_ID = "bottom_sheet_background"; HomeAllApps(LauncherInstrumentation launcher) { super(launcher); Loading Loading @@ -98,25 +97,6 @@ public class HomeAllApps extends AllApps { .getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); } /** * Taps outside bottom sheet to dismiss and return to workspace. Available on tablets only. * @param tapRight Tap on the right of bottom sheet if true, or left otherwise. */ public Workspace dismissByTappingOutsideForTablet(boolean tapRight) { try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck(); LauncherInstrumentation.Closable c = mLauncher.addContextLayer( "want to tap outside AllApps bottom sheet on the " + (tapRight ? "right" : "left"))) { final UiObject2 allAppsBottomSheet = mLauncher.waitForLauncherObject(BOTTOM_SHEET_RES_ID); mLauncher.touchOutsideContainer(allAppsBottomSheet, tapRight); try (LauncherInstrumentation.Closable tapped = mLauncher.addContextLayer( "tapped outside AllApps bottom sheet")) { return mLauncher.getWorkspace(); } } } @NonNull @Override public Qsb getQsb() { Loading @@ -128,4 +108,9 @@ public class HomeAllApps extends AllApps { return mLauncher.getTestInfo(TestProtocol.REQUEST_APPS_LIST_SCROLL_Y) .getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); } @Override protected void verifyVisibleContainerOnDismiss() { mLauncher.getWorkspace(); } }
tests/tapl/com/android/launcher3/tapl/TaskbarAllApps.java +5 −0 Original line number Diff line number Diff line Loading @@ -68,4 +68,9 @@ public class TaskbarAllApps extends AllApps { public TaskbarAllAppsQsb getQsb() { return new TaskbarAllAppsQsb(mLauncher, verifyActiveContainer()); } @Override protected void verifyVisibleContainerOnDismiss() { mLauncher.getLaunchedAppState().assertTaskbarVisible(); } }