diff options
author | SeongJae Park <sj38.park@gmail.com> | 2013-02-03 03:55:39 +0900 |
---|---|---|
committer | SeongJae Park <sj38.park@gmail.com> | 2013-02-03 04:03:51 +0900 |
commit | d994e2dbe3586960b9a272a290aa8b973fa88e70 (patch) | |
tree | b3a395d26b647c18b667eb30533180fd25eaa59c | |
parent | 7e621830d02f68f10ff8bb2774bee203e602d72c (diff) | |
download | sdk-d994e2dbe3586960b9a272a290aa8b973fa88e70.zip sdk-d994e2dbe3586960b9a272a290aa8b973fa88e70.tar.gz sdk-d994e2dbe3586960b9a272a290aa8b973fa88e70.tar.bz2 |
monkeyrunner: Support MOVE event for touch
monkeyrunner support only drag, not MOVE type touch event.
Because drag event just drag from one point to another point, can't test
complex user touch event case(e.g., drawing curves or move icon at
launcher's homescreen).
This commit add support for MOVE touch event.
Change-Id: I9b2d5b2617d0c13cadbcfb63cd12007b9a9c0784
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
3 files changed, 7 insertions, 1 deletions
diff --git a/chimpchat/src/com/android/chimpchat/adb/AdbChimpDevice.java b/chimpchat/src/com/android/chimpchat/adb/AdbChimpDevice.java index 7c4b62a..200c69e 100644 --- a/chimpchat/src/com/android/chimpchat/adb/AdbChimpDevice.java +++ b/chimpchat/src/com/android/chimpchat/adb/AdbChimpDevice.java @@ -360,6 +360,9 @@ public class AdbChimpDevice implements IChimpDevice { case DOWN_AND_UP: manager.tap(x, y); break; + case MOVE: + manager.touchMove(x, y); + break; } } catch (IOException e) { LOG.log(Level.SEVERE, "Error sending touch event: " + x + " " + y + " " + type, e); diff --git a/chimpchat/src/com/android/chimpchat/core/TouchPressType.java b/chimpchat/src/com/android/chimpchat/core/TouchPressType.java index e5b92b7..7e1d4b6 100644 --- a/chimpchat/src/com/android/chimpchat/core/TouchPressType.java +++ b/chimpchat/src/com/android/chimpchat/core/TouchPressType.java @@ -23,7 +23,7 @@ import java.util.Map; * When passed as a string, the "identifier" value is used. */ public enum TouchPressType { - DOWN("down"), UP("up"), DOWN_AND_UP("downAndUp"); + DOWN("down"), UP("up"), DOWN_AND_UP("downAndUp"), MOVE("move"); private static final Map<String,TouchPressType> identifierToEnum = new HashMap<String,TouchPressType>(); diff --git a/monkeyrunner/src/com/android/monkeyrunner/MonkeyDevice.java b/monkeyrunner/src/com/android/monkeyrunner/MonkeyDevice.java index e60d12e..41e58f9 100644 --- a/monkeyrunner/src/com/android/monkeyrunner/MonkeyDevice.java +++ b/monkeyrunner/src/com/android/monkeyrunner/MonkeyDevice.java @@ -66,6 +66,9 @@ public class MonkeyDevice extends PyObject implements ClassDictInit { @MonkeyRunnerExported(doc = "Sends a DOWN event, immediately followed by an UP event when used with touch() or press()") public static final String DOWN_AND_UP = TouchPressType.DOWN_AND_UP.getIdentifier(); + @MonkeyRunnerExported(doc = "Sends a MOVE event when used with touch().") + public static final String MOVE = TouchPressType.MOVE.getIdentifier(); + private IChimpDevice impl; public MonkeyDevice(IChimpDevice impl) { |