aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/inputmethod/latin/BlueUnderlineTests.java3
-rw-r--r--tests/src/com/android/inputmethod/latin/InputLogicTests.java6
2 files changed, 7 insertions, 2 deletions
diff --git a/tests/src/com/android/inputmethod/latin/BlueUnderlineTests.java b/tests/src/com/android/inputmethod/latin/BlueUnderlineTests.java
index c4fd5a0c4..cdd8f6b85 100644
--- a/tests/src/com/android/inputmethod/latin/BlueUnderlineTests.java
+++ b/tests/src/com/android/inputmethod/latin/BlueUnderlineTests.java
@@ -61,6 +61,7 @@ public class BlueUnderlineTests extends InputTestsBase {
public void testBlueUnderlineOnBackspace() {
final String STRING_TO_TYPE = "tgis";
+ final int typedLength = STRING_TO_TYPE.length();
final int EXPECTED_SUGGESTION_SPAN_START = -1;
final int EXPECTED_UNDERLINE_SPAN_START = 0;
final int EXPECTED_UNDERLINE_SPAN_END = 4;
@@ -68,6 +69,8 @@ public class BlueUnderlineTests extends InputTestsBase {
sleep(DELAY_TO_WAIT_FOR_UNDERLINE);
runMessages();
type(Constants.CODE_SPACE);
+ // typedLength + 1 because we also typed a space
+ mLatinIME.onUpdateSelection(0, 0, typedLength + 1, typedLength + 1, -1, -1);
sleep(DELAY_TO_WAIT_FOR_UNDERLINE);
runMessages();
type(Constants.CODE_DELETE);
diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTests.java b/tests/src/com/android/inputmethod/latin/InputLogicTests.java
index da8627aa3..039f581a7 100644
--- a/tests/src/com/android/inputmethod/latin/InputLogicTests.java
+++ b/tests/src/com/android/inputmethod/latin/InputLogicTests.java
@@ -307,12 +307,14 @@ public class InputLogicTests extends InputTestsBase {
}
public void testResumeSuggestionOnBackspace() {
- final String WORD_TO_TYPE = "and this ";
- type(WORD_TO_TYPE);
+ final String STRING_TO_TYPE = "and this ";
+ final int typedLength = STRING_TO_TYPE.length();
+ type(STRING_TO_TYPE);
assertEquals("resume suggestion on backspace", -1,
BaseInputConnection.getComposingSpanStart(mEditText.getText()));
assertEquals("resume suggestion on backspace", -1,
BaseInputConnection.getComposingSpanEnd(mEditText.getText()));
+ mLatinIME.onUpdateSelection(0, 0, typedLength, typedLength, -1, -1);
type(Constants.CODE_DELETE);
assertEquals("resume suggestion on backspace", 4,
BaseInputConnection.getComposingSpanStart(mEditText.getText()));