aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/InputTestsBase.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-03-31 19:43:12 +0900
committerJean Chalard <jchalard@google.com>2014-04-14 21:28:24 +0900
commit2282e8520a2c1984989a14fb09896536f5033b26 (patch)
tree3c6cab5a8453fd0be24b89cd5f261da2ffb3abf1 /tests/src/com/android/inputmethod/latin/InputTestsBase.java
parent30d5ed67d6548a4d7efa6354d41ac9719a4e4488 (diff)
downloadlatinime-2282e8520a2c1984989a14fb09896536f5033b26.tar.gz
latinime-2282e8520a2c1984989a14fb09896536f5033b26.tar.xz
latinime-2282e8520a2c1984989a14fb09896536f5033b26.zip
Fix updating the shift state upon backspace
Bug: 13514349 Change-Id: If4c9db12b0ab5be676f7a2f72715f469066ee537
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/InputTestsBase.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/InputTestsBase.java20
1 files changed, 15 insertions, 5 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputTestsBase.java b/tests/src/com/android/inputmethod/latin/InputTestsBase.java
index e5f111ab6..260e534ee 100644
--- a/tests/src/com/android/inputmethod/latin/InputTestsBase.java
+++ b/tests/src/com/android/inputmethod/latin/InputTestsBase.java
@@ -254,7 +254,7 @@ public class InputTestsBase extends ServiceTestCase<LatinIMEForTests> {
}
// type(int) and type(String): helper methods to send a code point resp. a string to LatinIME.
- protected void type(final int codePoint) {
+ protected void typeInternal(final int codePoint, final boolean isKeyRepeat) {
// onPressKey and onReleaseKey are explicitly deactivated here, but they do happen in the
// code (although multitouch/slide input and other factors make the sequencing complicated).
// They are supposed to be entirely deconnected from the input logic from LatinIME point of
@@ -263,16 +263,26 @@ 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);
- if (key != null) {
+ if (key == null) {
+ mLatinIME.onCodeInput(codePoint, 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);
- return;
+ mLatinIME.onCodeInput(codePoint, x, y, isKeyRepeat);
}
- mLatinIME.onCodeInput(codePoint, Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE);
+ // Also see the comment at the top of this function about onReleaseKey
//mLatinIME.onReleaseKey(codePoint, false /* withSliding */);
}
+ protected void type(final int codePoint) {
+ typeInternal(codePoint, false /* isKeyRepeat */);
+ }
+
+ protected void repeatKey(final int codePoint) {
+ typeInternal(codePoint, true /* isKeyRepeat */);
+ }
+
protected void type(final String stringToType) {
for (int i = 0; i < stringToType.length(); i = stringToType.offsetByCodePoints(i, 1)) {
type(stringToType.codePointAt(i));