mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 23:36:47 +00:00
Merge "Send ACTION_UP if there is an exception" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
4d4c7e06eb
@@ -2055,11 +2055,14 @@ public final class LauncherInstrumentation {
|
||||
final long downTime = SystemClock.uptimeMillis();
|
||||
sendPointer(downTime, downTime, MotionEvent.ACTION_DOWN, targetCenter,
|
||||
GestureScope.DONT_EXPECT_PILFER);
|
||||
expectEvent(TestProtocol.SEQUENCE_MAIN, longClickEvent);
|
||||
final UiObject2 result = waitForLauncherObject(resName);
|
||||
sendPointer(downTime, SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, targetCenter,
|
||||
GestureScope.DONT_EXPECT_PILFER);
|
||||
return result;
|
||||
try {
|
||||
expectEvent(TestProtocol.SEQUENCE_MAIN, longClickEvent);
|
||||
final UiObject2 result = waitForLauncherObject(resName);
|
||||
return result;
|
||||
} finally {
|
||||
sendPointer(downTime, SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, targetCenter,
|
||||
GestureScope.DONT_EXPECT_PILFER);
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@@ -2070,12 +2073,15 @@ public final class LauncherInstrumentation {
|
||||
sendPointer(downTime, downTime, MotionEvent.ACTION_DOWN, targetCenter,
|
||||
GestureScope.DONT_EXPECT_PILFER, InputDevice.SOURCE_MOUSE,
|
||||
/* isRightClick= */ true);
|
||||
expectEvent(TestProtocol.SEQUENCE_MAIN, rightClickEvent);
|
||||
final UiObject2 result = waitForLauncherObject(resName);
|
||||
sendPointer(downTime, SystemClock.uptimeMillis(), ACTION_UP, targetCenter,
|
||||
GestureScope.DONT_EXPECT_PILFER, InputDevice.SOURCE_MOUSE,
|
||||
/* isRightClick= */ true);
|
||||
return result;
|
||||
try {
|
||||
expectEvent(TestProtocol.SEQUENCE_MAIN, rightClickEvent);
|
||||
final UiObject2 result = waitForLauncherObject(resName);
|
||||
return result;
|
||||
} finally {
|
||||
sendPointer(downTime, SystemClock.uptimeMillis(), ACTION_UP, targetCenter,
|
||||
GestureScope.DONT_EXPECT_PILFER, InputDevice.SOURCE_MOUSE,
|
||||
/* isRightClick= */ true);
|
||||
}
|
||||
}
|
||||
|
||||
private static int getSystemIntegerRes(Context context, String resName) {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package com.android.launcher3.tapl;
|
||||
|
||||
import static com.android.launcher3.tapl.Launchable.DEFAULT_DRAG_STEPS;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import android.graphics.Point;
|
||||
@@ -61,11 +62,14 @@ public class WidgetResizeFrame {
|
||||
final long downTime = SystemClock.uptimeMillis();
|
||||
mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_DOWN, targetStart,
|
||||
LauncherInstrumentation.GestureScope.DONT_EXPECT_PILFER);
|
||||
mLauncher.movePointer(targetStart, targetDest, DEFAULT_DRAG_STEPS,
|
||||
true, downTime, downTime, true,
|
||||
LauncherInstrumentation.GestureScope.DONT_EXPECT_PILFER);
|
||||
mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_UP, targetDest,
|
||||
LauncherInstrumentation.GestureScope.DONT_EXPECT_PILFER);
|
||||
try {
|
||||
mLauncher.movePointer(targetStart, targetDest, DEFAULT_DRAG_STEPS,
|
||||
true, downTime, downTime, true,
|
||||
LauncherInstrumentation.GestureScope.DONT_EXPECT_PILFER);
|
||||
} finally {
|
||||
mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_UP, targetDest,
|
||||
LauncherInstrumentation.GestureScope.DONT_EXPECT_PILFER);
|
||||
}
|
||||
|
||||
try (LauncherInstrumentation.Closable c2 = mLauncher.addContextLayer(
|
||||
"want to return resized widget resize frame")) {
|
||||
|
||||
Reference in New Issue
Block a user