diff options
author | 2014-07-01 18:07:42 +0900 | |
---|---|---|
committer | 2014-07-01 18:19:11 +0900 | |
commit | fa4c59f9b6663e5de08692f853e968603dfc10e9 (patch) | |
tree | 1509efd98bffe415f5e5f1e8c6a0a0e4252d332c /tests/src/com/android/inputmethod/latin/InputLogicTests.java | |
parent | 943e91ffbd1edc88bcd815997f8b4d591d02dc7e (diff) | |
download | latinime-fa4c59f9b6663e5de08692f853e968603dfc10e9.tar.gz latinime-fa4c59f9b6663e5de08692f853e968603dfc10e9.tar.xz latinime-fa4c59f9b6663e5de08692f853e968603dfc10e9.zip |
Fix a unit test
When switching languages, we need to wait until the dictionary is
loaded to compute suggestions.
Change-Id: I7c32a900b297cd6302bfdc020842581315f3007f
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/InputLogicTests.java')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/InputLogicTests.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTests.java b/tests/src/com/android/inputmethod/latin/InputLogicTests.java index efb076fde..de9475af4 100644 --- a/tests/src/com/android/inputmethod/latin/InputLogicTests.java +++ b/tests/src/com/android/inputmethod/latin/InputLogicTests.java @@ -626,13 +626,17 @@ public class InputLogicTests extends InputTestsBase { public void testSwitchLanguages() { final String WORD_TO_TYPE_FIRST_PART = "com"; - final String WORD_TO_TYPE_SECOND_PART = "md "; - final String EXPECTED_RESULT = "comme "; + final String WORD_TO_TYPE_SECOND_PART = "md"; + final String EXPECTED_RESULT = "comme"; changeLanguage("en"); type(WORD_TO_TYPE_FIRST_PART); changeLanguage("fr"); + runMessages(); type(WORD_TO_TYPE_SECOND_PART); - assertEquals("Composing continues after switching languages", EXPECTED_RESULT, - mEditText.getText().toString()); + sleep(DELAY_TO_WAIT_FOR_UNDERLINE); + runMessages(); + final SuggestedWords suggestedWords = mLatinIME.getSuggestedWordsForTest(); + assertEquals("Suggestions updated after switching languages", + EXPECTED_RESULT, suggestedWords.size() > 0 ? suggestedWords.getWord(1) : null); } } |