diff options
author | 2013-02-25 23:25:30 -0800 | |
---|---|---|
committer | 2013-02-28 21:03:18 -0800 | |
commit | abaf5827e7a7f5f6c5d8d98e03e6b9528b0c9351 (patch) | |
tree | d21638871898f3a95af1e4d9a7be78c00524fc6f /tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java | |
parent | bc218dda8bd9395be0eec3836ed06fb27ce0968f (diff) | |
download | latinime-abaf5827e7a7f5f6c5d8d98e03e6b9528b0c9351.tar.gz latinime-abaf5827e7a7f5f6c5d8d98e03e6b9528b0c9351.tar.xz latinime-abaf5827e7a7f5f6c5d8d98e03e6b9528b0c9351.zip |
Separate suggestions from SuggestionView
This is a cleanup change, but it's also necessary for
Bug: 8152758
Change-Id: Id6ba06243f573fdb856f87d1df03277c9f2e5e71
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java b/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java index 005f8b279..333b60277 100644 --- a/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java +++ b/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java @@ -74,15 +74,22 @@ public class InputLogicTestsNonEnglish extends InputTestsBase { public void testWordThenSpaceDisplaysPredictions() { final String WORD_TO_TYPE = "beaujolais "; final String EXPECTED_RESULT = "nouveau"; - changeLanguage("fr"); - type(WORD_TO_TYPE); - sleep(DELAY_TO_WAIT_FOR_UNDERLINE); - runMessages(); - final SuggestionStripView suggestionStripView = - (SuggestionStripView)mInputView.findViewById(R.id.suggestion_strip_view); - final SuggestedWords suggestedWords = suggestionStripView.getSuggestions(); - assertEquals("type word then type space yields predictions for French", - EXPECTED_RESULT, suggestedWords.getWord(0)); + 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); + runMessages(); + assertEquals("type word then type space yields predictions for French", + EXPECTED_RESULT, mLatinIME.getFirstSuggestedWord()); + } finally { + setBooleanPreference(NEXT_WORD_PREDICTION_OPTION, previousNextWordPredictionOption, + defaultNextWordPredictionOption); + } } public void testAutoCorrectForGerman() { |