Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Issue 2066683003: [Chromoting] Add InputInjector and InputInjectorWrapper for easy unittesting (Closed)

Created:
4 years, 6 months ago by Hzj_jie
Modified:
4 years, 6 months ago
CC:
chromium-reviews, chromoting-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Chromoting] Add InputStub and InputEventSender for easy unittesting Currently only TouchInputStrategy is testable with RemoteInputInjector. So this change adds InputStub, which is an interface to represent a set of low level functions to send users' activities to remote host machine. So one can use a MockInputStub to log down all the events which should be sent to remote host, and test the behavior of InputStrategyInterface(s) or other implementations. Meanwhile this change also adds an InputEventSender, which provides a set of shortcut functions to directly send Android events instead of raw JNI types. This change is part of Android Remote Desktop client refactor, a design doc is @ https://goo.gl/MA6zjx. BUG=615277 Committed: https://crrev.com/1a5aae1dd974c23bb6e990cccaa84eb648a02955 Cr-Commit-Position: refs/heads/master@{#401681}

Patch Set 1 #

Patch Set 2 : Add MockInputInjector & TouchEventBuilder, and use them in TouchInputStrategyTest #

Patch Set 3 : More strict assertions #

Patch Set 4 : Fix FindBugs errors #

Total comments: 56

Patch Set 5 : Resolve review comments #

Patch Set 6 : Suppress FindBugs warning of FE_FLOATING_POINT_EQUALITY #

Total comments: 30

Patch Set 7 : Resolve review comments #

Patch Set 8 : Resolve review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+941 lines, -527 lines) Patch
M remoting/android/BUILD.gn View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M remoting/android/client_java_tmpl.gni View 1 2 3 4 5 6 2 chunks +2 lines, -1 line 0 comments Download
M remoting/android/java/src/org/chromium/chromoting/Desktop.java View 1 2 3 4 5 6 6 chunks +5 lines, -92 lines 0 comments Download
M remoting/android/java/src/org/chromium/chromoting/DesktopView.java View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
A remoting/android/java/src/org/chromium/chromoting/InputEventSender.java View 1 2 3 4 5 6 7 1 chunk +226 lines, -0 lines 0 comments Download
A remoting/android/java/src/org/chromium/chromoting/InputStub.java View 1 2 3 4 5 6 1 chunk +44 lines, -0 lines 0 comments Download
M remoting/android/java/src/org/chromium/chromoting/SimulatedTouchInputStrategy.java View 1 2 3 4 5 6 6 chunks +14 lines, -20 lines 0 comments Download
M remoting/android/java/src/org/chromium/chromoting/TouchInputHandler.java View 1 2 3 4 5 6 8 chunks +16 lines, -20 lines 0 comments Download
D remoting/android/java/src/org/chromium/chromoting/TouchInputHandlerInterface.java View 1 chunk +0 lines, -34 lines 0 comments Download
M remoting/android/java/src/org/chromium/chromoting/TouchInputStrategy.java View 1 2 3 4 5 6 8 chunks +12 lines, -105 lines 0 comments Download
M remoting/android/java/src/org/chromium/chromoting/TrackpadInputStrategy.java View 1 2 3 4 5 6 4 chunks +14 lines, -18 lines 0 comments Download
M remoting/android/java/src/org/chromium/chromoting/cardboard/Cursor.java View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M remoting/android/java/src/org/chromium/chromoting/cardboard/DesktopActivity.java View 1 2 3 4 5 6 2 chunks +3 lines, -3 lines 0 comments Download
M remoting/android/java/src/org/chromium/chromoting/jni/Client.java View 1 2 3 4 5 6 2 chunks +2 lines, -1 line 0 comments Download
A remoting/android/javatests/src/org/chromium/chromoting/MockInputStub.java View 1 2 3 4 5 6 1 chunk +408 lines, -0 lines 0 comments Download
A remoting/android/javatests/src/org/chromium/chromoting/TouchEventBuilder.java View 1 2 3 4 5 6 1 chunk +96 lines, -0 lines 0 comments Download
M remoting/android/javatests/src/org/chromium/chromoting/TouchInputStrategyTest.java View 1 2 3 4 5 6 17 chunks +93 lines, -229 lines 0 comments Download

Messages

