diff options
author | 2015-03-04 23:08:09 +0000 | |
---|---|---|
committer | 2015-03-04 23:08:09 +0000 | |
commit | 5512a84d3ef8167666a289e63efee372934d0bbc (patch) | |
tree | 35c1edb6db91a097b3ff86e6619a88ff65333cac /tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java | |
parent | 34adcf999607d758ebcaf095afa2de8b48a7e581 (diff) | |
parent | 1ae16dc3db170802d1b38273f477125a2a969d32 (diff) | |
download | latinime-5512a84d3ef8167666a289e63efee372934d0bbc.tar.gz latinime-5512a84d3ef8167666a289e63efee372934d0bbc.tar.xz latinime-5512a84d3ef8167666a289e63efee372934d0bbc.zip |
am 1ae16dc3: Next-word suggestion bit in keyboard settings.
* commit '1ae16dc3db170802d1b38273f477125a2a969d32':
Next-word suggestion bit in keyboard settings.
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java | 55 |
1 files changed, 17 insertions, 38 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java b/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java index 3cfd0e2a6..fa39f31d4 100644 --- a/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java +++ b/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java @@ -23,7 +23,6 @@ import com.android.inputmethod.latin.settings.Settings; @LargeTest public class InputLogicTestsNonEnglish extends InputTestsBase { - final String NEXT_WORD_PREDICTION_OPTION = "next_word_prediction"; public void testAutoCorrectForFrench() { final String STRING_TO_TYPE = "irq "; @@ -63,48 +62,28 @@ public class InputLogicTestsNonEnglish extends InputTestsBase { final String WORD_TO_TYPE = "test "; final String PUNCTUATION_FROM_STRIP = "!"; final String EXPECTED_RESULT = "test !!"; - final boolean defaultNextWordPredictionOption = - mLatinIME.getResources().getBoolean(R.bool.config_default_next_word_prediction); - final boolean previousNextWordPredictionOption = - setBooleanPreference(NEXT_WORD_PREDICTION_OPTION, false, - defaultNextWordPredictionOption); - try { - changeLanguage("fr"); - type(WORD_TO_TYPE); - sleep(DELAY_TO_WAIT_FOR_UNDERLINE_MILLIS); - runMessages(); - assertTrue("type word then type space should display punctuation strip", - mLatinIME.getSuggestedWordsForTest().isPunctuationSuggestions()); - pickSuggestionManually(PUNCTUATION_FROM_STRIP); - pickSuggestionManually(PUNCTUATION_FROM_STRIP); - assertEquals("type word then type space then punctuation from strip twice for French", - EXPECTED_RESULT, mEditText.getText().toString()); - } finally { - setBooleanPreference(NEXT_WORD_PREDICTION_OPTION, previousNextWordPredictionOption, - defaultNextWordPredictionOption); - } + changeLanguage("fr"); + type(WORD_TO_TYPE); + sleep(DELAY_TO_WAIT_FOR_UNDERLINE_MILLIS); + runMessages(); + assertTrue("type word then type space should display punctuation strip", + mLatinIME.getSuggestedWordsForTest().isPunctuationSuggestions()); + pickSuggestionManually(PUNCTUATION_FROM_STRIP); + pickSuggestionManually(PUNCTUATION_FROM_STRIP); + assertEquals("type word then type space then punctuation from strip twice for French", + EXPECTED_RESULT, mEditText.getText().toString()); } public void testWordThenSpaceDisplaysPredictions() { final String WORD_TO_TYPE = "beaujolais "; final String EXPECTED_RESULT = "nouveau"; - final boolean defaultNextWordPredictionOption = - mLatinIME.getResources().getBoolean(R.bool.config_default_next_word_prediction); - final boolean previousNextWordPredictionOption = - setBooleanPreference(NEXT_WORD_PREDICTION_OPTION, true, - defaultNextWordPredictionOption); - try { - changeLanguage("fr"); - type(WORD_TO_TYPE); - sleep(DELAY_TO_WAIT_FOR_UNDERLINE_MILLIS); - runMessages(); - final SuggestedWords suggestedWords = mLatinIME.getSuggestedWordsForTest(); - assertEquals("type word then type space yields predictions for French", - EXPECTED_RESULT, suggestedWords.size() > 0 ? suggestedWords.getWord(0) : null); - } finally { - setBooleanPreference(NEXT_WORD_PREDICTION_OPTION, previousNextWordPredictionOption, - defaultNextWordPredictionOption); - } + changeLanguage("fr"); + type(WORD_TO_TYPE); + sleep(DELAY_TO_WAIT_FOR_UNDERLINE_MILLIS); + runMessages(); + final SuggestedWords suggestedWords = mLatinIME.getSuggestedWordsForTest(); + assertEquals("type word then type space yields predictions for French", + EXPECTED_RESULT, suggestedWords.size() > 0 ? suggestedWords.getWord(0) : null); } public void testAutoCorrectForGerman() { |