Loading tests/src/com/android/inputmethod/latin/InputLogicTests.java +13 −0 Original line number Diff line number Diff line Loading @@ -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()); } } Loading
tests/src/com/android/inputmethod/latin/InputLogicTests.java +13 −0 Original line number Diff line number Diff line Loading @@ -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()); } }