diff options
author | 2013-10-01 05:23:13 -0700 | |
---|---|---|
committer | 2013-10-01 05:23:13 -0700 | |
commit | 1ef00b28a58fe175c721f4b4c04aa903d6e45280 (patch) | |
tree | 77f2ddf49d14d458dc9f9e726ec14381204109df /tests/src | |
parent | 3b3cb4fe56e3d9feb9d21952658ec898843e1e47 (diff) | |
parent | ceb364c0411dbcb38f2bd94f1d2b54eef3b985c1 (diff) | |
download | latinime-1ef00b28a58fe175c721f4b4c04aa903d6e45280.tar.gz latinime-1ef00b28a58fe175c721f4b4c04aa903d6e45280.tar.xz latinime-1ef00b28a58fe175c721f4b4c04aa903d6e45280.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)); } } |