diff options
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/SuggestHelper.java | 6 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/SuggestTestsBase.java | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/tests/src/com/android/inputmethod/latin/SuggestHelper.java b/tests/src/com/android/inputmethod/latin/SuggestHelper.java index 06b192440..4d123e5d3 100644 --- a/tests/src/com/android/inputmethod/latin/SuggestHelper.java +++ b/tests/src/com/android/inputmethod/latin/SuggestHelper.java @@ -32,11 +32,13 @@ public class SuggestHelper { protected final LatinKeyboard mKeyboard; private final KeyDetector mKeyDetector; + public static final int ALPHABET_KEYBOARD = com.android.inputmethod.latin.R.xml.kbd_qwerty; + public SuggestHelper(Context context, int dictionaryId, KeyboardId keyboardId) { // Use null as the locale for Suggest so as to force it to use the internal dictionary // (and not try to find a dictionary provider for a specified locale) mSuggest = new Suggest(context, dictionaryId, null); - mKeyboard = new LatinKeyboard.Builder(context).load(keyboardId).build(); + mKeyboard = new LatinKeyboard.Builder(context).load(ALPHABET_KEYBOARD, keyboardId).build(); mKeyDetector = new KeyDetector(0); init(); } @@ -45,7 +47,7 @@ public class SuggestHelper { final long startOffset, final long length, final KeyboardId keyboardId, final Locale locale) { mSuggest = new Suggest(context, dictionaryPath, startOffset, length, null, locale); - mKeyboard = new LatinKeyboard.Builder(context).load(keyboardId).build(); + mKeyboard = new LatinKeyboard.Builder(context).load(ALPHABET_KEYBOARD, keyboardId).build(); mKeyDetector = new KeyDetector(0); init(); } diff --git a/tests/src/com/android/inputmethod/latin/SuggestTestsBase.java b/tests/src/com/android/inputmethod/latin/SuggestTestsBase.java index bfb03019b..9dd61d78c 100644 --- a/tests/src/com/android/inputmethod/latin/SuggestTestsBase.java +++ b/tests/src/com/android/inputmethod/latin/SuggestTestsBase.java @@ -50,9 +50,8 @@ public class SuggestTestsBase extends AndroidTestCase { + "orientation=" + orientation); return null; } - return new KeyboardId(com.android.inputmethod.latin.R.xml.kbd_qwerty, - KeyboardId.ELEMENT_ALPHABET, locale, orientation, width, KeyboardId.MODE_TEXT, - InputType.TYPE_CLASS_TEXT, 0, false, false, false, false); + return new KeyboardId(KeyboardId.ELEMENT_ALPHABET, locale, orientation, width, + KeyboardId.MODE_TEXT, InputType.TYPE_CLASS_TEXT, 0, false, false, false, false); } protected InputStream openTestRawResource(int resIdInTest) { |