diff options
author | 2013-09-28 12:50:09 +0900 | |
---|---|---|
committer | 2013-09-28 12:50:09 +0900 | |
commit | 5ed30a7660048ef4bf78077e77554c97786eae2b (patch) | |
tree | fe9a17cbd205c0d84c16e3eae239140a2d874384 /tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java | |
parent | 67cb282b6408b0924215835301b181eb0d1ecfe9 (diff) | |
download | latinime-5ed30a7660048ef4bf78077e77554c97786eae2b.tar.gz latinime-5ed30a7660048ef4bf78077e77554c97786eae2b.tar.xz latinime-5ed30a7660048ef4bf78077e77554c97786eae2b.zip |
Set header attributes for ExpandableBinaryDictionary.
Bug: 6669677
Change-Id: I2462777eaa07600f1c774226adfc4f351882f523
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java | 26 |
1 files changed, 13 insertions, 13 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..cf649c489 100644 --- a/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java +++ b/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java @@ -75,10 +75,10 @@ public class UserHistoryDictionaryTests extends AndroidTestCase { return new ArrayList<String>(wordSet); } - private void addToDict(final UserHistoryPredictionDictionary dict, final List<String> words) { + private void addToDict(final UserHistoryDictionary dict, final List<String> words) { String prevWord = null; for (String word : words) { - dict.addToPersonalizationPredictionDictionary(prevWord, word, true); + dict.addToDictionary(prevWord, word, true); prevWord = word; } } @@ -90,8 +90,8 @@ public class UserHistoryDictionaryTests extends AndroidTestCase { private void addAndWriteRandomWords(final String testFilenameSuffix, final int numberOfWords, final Random random, final boolean checksContents) { final List<String> words = generateWords(numberOfWords, random); - final UserHistoryPredictionDictionary dict = - PersonalizationHelper.getUserHistoryPredictionDictionary(getContext(), + final UserHistoryDictionary dict = + PersonalizationHelper.getUserHistoryDictionary(getContext(), testFilenameSuffix /* locale */, mPrefs); // Add random words to the user history dictionary. addToDict(dict, words); @@ -127,8 +127,8 @@ public class UserHistoryDictionaryTests extends AndroidTestCase { true /* checksContents */); } finally { try { - final UserHistoryPredictionDictionary dict = - PersonalizationHelper.getUserHistoryPredictionDictionary(getContext(), + final UserHistoryDictionary dict = + PersonalizationHelper.getUserHistoryDictionary(getContext(), testFilenameSuffix, mPrefs); Log.d(TAG, "waiting for writing ..."); dict.shutdownExecutorForTests(); @@ -139,7 +139,7 @@ public class UserHistoryDictionaryTests extends AndroidTestCase { Log.d(TAG, "InterruptedException: " + e); } - final String fileName = UserHistoryPredictionDictionary.NAME + "." + testFilenameSuffix + final String fileName = UserHistoryDictionary.NAME + "." + testFilenameSuffix + ExpandableBinaryDictionary.DICT_FILE_EXTENSION; dictFile = new File(getContext().getFilesDir(), fileName); @@ -164,7 +164,7 @@ public class UserHistoryDictionaryTests extends AndroidTestCase { // Create filename suffixes for this test. for (int i = 0; i < numberOfLanguages; i++) { testFilenameSuffixes[i] = "testSwitchingLanguages" + i; - final String fileName = UserHistoryPredictionDictionary.NAME + "." + + final String fileName = UserHistoryDictionary.NAME + "." + testFilenameSuffixes[i] + ExpandableBinaryDictionary.DICT_FILE_EXTENSION; dictFiles[i] = new File(getContext().getFilesDir(), fileName); } @@ -186,8 +186,8 @@ public class UserHistoryDictionaryTests extends AndroidTestCase { try { Log.d(TAG, "waiting for writing ..."); for (int i = 0; i < numberOfLanguages; i++) { - final UserHistoryPredictionDictionary dict = - PersonalizationHelper.getUserHistoryPredictionDictionary(getContext(), + final UserHistoryDictionary dict = + PersonalizationHelper.getUserHistoryDictionary(getContext(), testFilenameSuffixes[i], mPrefs); dict.shutdownExecutorForTests(); while (!dict.isTerminatedForTests()) { @@ -215,8 +215,8 @@ public class UserHistoryDictionaryTests extends AndroidTestCase { 10000 : 1000; final Random random = new Random(123456); - UserHistoryPredictionDictionary dict = - PersonalizationHelper.getUserHistoryPredictionDictionary(getContext(), + UserHistoryDictionary dict = + PersonalizationHelper.getUserHistoryDictionary(getContext(), testFilenameSuffix, mPrefs); try { addAndWriteRandomWords(testFilenameSuffix, numberOfWords, random, @@ -232,7 +232,7 @@ public class UserHistoryDictionaryTests extends AndroidTestCase { } catch (InterruptedException e) { Log.d(TAG, "InterruptedException: ", e); } - final String fileName = UserHistoryPredictionDictionary.NAME + "." + testFilenameSuffix + final String fileName = UserHistoryDictionary.NAME + "." + testFilenameSuffix + ExpandableBinaryDictionary.DICT_FILE_EXTENSION; dictFile = new File(getContext().getFilesDir(), fileName); if (dictFile != null) { |