diff options
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/InputLogicTests.java')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/InputLogicTests.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTests.java b/tests/src/com/android/inputmethod/latin/InputLogicTests.java index a9444160f..460f600ac 100644 --- a/tests/src/com/android/inputmethod/latin/InputLogicTests.java +++ b/tests/src/com/android/inputmethod/latin/InputLogicTests.java @@ -481,6 +481,27 @@ public class InputLogicTests extends InputTestsBase { suggestedWords.size() > 0 ? suggestedWords.getWord(0) : null); } + public void testPredictionsWithDoubleSpaceToPeriod() { + final String WORD_TO_TYPE = "Barack "; + type(WORD_TO_TYPE); + sleep(DELAY_TO_WAIT_FOR_PREDICTIONS); + runMessages(); + // No need to test here, testPredictionsAfterSpace is testing it already + type(" "); + sleep(DELAY_TO_WAIT_FOR_PREDICTIONS); + runMessages(); + // Test the predictions have been cleared + SuggestedWords suggestedWords = mLatinIME.getSuggestedWordsForTest(); + assertEquals("predictions cleared after double-space-to-period", suggestedWords.size(), 0); + type(Constants.CODE_DELETE); + sleep(DELAY_TO_WAIT_FOR_PREDICTIONS); + runMessages(); + // Test the first prediction is displayed + suggestedWords = mLatinIME.getSuggestedWordsForTest(); + assertEquals("predictions after cancel double-space-to-period", "Obama", + suggestedWords.size() > 0 ? suggestedWords.getWord(0) : null); + } + public void testPredictionsAfterManualPick() { final String WORD_TO_TYPE = "Barack"; type(WORD_TO_TYPE); |