Loading quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java +6 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,12 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { response.putParcelable(TestProtocol.TEST_INFO_RESPONSE_FIELD, gridTaskRect); return response; } case TestProtocol.REQUEST_GET_OVERVIEW_PAGE_SPACING: { response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, mDeviceProfile.overviewPageSpacing); return response; } } return super.call(method, arg); Loading quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +1 −1 Original line number Diff line number Diff line Loading @@ -345,7 +345,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { // Test opening the task. overview.getCurrentTask().open(); assertTrue("Test activity didn't open from Overview", mDevice.wait(Until.hasObject(By.pkg(getAppPackageName()).text("TestActivity8")), mDevice.wait(Until.hasObject(By.pkg(getAppPackageName()).text("TestActivity10")), DEFAULT_UI_TIMEOUT)); // Scroll the task offscreen as it is now first Loading src/com/android/launcher3/testing/TestProtocol.java +1 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,7 @@ public final class TestProtocol { "get-focused-task-height-for-tablet"; public static final String REQUEST_GET_GRID_TASK_SIZE_RECT_FOR_TABLET = "get-grid-task-size-rect-for-tablet"; public static final String REQUEST_GET_OVERVIEW_PAGE_SPACING = "get-overview-page-spacing"; public static final String REQUEST_ENABLE_ROTATION = "enable_rotation"; public static Long sForcePauseTimeout; Loading tests/tapl/com/android/launcher3/tapl/BaseOverview.java +2 −1 Original line number Diff line number Diff line Loading @@ -127,7 +127,8 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { OverviewTask task = getCurrentTask(); mLauncher.assertNotNull("current task is null", task); mLauncher.scrollLeftByDistance(verifyActiveContainer(), task.getVisibleWidth()); mLauncher.scrollLeftByDistance(verifyActiveContainer(), task.getVisibleWidth() + mLauncher.getOverviewPageSpacing()); try (LauncherInstrumentation.Closable c2 = mLauncher.addContextLayer("scrolled task off screen")) { Loading tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +8 −5 Original line number Diff line number Diff line Loading @@ -342,6 +342,11 @@ public final class LauncherInstrumentation { .getParcelable(TestProtocol.TEST_INFO_RESPONSE_FIELD)); } int getOverviewPageSpacing() { return getTestInfo(TestProtocol.REQUEST_GET_OVERVIEW_PAGE_SPACING) .getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); } float getExactScreenCenterX() { return getRealDisplaySize().x / 2f; } Loading Loading @@ -1323,14 +1328,12 @@ public final class LauncherInstrumentation { void scrollLeftByDistance(UiObject2 container, int distance) { final Rect containerRect = getVisibleBounds(container); final int rightGestureMarginInContainer = getRightGestureMarginInContainer(container); final int leftGestureMargin = getTargetInsets().left + getEdgeSensitivityWidth(); scroll( container, Direction.LEFT, new Rect( 0, containerRect.width() - distance - rightGestureMarginInContainer, 0, rightGestureMarginInContainer), new Rect(leftGestureMargin, 0, containerRect.width() - distance - rightGestureMarginInContainer, 0), 10, true); } Loading Loading
quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java +6 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,12 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { response.putParcelable(TestProtocol.TEST_INFO_RESPONSE_FIELD, gridTaskRect); return response; } case TestProtocol.REQUEST_GET_OVERVIEW_PAGE_SPACING: { response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, mDeviceProfile.overviewPageSpacing); return response; } } return super.call(method, arg); Loading
quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +1 −1 Original line number Diff line number Diff line Loading @@ -345,7 +345,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { // Test opening the task. overview.getCurrentTask().open(); assertTrue("Test activity didn't open from Overview", mDevice.wait(Until.hasObject(By.pkg(getAppPackageName()).text("TestActivity8")), mDevice.wait(Until.hasObject(By.pkg(getAppPackageName()).text("TestActivity10")), DEFAULT_UI_TIMEOUT)); // Scroll the task offscreen as it is now first Loading
src/com/android/launcher3/testing/TestProtocol.java +1 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,7 @@ public final class TestProtocol { "get-focused-task-height-for-tablet"; public static final String REQUEST_GET_GRID_TASK_SIZE_RECT_FOR_TABLET = "get-grid-task-size-rect-for-tablet"; public static final String REQUEST_GET_OVERVIEW_PAGE_SPACING = "get-overview-page-spacing"; public static final String REQUEST_ENABLE_ROTATION = "enable_rotation"; public static Long sForcePauseTimeout; Loading
tests/tapl/com/android/launcher3/tapl/BaseOverview.java +2 −1 Original line number Diff line number Diff line Loading @@ -127,7 +127,8 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { OverviewTask task = getCurrentTask(); mLauncher.assertNotNull("current task is null", task); mLauncher.scrollLeftByDistance(verifyActiveContainer(), task.getVisibleWidth()); mLauncher.scrollLeftByDistance(verifyActiveContainer(), task.getVisibleWidth() + mLauncher.getOverviewPageSpacing()); try (LauncherInstrumentation.Closable c2 = mLauncher.addContextLayer("scrolled task off screen")) { Loading
tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +8 −5 Original line number Diff line number Diff line Loading @@ -342,6 +342,11 @@ public final class LauncherInstrumentation { .getParcelable(TestProtocol.TEST_INFO_RESPONSE_FIELD)); } int getOverviewPageSpacing() { return getTestInfo(TestProtocol.REQUEST_GET_OVERVIEW_PAGE_SPACING) .getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); } float getExactScreenCenterX() { return getRealDisplaySize().x / 2f; } Loading Loading @@ -1323,14 +1328,12 @@ public final class LauncherInstrumentation { void scrollLeftByDistance(UiObject2 container, int distance) { final Rect containerRect = getVisibleBounds(container); final int rightGestureMarginInContainer = getRightGestureMarginInContainer(container); final int leftGestureMargin = getTargetInsets().left + getEdgeSensitivityWidth(); scroll( container, Direction.LEFT, new Rect( 0, containerRect.width() - distance - rightGestureMarginInContainer, 0, rightGestureMarginInContainer), new Rect(leftGestureMargin, 0, containerRect.width() - distance - rightGestureMarginInContainer, 0), 10, true); } Loading