Loading quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +0 −2 Original line number Diff line number Diff line Loading @@ -43,7 +43,6 @@ import com.android.quickstep.views.RecentsView; import org.junit.After; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; Loading Loading @@ -289,7 +288,6 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @Test @PortraitLandscape @Ignore("b/203781041") public void testOverviewForTablet() throws Exception { if (!mLauncher.isTablet()) { return; Loading tests/tapl/com/android/launcher3/tapl/BaseOverview.java +3 −7 Original line number Diff line number Diff line Loading @@ -54,18 +54,14 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { } private void flingForwardImpl() { flingForwardImpl(0); } private void flingForwardImpl(int rightMargin) { try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer("want to fling forward in overview")) { LauncherInstrumentation.log("Overview.flingForward before fling"); final UiObject2 overview = verifyActiveContainer(); final int leftMargin = mLauncher.getTargetInsets().left + mLauncher.getEdgeSensitivityWidth(); mLauncher.scroll(overview, Direction.LEFT, new Rect(leftMargin + 1, 0, rightMargin, 0), 20, false); mLauncher.scroll(overview, Direction.LEFT, new Rect(leftMargin + 1, 0, 0, 0), 20, false); try (LauncherInstrumentation.Closable c2 = mLauncher.addContextLayer("flung forwards")) { verifyActiveContainer(); Loading Loading @@ -131,7 +127,7 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { OverviewTask task = getCurrentTask(); mLauncher.assertNotNull("current task is null", task); flingForwardImpl(task.getTaskCenterX()); mLauncher.scrollLeftByDistance(verifyActiveContainer(), task.getVisibleWidth()); try (LauncherInstrumentation.Closable c2 = mLauncher.addContextLayer("scrolled task off screen")) { Loading tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +24 −0 Original line number Diff line number Diff line Loading @@ -1190,10 +1190,19 @@ public final class LauncherInstrumentation { return getVisibleBounds(container).bottom - bottomGestureStartOnScreen; } int getRightGestureMarginInContainer(UiObject2 container) { final int rightGestureStartOnScreen = getRightGestureStartOnScreen(); return getVisibleBounds(container).right - rightGestureStartOnScreen; } int getBottomGestureStartOnScreen() { return getRealDisplaySize().y - getBottomGestureSize(); } int getRightGestureStartOnScreen() { return getRealDisplaySize().x - getWindowInsets().right; } void clickLauncherObject(UiObject2 object) { waitForObjectEnabled(object, "clickLauncherObject"); expectEvent(TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_TOUCH_DOWN); Loading Loading @@ -1235,6 +1244,21 @@ public final class LauncherInstrumentation { true); } void scrollLeftByDistance(UiObject2 container, int distance) { final Rect containerRect = getVisibleBounds(container); final int rightGestureMarginInContainer = getRightGestureMarginInContainer(container); scroll( container, Direction.LEFT, new Rect( 0, containerRect.width() - distance - rightGestureMarginInContainer, 0, rightGestureMarginInContainer), 10, true); } void scroll( UiObject2 container, Direction direction, Rect margins, int steps, boolean slowDown) { final Rect rect = getVisibleBounds(container); Loading tests/tapl/com/android/launcher3/tapl/OverviewTask.java +4 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,10 @@ public final class OverviewTask { return mTask.getVisibleBounds().height(); } int getVisibleWidth() { return mTask.getVisibleBounds().width(); } int getTaskCenterX() { return mTask.getVisibleCenter().x; } Loading Loading
quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +0 −2 Original line number Diff line number Diff line Loading @@ -43,7 +43,6 @@ import com.android.quickstep.views.RecentsView; import org.junit.After; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; Loading Loading @@ -289,7 +288,6 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @Test @PortraitLandscape @Ignore("b/203781041") public void testOverviewForTablet() throws Exception { if (!mLauncher.isTablet()) { return; Loading
tests/tapl/com/android/launcher3/tapl/BaseOverview.java +3 −7 Original line number Diff line number Diff line Loading @@ -54,18 +54,14 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { } private void flingForwardImpl() { flingForwardImpl(0); } private void flingForwardImpl(int rightMargin) { try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer("want to fling forward in overview")) { LauncherInstrumentation.log("Overview.flingForward before fling"); final UiObject2 overview = verifyActiveContainer(); final int leftMargin = mLauncher.getTargetInsets().left + mLauncher.getEdgeSensitivityWidth(); mLauncher.scroll(overview, Direction.LEFT, new Rect(leftMargin + 1, 0, rightMargin, 0), 20, false); mLauncher.scroll(overview, Direction.LEFT, new Rect(leftMargin + 1, 0, 0, 0), 20, false); try (LauncherInstrumentation.Closable c2 = mLauncher.addContextLayer("flung forwards")) { verifyActiveContainer(); Loading Loading @@ -131,7 +127,7 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { OverviewTask task = getCurrentTask(); mLauncher.assertNotNull("current task is null", task); flingForwardImpl(task.getTaskCenterX()); mLauncher.scrollLeftByDistance(verifyActiveContainer(), task.getVisibleWidth()); try (LauncherInstrumentation.Closable c2 = mLauncher.addContextLayer("scrolled task off screen")) { Loading
tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +24 −0 Original line number Diff line number Diff line Loading @@ -1190,10 +1190,19 @@ public final class LauncherInstrumentation { return getVisibleBounds(container).bottom - bottomGestureStartOnScreen; } int getRightGestureMarginInContainer(UiObject2 container) { final int rightGestureStartOnScreen = getRightGestureStartOnScreen(); return getVisibleBounds(container).right - rightGestureStartOnScreen; } int getBottomGestureStartOnScreen() { return getRealDisplaySize().y - getBottomGestureSize(); } int getRightGestureStartOnScreen() { return getRealDisplaySize().x - getWindowInsets().right; } void clickLauncherObject(UiObject2 object) { waitForObjectEnabled(object, "clickLauncherObject"); expectEvent(TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_TOUCH_DOWN); Loading Loading @@ -1235,6 +1244,21 @@ public final class LauncherInstrumentation { true); } void scrollLeftByDistance(UiObject2 container, int distance) { final Rect containerRect = getVisibleBounds(container); final int rightGestureMarginInContainer = getRightGestureMarginInContainer(container); scroll( container, Direction.LEFT, new Rect( 0, containerRect.width() - distance - rightGestureMarginInContainer, 0, rightGestureMarginInContainer), 10, true); } void scroll( UiObject2 container, Direction direction, Rect margins, int steps, boolean slowDown) { final Rect rect = getVisibleBounds(container); Loading
tests/tapl/com/android/launcher3/tapl/OverviewTask.java +4 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,10 @@ public final class OverviewTask { return mTask.getVisibleBounds().height(); } int getVisibleWidth() { return mTask.getVisibleBounds().width(); } int getTaskCenterX() { return mTask.getVisibleCenter().x; } Loading