diff options
author | 2012-04-03 20:27:06 -0700 | |
---|---|---|
committer | 2012-04-03 20:27:06 -0700 | |
commit | e0d06fa793e0a50ffb067be4806713d6bb6ef787 (patch) | |
tree | e743ab6fc61742aa98f95fbc41dedf33bb1bc154 /tests/src | |
parent | 1bdc2ca1d9328cc1907924782848241c75322563 (diff) | |
parent | 52d50f9bd148f950b38996a4dc62020429594293 (diff) | |
download | latinime-e0d06fa793e0a50ffb067be4806713d6bb6ef787.tar.gz latinime-e0d06fa793e0a50ffb067be4806713d6bb6ef787.tar.xz latinime-e0d06fa793e0a50ffb067be4806713d6bb6ef787.zip |
Merge "Use InputMethodInfo.getSubtypeAt() to list all subtype in test"
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/InputLogicFrenchTests.java | 2 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/InputTestsBase.java | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputLogicFrenchTests.java b/tests/src/com/android/inputmethod/latin/InputLogicFrenchTests.java index 5db120d82..60a7b05a9 100644 --- a/tests/src/com/android/inputmethod/latin/InputLogicFrenchTests.java +++ b/tests/src/com/android/inputmethod/latin/InputLogicFrenchTests.java @@ -16,8 +16,6 @@ package com.android.inputmethod.latin; -import com.android.inputmethod.keyboard.Keyboard; - public class InputLogicFrenchTests extends InputTestsBase { public void testAutoCorrectForFrench() { diff --git a/tests/src/com/android/inputmethod/latin/InputTestsBase.java b/tests/src/com/android/inputmethod/latin/InputTestsBase.java index caeff5126..4dfe22800 100644 --- a/tests/src/com/android/inputmethod/latin/InputTestsBase.java +++ b/tests/src/com/android/inputmethod/latin/InputTestsBase.java @@ -138,17 +138,20 @@ public class InputTestsBase extends ServiceTestCase<LatinIME> { final InputMethodManager imm = (InputMethodManager)mLatinIME.getSystemService( Context.INPUT_METHOD_SERVICE); final String packageName = mLatinIME.getPackageName(); - for (final InputMethodInfo imi : imm.getEnabledInputMethodList()) { + // 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)) { - for (final InputMethodSubtype ims : - imm.getEnabledInputMethodSubtypeList(imi, true)) { + 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 disabled"); + fail("LatinIME is not found"); } // We need to run the messages added to the handler from LatinIME. The only way to do @@ -176,7 +179,7 @@ public class InputTestsBase extends ServiceTestCase<LatinIME> { // The only way to get out of Looper#loop() is to call #quit() on it (or on its queue). // Once #quit() is called remaining messages are not processed, which is why we post // a message that calls it instead of calling it directly. - looper.loop(); + Looper.loop(); // Once #quit() has been called, the message queue has an "mQuiting" field that prevents // any subsequent post in this queue. However the queue itself is still fully functional! |