aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/InputLogicTestsLanguageWithoutSpaces.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2015-01-16 03:27:10 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-01-16 03:27:10 +0000
commita0b9e57af47bc20b6fedec802f4ada8c5b5ba8c5 (patch)
tree6bb8da2376fea33accccdf18a9c904cfcf24ccee /tests/src/com/android/inputmethod/latin/InputLogicTestsLanguageWithoutSpaces.java
parentc0f4d016f776039ff6d0c930c5e51a08b349943b (diff)
parent9fe700ec4fceba1e061733795bc89ca9d0620525 (diff)
downloadlatinime-a0b9e57af47bc20b6fedec802f4ada8c5b5ba8c5.tar.gz
latinime-a0b9e57af47bc20b6fedec802f4ada8c5b5ba8c5.tar.xz
latinime-a0b9e57af47bc20b6fedec802f4ada8c5b5ba8c5.zip
am 9fe700ec: Merge "Fix moving the cursor inside composition in lang w/o spaces"
* commit '9fe700ec4fceba1e061733795bc89ca9d0620525': Fix moving the cursor inside composition in lang w/o spaces
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/InputLogicTestsLanguageWithoutSpaces.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/InputLogicTestsLanguageWithoutSpaces.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTestsLanguageWithoutSpaces.java b/tests/src/com/android/inputmethod/latin/InputLogicTestsLanguageWithoutSpaces.java
index 6e6f551cc..12461c96e 100644
--- a/tests/src/com/android/inputmethod/latin/InputLogicTestsLanguageWithoutSpaces.java
+++ b/tests/src/com/android/inputmethod/latin/InputLogicTestsLanguageWithoutSpaces.java
@@ -89,6 +89,34 @@ public class InputLogicTestsLanguageWithoutSpaces extends InputTestsBase {
BaseInputConnection.getComposingSpanEnd(mEditText.getText()));
}
+ public void testMovingCursorInsideWordAndType() {
+ final String WORD_TO_TYPE = "abcdefgh";
+ final int typedLength = WORD_TO_TYPE.length();
+ final int CURSOR_POS = 4;
+ changeKeyboardLocaleAndDictLocale("th", "en_US");
+ type(WORD_TO_TYPE);
+ mLatinIME.onUpdateSelection(0, 0, typedLength, typedLength, 0, typedLength);
+ sleep(DELAY_TO_WAIT_FOR_PREDICTIONS_MILLIS);
+ runMessages();
+ mInputConnection.setSelection(CURSOR_POS, CURSOR_POS);
+ mLatinIME.onUpdateSelection(typedLength, typedLength,
+ CURSOR_POS, CURSOR_POS, 0, typedLength);
+ sleep(DELAY_TO_WAIT_FOR_PREDICTIONS_MILLIS);
+ runMessages();
+ assertEquals("move cursor inside text", 0,
+ BaseInputConnection.getComposingSpanStart(mEditText.getText()));
+ assertEquals("move cursor inside text", typedLength,
+ BaseInputConnection.getComposingSpanEnd(mEditText.getText()));
+ type("x");
+ sleep(DELAY_TO_WAIT_FOR_PREDICTIONS_MILLIS);
+ sleep(DELAY_TO_WAIT_FOR_PREDICTIONS_MILLIS);
+ runMessages();
+ assertEquals("start typing while cursor inside composition", CURSOR_POS,
+ BaseInputConnection.getComposingSpanStart(mEditText.getText()));
+ assertEquals("start typing while cursor inside composition", CURSOR_POS + 1,
+ BaseInputConnection.getComposingSpanEnd(mEditText.getText()));
+ }
+
public void testPredictions() {
final String WORD_TO_TYPE = "Barack ";
changeKeyboardLocaleAndDictLocale("th", "en_US");