Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d3d0d419 authored by Jean Chalard's avatar Jean Chalard Committed by Android Git Automerger
Browse files

am 41df8a98: Add a test case for backspace at start of line

* commit '41df8a98':
  Add a test case for backspace at start of line
parents c400482d 41df8a98
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -191,5 +191,17 @@ public class InputLogicTests extends ServiceTestCase<LatinIME> {
        type(STRING_TO_TYPE);
        type(Keyboard.CODE_DELETE);
        assertEquals("double space make a period", EXPECTED_RESULT, mTextView.getText().toString());

    public void testBackspaceAtStartAfterAutocorrect() {
        final String STRING_TO_TYPE = "tgis ";
        final String EXPECTED_RESULT = "this ";
        final int NEW_CURSOR_POSITION = 0;
        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 to start of line then backspace",
                EXPECTED_RESULT, mTextView.getText().toString());
    }
}