aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/BlueUnderlineTests.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-10-10 18:57:47 +0900
committerJean Chalard <jchalard@google.com>2012-10-10 19:42:29 +0900
commit2752287c425b9be87800136bd616ee63940caaac (patch)
treed03a31e671150c6f47762cc78f53b677bb6ed0b0 /tests/src/com/android/inputmethod/latin/BlueUnderlineTests.java
parent3873d36128c2066387bf9db90857cba0f67cb8a0 (diff)
downloadlatinime-2752287c425b9be87800136bd616ee63940caaac.tar.gz
latinime-2752287c425b9be87800136bd616ee63940caaac.tar.xz
latinime-2752287c425b9be87800136bd616ee63940caaac.zip
Fix failing tests.
Most of the failures can be ascribed to the tests not passing the correct old position of the cursor on a second call to onUpdateSelection() to LatinIME. Bug: 7276565 Bug: 7276805 Bug: 7276195 Change-Id: I3f1b52cdcc783ea18838408bed50699b7254eaf4
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/BlueUnderlineTests.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/BlueUnderlineTests.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/src/com/android/inputmethod/latin/BlueUnderlineTests.java b/tests/src/com/android/inputmethod/latin/BlueUnderlineTests.java
index a9947c1bd..2544bd87c 100644
--- a/tests/src/com/android/inputmethod/latin/BlueUnderlineTests.java
+++ b/tests/src/com/android/inputmethod/latin/BlueUnderlineTests.java
@@ -88,17 +88,19 @@ public class BlueUnderlineTests extends InputTestsBase {
public void testBlueUnderlineDisappearsWhenCursorMoved() {
final String STRING_TO_TYPE = "tgis";
+ final int typedLength = STRING_TO_TYPE.length();
final int NEW_CURSOR_POSITION = 0;
type(STRING_TO_TYPE);
sleep(DELAY_TO_WAIT_FOR_UNDERLINE);
// Simulate the onUpdateSelection() event
- mLatinIME.onUpdateSelection(0, 0, STRING_TO_TYPE.length(), STRING_TO_TYPE.length(), -1, -1);
+ mLatinIME.onUpdateSelection(0, 0, typedLength, typedLength, -1, -1);
runMessages();
// Here the blue underline has been set. testBlueUnderline() is testing for this already,
// so let's not test it here again.
// Now simulate the user moving the cursor.
mInputConnection.setSelection(NEW_CURSOR_POSITION, NEW_CURSOR_POSITION);
- mLatinIME.onUpdateSelection(0, 0, NEW_CURSOR_POSITION, NEW_CURSOR_POSITION, -1, -1);
+ mLatinIME.onUpdateSelection(typedLength, typedLength,
+ NEW_CURSOR_POSITION, NEW_CURSOR_POSITION, -1, -1);
sleep(DELAY_TO_WAIT_FOR_UNDERLINE);
runMessages();
final SpanGetter span = new SpanGetter(mTextView.getText(), SuggestionSpan.class);