aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-05-29 15:43:40 +0900
committerJean Chalard <jchalard@google.com>2014-05-29 17:36:46 +0900
commit944923f26660959bfc347c55b66f40de924d3068 (patch)
treef00fe93dcb7d042e5f861a8699e249db62a6f406 /tests/src
parentb9a37752031499958e7ba58f093f41a81bdc156b (diff)
downloadlatinime-944923f26660959bfc347c55b66f40de924d3068.tar.gz
latinime-944923f26660959bfc347c55b66f40de924d3068.tar.xz
latinime-944923f26660959bfc347c55b66f40de924d3068.zip
Fix: too many calls to getSuggestedWordsForTypingInput
This reverts commit d941ea18 and builds on it to fix the behavior of the broken cases. It also fixes a small, related bug that probably has existed for a very long time: predictions not displayed when cancelling double-space-to-period. Bug: 15148015 Change-Id: I1f9358f8b6f5804f831643611576be347e83999d
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/com/android/inputmethod/latin/InputLogicTests.java21
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);