aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/InputLogicTests.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-01-25 22:46:41 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-01-25 22:46:41 -0800
commitb4464e61e731129d2d2fc01e4cb39fc8affd5331 (patch)
treec065364516204fde16de542e8b9bb5b40c1dd334 /tests/src/com/android/inputmethod/latin/InputLogicTests.java
parentd3d0d4196c83d9ff764bfe312ec8d1ee6c274a46 (diff)
parent9184d8b2352e11a25026ea9eed7f404836a7d476 (diff)
downloadlatinime-b4464e61e731129d2d2fc01e4cb39fc8affd5331.tar.gz
latinime-b4464e61e731129d2d2fc01e4cb39fc8affd5331.tar.xz
latinime-b4464e61e731129d2d2fc01e4cb39fc8affd5331.zip
am 9184d8b2: Add a test for moving cursor then backspace
* commit '9184d8b2352e11a25026ea9eed7f404836a7d476': Add a test for moving cursor then backspace
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/InputLogicTests.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/InputLogicTests.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTests.java b/tests/src/com/android/inputmethod/latin/InputLogicTests.java
index 8b4f64aa1..0e8c90130 100644
--- a/tests/src/com/android/inputmethod/latin/InputLogicTests.java
+++ b/tests/src/com/android/inputmethod/latin/InputLogicTests.java
@@ -204,4 +204,17 @@ public class InputLogicTests extends ServiceTestCase<LatinIME> {
assertEquals("auto correct then move curor to start of line then backspace",
EXPECTED_RESULT, mTextView.getText().toString());
}
+
+ public void testAutoCorrectThenMoveCursorThenBackspace() {
+ final String STRING_TO_TYPE = "and tgis ";
+ final String EXPECTED_RESULT = "andthis ";
+ final int NEW_CURSOR_POSITION = STRING_TO_TYPE.indexOf('t');
+ type(STRING_TO_TYPE);
+ mLatinIME.onUpdateSelection(0, 0, STRING_TO_TYPE.length(), STRING_TO_TYPE.length(), -1, -1);
+ mInputConnection.setSelection(NEW_CURSOR_POSITION, NEW_CURSOR_POSITION);
+ mLatinIME.onUpdateSelection(0, 0, NEW_CURSOR_POSITION, NEW_CURSOR_POSITION, -1, -1);
+ type(Keyboard.CODE_DELETE);
+ assertEquals("auto correct then move curor then backspace",
+ EXPECTED_RESULT, mTextView.getText().toString());
+ }
}