More diagnostics for dragging failures in the lab, now for OOP tests

Bug: 129434166
Change-Id: I38b62ef74c0307f12ee85bbc05940400e9ba2302
This commit is contained in:
vadimt 2019-04-15 12:10:50 -07:00
parent b1303d57f7
commit 7d90c653d6
3 changed files with 12 additions and 0 deletions

View File

@ -111,6 +111,14 @@ public class TestInformationProvider extends ContentProvider {
response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, (int) distance);
break;
}
case TestProtocol.REQUEST_ENABLE_DRAG_LOGGING:
TestProtocol.sDebugTracing = true;
break;
case TestProtocol.REQUEST_DISABLE_DRAG_LOGGING:
TestProtocol.sDebugTracing = false;
break;
}
return response;
}

View File

@ -66,4 +66,6 @@ public final class TestProtocol {
public static boolean sDebugTracing = false;
public static final String NO_DRAG_TAG = "b/129434166";
public static final String REQUEST_ENABLE_DRAG_LOGGING = "enable-drag-logging";
public static final String REQUEST_DISABLE_DRAG_LOGGING = "disable-drag-logging";
}

View File

@ -138,6 +138,7 @@ public final class Workspace extends Home {
static void dragIconToWorkspace(
LauncherInstrumentation launcher, Launchable launchable, Point dest,
String longPressIndicator) {
launcher.getTestInfo(TestProtocol.REQUEST_ENABLE_DRAG_LOGGING);
LauncherInstrumentation.log("dragIconToWorkspace: begin");
final Point launchableCenter = launchable.getObject().getVisibleCenter();
final long downTime = SystemClock.uptimeMillis();
@ -148,6 +149,7 @@ public final class Workspace extends Home {
downTime, SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, dest);
LauncherInstrumentation.log("dragIconToWorkspace: end");
launcher.waitUntilGone("drop_target_bar");
launcher.getTestInfo(TestProtocol.REQUEST_DISABLE_DRAG_LOGGING);
}
/**