aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/InputTestsBase.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-08-06 17:38:47 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-08-06 17:38:47 +0000
commit09ae6b9119a5a86165738cba94ae40c059d9f600 (patch)
tree6fd21c40140680bba0ac330242fd0d105c28deaa /tests/src/com/android/inputmethod/latin/InputTestsBase.java
parentc01cc6b3b8e0dff31b6b17a87b21a629aea6703b (diff)
parent922411a70804921e69df0ef477f6b007e83d5692 (diff)
downloadlatinime-09ae6b9119a5a86165738cba94ae40c059d9f600.tar.gz
latinime-09ae6b9119a5a86165738cba94ae40c059d9f600.tar.xz
latinime-09ae6b9119a5a86165738cba94ae40c059d9f600.zip
am 922411a7: am ef74e737: Introduce onEvent() to improve testability
* commit '922411a70804921e69df0ef477f6b007e83d5692': Introduce onEvent() to improve testability
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/InputTestsBase.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/InputTestsBase.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputTestsBase.java b/tests/src/com/android/inputmethod/latin/InputTestsBase.java
index 986fb1097..18671fbe8 100644
--- a/tests/src/com/android/inputmethod/latin/InputTestsBase.java
+++ b/tests/src/com/android/inputmethod/latin/InputTestsBase.java
@@ -36,6 +36,7 @@ import android.widget.EditText;
import android.widget.FrameLayout;
import com.android.inputmethod.compat.InputMethodSubtypeCompatUtils;
+import com.android.inputmethod.event.Event;
import com.android.inputmethod.keyboard.Key;
import com.android.inputmethod.keyboard.Keyboard;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
@@ -263,14 +264,17 @@ public class InputTestsBase extends ServiceTestCase<LatinIMEForTests> {
// but keep them in mind if something breaks. Commenting them out as is should work.
//mLatinIME.onPressKey(codePoint, 0 /* repeatCount */, true /* isSinglePointer */);
final Key key = mKeyboard.getKey(codePoint);
+ final Event event;
if (key == null) {
- mLatinIME.onCodeInput(codePoint, Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE,
- isKeyRepeat);
+ event = Event.createSoftwareKeypressEvent(codePoint, Event.NOT_A_KEY_CODE,
+ Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE, isKeyRepeat);
} else {
final int x = key.getX() + key.getWidth() / 2;
final int y = key.getY() + key.getHeight() / 2;
- mLatinIME.onCodeInput(codePoint, x, y, isKeyRepeat);
+ event = Event.createSoftwareKeypressEvent(codePoint, Event.NOT_A_KEY_CODE,
+ x, y, isKeyRepeat);
}
+ mLatinIME.onEvent(event);
// Also see the comment at the top of this function about onReleaseKey
//mLatinIME.onReleaseKey(codePoint, false /* withSliding */);
}