aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/InputLogicTests.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-05-29 08:44:55 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-29 08:44:55 +0000
commit441ae6e8ef3b2e6838a95e00db3ef432ba197a1a (patch)
tree82905dca3c31cf10325f64347747adce8d6ff727 /tests/src/com/android/inputmethod/latin/InputLogicTests.java
parent28f1d1ead00838236893a81aa58ac877079c83a1 (diff)
parent944923f26660959bfc347c55b66f40de924d3068 (diff)
downloadlatinime-441ae6e8ef3b2e6838a95e00db3ef432ba197a1a.tar.gz
latinime-441ae6e8ef3b2e6838a95e00db3ef432ba197a1a.tar.xz
latinime-441ae6e8ef3b2e6838a95e00db3ef432ba197a1a.zip
am 944923f2: Fix: too many calls to getSuggestedWordsForTypingInput
* commit '944923f26660959bfc347c55b66f40de924d3068': Fix: too many calls to getSuggestedWordsForTypingInput
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/InputLogicTests.java')
-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);