Total messages: 20 (9 generated)
Hzj_jie
4 years, 6 months ago (2016-06-16 00:22:34 UTC) #4
Lambros
https://codereview.chromium.org/2066683003/diff/80001/remoting/android/java/src/org/chromium/chromoting/Desktop.java File remoting/android/java/src/org/chromium/chromoting/Desktop.java (right): https://codereview.chromium.org/2066683003/diff/80001/remoting/android/java/src/org/chromium/chromoting/Desktop.java#newcode77 remoting/android/java/src/org/chromium/chromoting/Desktop.java:77: private Set<Integer> mPressedTextKeys = new TreeSet<Integer>(); Remove this, it's ...
4 years, 6 months ago (2016-06-17 23:00:11 UTC) #5
Hzj_jie
https://codereview.chromium.org/2066683003/diff/80001/remoting/android/java/src/org/chromium/chromoting/Desktop.java File remoting/android/java/src/org/chromium/chromoting/Desktop.java (right): https://codereview.chromium.org/2066683003/diff/80001/remoting/android/java/src/org/chromium/chromoting/Desktop.java#newcode77 remoting/android/java/src/org/chromium/chromoting/Desktop.java:77: private Set<Integer> mPressedTextKeys = new TreeSet<Integer>(); On 2016/06/17 23:00:09, ...
4 years, 6 months ago (2016-06-19 23:41:40 UTC) #6
Lambros
lgtm, just some tiny nits. https://codereview.chromium.org/2066683003/diff/120001/remoting/android/java/src/org/chromium/chromoting/InputInjectorWrapper.java File remoting/android/java/src/org/chromium/chromoting/InputInjectorWrapper.java (right): https://codereview.chromium.org/2066683003/diff/120001/remoting/android/java/src/org/chromium/chromoting/InputInjectorWrapper.java#newcode63 remoting/android/java/src/org/chromium/chromoting/InputInjectorWrapper.java:63: // TODO (zijiehe): This ...
4 years, 6 months ago (2016-06-22 01:43:15 UTC) #7
Sergey Ulanov
https://codereview.chromium.org/2066683003/diff/120001/remoting/android/java/src/org/chromium/chromoting/InputInjector.java File remoting/android/java/src/org/chromium/chromoting/InputInjector.java (right): https://codereview.chromium.org/2066683003/diff/120001/remoting/android/java/src/org/chromium/chromoting/InputInjector.java#newcode16 remoting/android/java/src/org/chromium/chromoting/InputInjector.java:16: public interface InputInjector { This name is confusing because ...
4 years, 6 months ago (2016-06-22 06:39:02 UTC) #9
Hzj_jie
https://codereview.chromium.org/2066683003/diff/120001/remoting/android/java/src/org/chromium/chromoting/InputInjector.java File remoting/android/java/src/org/chromium/chromoting/InputInjector.java (right): https://codereview.chromium.org/2066683003/diff/120001/remoting/android/java/src/org/chromium/chromoting/InputInjector.java#newcode16 remoting/android/java/src/org/chromium/chromoting/InputInjector.java:16: public interface InputInjector { On 2016/06/22 06:39:01, Sergey Ulanov ...
4 years, 6 months ago (2016-06-22 23:18:55 UTC) #10
Lambros
Still lgtm. Please update the CL description with the new names of the classes. https://codereview.chromium.org/2066683003/diff/120001/remoting/android/java/src/org/chromium/chromoting/InputInjectorWrapper.java ...
4 years, 6 months ago (2016-06-23 01:40:09 UTC) #12
Hzj_jie
https://codereview.chromium.org/2066683003/diff/120001/remoting/android/java/src/org/chromium/chromoting/InputInjectorWrapper.java File remoting/android/java/src/org/chromium/chromoting/InputInjectorWrapper.java (right): https://codereview.chromium.org/2066683003/diff/120001/remoting/android/java/src/org/chromium/chromoting/InputInjectorWrapper.java#newcode212 remoting/android/java/src/org/chromium/chromoting/InputInjectorWrapper.java:212: if (keyCodes != null && keyCodes.length > 0) { ...
4 years, 6 months ago (2016-06-23 18:03:24 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2066683003/160001
4 years, 6 months ago (2016-06-23 19:24:37 UTC) #16
commit-bot: I haz the power
Committed patchset #8 (id:160001)
4 years, 6 months ago (2016-06-23 19:30:12 UTC) #18
commit-bot: I haz the power
4 years, 6 months ago (2016-06-23 19:31:41 UTC) #20
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/1a5aae1dd974c23bb6e990cccaa84eb648a02955
Cr-Commit-Position: refs/heads/master@{#401681}

Powered by Google App Engine
This is Rietveld 408576698