diff options
author | 2013-09-27 00:58:49 -0700 | |
---|---|---|
committer | 2013-09-27 00:58:49 -0700 | |
commit | 1e886ac5b6b7b95a6aff63d00028349894bd209c (patch) | |
tree | 49ecb3b02092d13f6b7efd5eecb0073fcf41bbd4 /tests/src | |
parent | 704ab0f6aedbcfbea29cb5a37efa15faea0aa7ca (diff) | |
parent | a328f538c34ad2dafdfa53642085cb1072224d80 (diff) | |
download | latinime-1e886ac5b6b7b95a6aff63d00028349894bd209c.tar.gz latinime-1e886ac5b6b7b95a6aff63d00028349894bd209c.tar.xz latinime-1e886ac5b6b7b95a6aff63d00028349894bd209c.zip |
am a328f538: Fix PrioritizedSerialExecutor.
* commit 'a328f538c34ad2dafdfa53642085cb1072224d80':
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)); } } |