Merge "Revert "Prevent dragging widgets to another page in tests when starting a drag."" into tm-qpr-dev

This commit is contained in:
Sebastián Franco
2022-09-16 16:49:26 +00:00
committed by Android (Google) Code Review
2 changed files with 8 additions and 4 deletions
@@ -35,6 +35,7 @@ import com.android.launcher3.tapl.Widget;
import com.android.launcher3.tapl.WidgetResizeFrame; import com.android.launcher3.tapl.WidgetResizeFrame;
import com.android.launcher3.ui.AbstractLauncherUiTest; import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.ui.TaplTestsLauncher3; import com.android.launcher3.ui.TaplTestsLauncher3;
import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord;
import com.android.launcher3.util.rule.ShellCommandRule; import com.android.launcher3.util.rule.ShellCommandRule;
import com.android.launcher3.views.DoubleShadowBubbleTextView; import com.android.launcher3.views.DoubleShadowBubbleTextView;
import com.android.launcher3.widget.LauncherAppWidgetHostView; import com.android.launcher3.widget.LauncherAppWidgetHostView;
@@ -145,22 +146,26 @@ public class ReorderWidgets extends AbstractLauncherUiTest {
runTestCase(testCaseMap.get(iconGridDimensions)); runTestCase(testCaseMap.get(iconGridDimensions));
} }
@ScreenRecord // b/242323136
@Test @Test
public void simpleReorder() throws ExecutionException, InterruptedException { public void simpleReorder() throws ExecutionException, InterruptedException {
runTestCaseMap(SimpleReorderCase.TEST_BY_GRID_SIZE, runTestCaseMap(SimpleReorderCase.TEST_BY_GRID_SIZE,
SimpleReorderCase.class.getSimpleName()); SimpleReorderCase.class.getSimpleName());
} }
@ScreenRecord // b/242323136
@Test @Test
public void pushTest() throws ExecutionException, InterruptedException { public void pushTest() throws ExecutionException, InterruptedException {
runTestCaseMap(PushReorderCase.TEST_BY_GRID_SIZE, PushReorderCase.class.getSimpleName()); runTestCaseMap(PushReorderCase.TEST_BY_GRID_SIZE, PushReorderCase.class.getSimpleName());
} }
@ScreenRecord // b/242323136
@Test @Test
public void fullReorder() throws ExecutionException, InterruptedException { public void fullReorder() throws ExecutionException, InterruptedException {
runTestCaseMap(FullReorderCase.TEST_BY_GRID_SIZE, FullReorderCase.class.getSimpleName()); runTestCaseMap(FullReorderCase.TEST_BY_GRID_SIZE, FullReorderCase.class.getSimpleName());
} }
@ScreenRecord // b/242323136
@Test @Test
public void moveOutReorder() throws ExecutionException, InterruptedException { public void moveOutReorder() throws ExecutionException, InterruptedException {
runTestCaseMap(MoveOutReorderCase.TEST_BY_GRID_SIZE, runTestCaseMap(MoveOutReorderCase.TEST_BY_GRID_SIZE,
@@ -85,10 +85,9 @@ public abstract class Launchable {
} }
Point startDrag(long downTime, Runnable expectLongClickEvents, boolean runToSpringLoadedState) { Point startDrag(long downTime, Runnable expectLongClickEvents, boolean runToSpringLoadedState) {
Point iconCenter = getObject().getVisibleCenter(); final Point iconCenter = getObject().getVisibleCenter();
final Point displaySize = mLauncher.getRealDisplaySize(); final Point dragStartCenter = new Point(iconCenter.x,
final Point dragStartCenter = new Point(displaySize.x / 2, iconCenter.y - getStartDragThreshold());
displaySize.y / 2 - getStartDragThreshold());
if (runToSpringLoadedState) { if (runToSpringLoadedState) {
mLauncher.runToState(() -> movePointerForStartDrag( mLauncher.runToState(() -> movePointerForStartDrag(