diff options
author | 2012-04-16 13:03:23 +0900 | |
---|---|---|
committer | 2012-04-16 18:34:30 +0900 | |
commit | 9f7392ea9d9313b276bda59ec488cd5f994c1894 (patch) | |
tree | 48a355edce492e83b91b3526dfe33209ee592332 /tests/src/com/android/inputmethod/latin/PunctuationTests.java | |
parent | a7352c8df48476ead4a469c89e2d976241e25589 (diff) | |
download | latinime-9f7392ea9d9313b276bda59ec488cd5f994c1894.tar.gz latinime-9f7392ea9d9313b276bda59ec488cd5f994c1894.tar.xz latinime-9f7392ea9d9313b276bda59ec488cd5f994c1894.zip |
Adjust a test for a new default setting
Bug: 6338940
Change-Id: I8f14ce0de768ddb0394eb2b584d8753e0df82a28
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/PunctuationTests.java')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/PunctuationTests.java | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/tests/src/com/android/inputmethod/latin/PunctuationTests.java b/tests/src/com/android/inputmethod/latin/PunctuationTests.java index 1b5b72ff8..b907970f0 100644 --- a/tests/src/com/android/inputmethod/latin/PunctuationTests.java +++ b/tests/src/com/android/inputmethod/latin/PunctuationTests.java @@ -16,21 +16,36 @@ package com.android.inputmethod.latin; +import com.android.inputmethod.latin.R; + public class PunctuationTests extends InputTestsBase { + final String NEXT_WORD_PREDICTION_OPTION = "next_word_prediction"; + public void testWordThenSpaceThenPunctuationFromStripTwice() { final String WORD_TO_TYPE = "this "; final String PUNCTUATION_FROM_STRIP = "!"; final String EXPECTED_RESULT = "this!! "; - type(WORD_TO_TYPE); - sleep(DELAY_TO_WAIT_FOR_UNDERLINE); - runMessages(); - assertTrue("type word then type space should display punctuation strip", - mLatinIME.isShowingPunctuationList()); - mLatinIME.pickSuggestionManually(0, PUNCTUATION_FROM_STRIP); - mLatinIME.pickSuggestionManually(0, PUNCTUATION_FROM_STRIP); - assertEquals("type word then type space then punctuation from strip twice", EXPECTED_RESULT, - mTextView.getText().toString()); + final boolean defaultNextWordPredictionOption = + mLatinIME.getResources().getBoolean(R.bool.config_default_next_word_suggestions); + final boolean previousNextWordPredictionOption = + setBooleanPreference(NEXT_WORD_PREDICTION_OPTION, false, + defaultNextWordPredictionOption); + try { + mLatinIME.loadSettings(); + type(WORD_TO_TYPE); + sleep(DELAY_TO_WAIT_FOR_UNDERLINE); + runMessages(); + assertTrue("type word then type space should display punctuation strip", + mLatinIME.isShowingPunctuationList()); + mLatinIME.pickSuggestionManually(0, PUNCTUATION_FROM_STRIP); + mLatinIME.pickSuggestionManually(0, PUNCTUATION_FROM_STRIP); + assertEquals("type word then type space then punctuation from strip twice", + EXPECTED_RESULT, mTextView.getText().toString()); + } finally { + setBooleanPreference(NEXT_WORD_PREDICTION_OPTION, previousNextWordPredictionOption, + defaultNextWordPredictionOption); + } } public void testWordThenSpaceThenPunctuationFromKeyboardTwice() { |