From 0a37f2b90edd431dea94c9c19036954af65afef4 Mon Sep 17 00:00:00 2001 From: Andras Kloczl Date: Wed, 7 Sep 2022 18:13:51 +0100 Subject: [PATCH] Trying to fix flaky TAPL test on CF For some reason the drag gesture gets canceled during drag, and it might be because the pointer goes out of bounds. Test: run TwoPanelWorkspaceTest on CF Bug: 241587421 Change-Id: I9a57548d5b03c3a3d7bd0da6e7e7f79688f5ac90 --- tests/tapl/com/android/launcher3/tapl/Workspace.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/tapl/com/android/launcher3/tapl/Workspace.java b/tests/tapl/com/android/launcher3/tapl/Workspace.java index 5fab7ebfea..2c9fdb357e 100644 --- a/tests/tapl/com/android/launcher3/tapl/Workspace.java +++ b/tests/tapl/com/android/launcher3/tapl/Workspace.java @@ -475,7 +475,9 @@ public final class Workspace extends Home { // Since the destination can be on another page, we need to drag to the edge first // until we reach the target page while (targetDest.x > displayX || targetDest.x < 0) { - int edgeX = targetDest.x > 0 ? displayX : 0; + // Don't drag all the way to the edge to prevent touch events from getting out of + //screen bounds. + int edgeX = targetDest.x > 0 ? displayX - 1 : 1; Point screenEdge = new Point(edgeX, targetDest.y); Point finalDragStart = dragStart; executeAndWaitForPageScroll(launcher,