aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/InputTestsBase.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-01-09 20:55:41 +0900
committerJean Chalard <jchalard@google.com>2013-01-10 15:12:17 +0900
commit912ad4614f4bd10d871b16b5307fed1405f8c1e2 (patch)
tree6249103217fdad86eba65075fe7d70ef3be18de0 /tests/src/com/android/inputmethod/latin/InputTestsBase.java
parent95e3008d2503916a71cee322146d8a0097326000 (diff)
downloadlatinime-912ad4614f4bd10d871b16b5307fed1405f8c1e2.tar.gz
latinime-912ad4614f4bd10d871b16b5307fed1405f8c1e2.tar.xz
latinime-912ad4614f4bd10d871b16b5307fed1405f8c1e2.zip
Fix international tests
Tests have been broken again by recent changes to subtype choice within Latin IME. This fixes the problem and all tests pass again. This change also includes a small fix to one test that was checking for something irrelevant. Change-Id: I6a03dea24f99b0d2ad84c4161a8413f3060bb811
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/InputTestsBase.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/InputTestsBase.java29
1 files changed, 1 insertions, 28 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputTestsBase.java b/tests/src/com/android/inputmethod/latin/InputTestsBase.java
index 86298674b..a01fef2e2 100644
--- a/tests/src/com/android/inputmethod/latin/InputTestsBase.java
+++ b/tests/src/com/android/inputmethod/latin/InputTestsBase.java
@@ -55,8 +55,6 @@ public class InputTestsBase extends ServiceTestCase<LatinIME> {
protected MyTextView mTextView;
protected View mInputView;
protected InputConnection mInputConnection;
- private final HashMap<String, InputMethodSubtype> mSubtypeMap =
- new HashMap<String, InputMethodSubtype>();
// A helper class to ease span tests
public static class SpanGetter {
@@ -143,7 +141,6 @@ public class InputTestsBase extends ServiceTestCase<LatinIME> {
final boolean previousDebugSetting = setDebugMode(true);
mLatinIME.onCreate();
setDebugMode(previousDebugSetting);
- initSubtypeMap();
final EditorInfo ei = new EditorInfo();
ei.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_AUTO_CORRECT;
final InputConnection ic = mTextView.onCreateInputConnection(ei);
@@ -161,26 +158,6 @@ public class InputTestsBase extends ServiceTestCase<LatinIME> {
changeLanguage("en_US");
}
- private void initSubtypeMap() {
- final InputMethodManager imm = (InputMethodManager)mLatinIME.getSystemService(
- Context.INPUT_METHOD_SERVICE);
- final String packageName = mLatinIME.getPackageName();
- // The IMEs and subtypes don't need to be enabled to run this test because IMF isn't
- // involved here.
- for (final InputMethodInfo imi : imm.getInputMethodList()) {
- if (imi.getPackageName().equals(packageName)) {
- final int subtypeCount = imi.getSubtypeCount();
- for (int i = 0; i < subtypeCount; i++) {
- final InputMethodSubtype ims = imi.getSubtypeAt(i);
- final String locale = ims.getLocale();
- mSubtypeMap.put(locale, ims);
- }
- return;
- }
- }
- fail("LatinIME is not found");
- }
-
// We need to run the messages added to the handler from LatinIME. The only way to do
// that is to call Looper#loop() on the right looper, so we're going to get the looper
// object and call #loop() here. The messages in the handler actually run on the UI
@@ -270,12 +247,8 @@ public class InputTestsBase extends ServiceTestCase<LatinIME> {
}
protected void changeLanguage(final String locale) {
- final InputMethodSubtype subtype = mSubtypeMap.get(locale);
mTextView.mCurrentLocale = LocaleUtils.constructLocaleFromString(locale);
- if (subtype == null) {
- fail("InputMethodSubtype for locale " + locale + " is not enabled");
- }
- SubtypeSwitcher.getInstance().onSubtypeChanged(subtype);
+ SubtypeSwitcher.getInstance().forceLocale(mTextView.mCurrentLocale);
mLatinIME.loadKeyboard();
mKeyboard = mLatinIME.mKeyboardSwitcher.getKeyboard();
waitForDictionaryToBeLoaded();