diff options
author | 2013-09-30 18:02:49 -0700 | |
---|---|---|
committer | 2013-09-30 18:02:49 -0700 | |
commit | a0c9846fb99b65a6a4a578eba38f3d4b66056fed (patch) | |
tree | f654bf5c54a068d69402c485e7d59c6a4d6fbcf0 /tests/src | |
parent | cecb793ff36539f5938db764cad73d88fa399192 (diff) | |
parent | ceb364c0411dbcb38f2bd94f1d2b54eef3b985c1 (diff) | |
download | latinime-a0c9846fb99b65a6a4a578eba38f3d4b66056fed.tar.gz latinime-a0c9846fb99b65a6a4a578eba38f3d4b66056fed.tar.xz latinime-a0c9846fb99b65a6a4a578eba38f3d4b66056fed.zip |
am ceb364c0: Fix PrioritizedSerialExecutor.
* commit 'ceb364c0411dbcb38f2bd94f1d2b54eef3b985c1':
Fix PrioritizedSerialExecutor.
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java b/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java index d605cdb84..06c427193 100644 --- a/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java +++ b/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java @@ -84,29 +84,24 @@ public class UserHistoryDictionaryTests extends AndroidTestCase { } /** - * @param checksContents if true, checks whether written words are actually in the dictionary + * @param checkContents if true, checks whether written words are actually in the dictionary * or not. */ private void addAndWriteRandomWords(final String testFilenameSuffix, final int numberOfWords, - final Random random, final boolean checksContents) { + final Random random, final boolean checkContents) { final List<String> words = generateWords(numberOfWords, random); final UserHistoryPredictionDictionary dict = PersonalizationHelper.getUserHistoryPredictionDictionary(getContext(), testFilenameSuffix /* locale */, mPrefs); // Add random words to the user history dictionary. addToDict(dict, words); - if (checksContents) { + if (checkContents) { try { Thread.sleep(TimeUnit.MILLISECONDS.convert(5L, TimeUnit.SECONDS)); } catch (InterruptedException e) { } - // Limit word count to check when using a Java on memory dictionary. - final int wordCountToCheck = - ExpandableBinaryDictionary.ENABLE_BINARY_DICTIONARY_DYNAMIC_UPDATE ? - numberOfWords : 10; - for (int i = 0; i < wordCountToCheck; ++i) { + for (int i = 0; i < numberOfWords; ++i) { final String word = words.get(i); - // This may fail as long as we use tryLock on inserting the bigram words assertTrue(dict.isInDictionaryForTests(word)); } } |