diff options
author | 2012-09-04 01:51:23 -0700 | |
---|---|---|
committer | 2012-09-04 01:51:23 -0700 | |
commit | 8561000d198e2f4fa09f6fe90984c983df268452 (patch) | |
tree | 2f281653dab626d24ee9c3946b8033ed1678fa8a /tests/src/com/android/inputmethod/latin/InputTestsBase.java | |
parent | 12b78258e6d61afba01966cd67cb756a69a92c47 (diff) | |
parent | 49894284bdbe36b6248e2fd0ba984e4709438f50 (diff) | |
download | latinime-8561000d198e2f4fa09f6fe90984c983df268452.tar.gz latinime-8561000d198e2f4fa09f6fe90984c983df268452.tar.xz latinime-8561000d198e2f4fa09f6fe90984c983df268452.zip |
am 49894284: Merge "Add a preliminary test for basic Russian spell check" into jb-mr1-dev
* commit '49894284bdbe36b6248e2fd0ba984e4709438f50':
Add a preliminary test for basic Russian spell check
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/InputTestsBase.java')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/InputTestsBase.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputTestsBase.java b/tests/src/com/android/inputmethod/latin/InputTestsBase.java index dfb83fa24..fe58cb84e 100644 --- a/tests/src/com/android/inputmethod/latin/InputTestsBase.java +++ b/tests/src/com/android/inputmethod/latin/InputTestsBase.java @@ -41,6 +41,7 @@ import com.android.inputmethod.keyboard.Key; import com.android.inputmethod.keyboard.Keyboard; import java.util.HashMap; +import java.util.Locale; public class InputTestsBase extends ServiceTestCase<LatinIME> { @@ -93,12 +94,20 @@ public class InputTestsBase extends ServiceTestCase<LatinIME> { // A helper class to increase control over the TextView public static class MyTextView extends TextView { + public Locale mCurrentLocale; public MyTextView(final Context c) { super(c); } public void onAttachedToWindow() { super.onAttachedToWindow(); } + public Locale getTextServicesLocale() { + // This method is necessary because TextView is asking this method for the language + // to check the spell in. If we don't override this, the spell checker will run in + // whatever language the keyboard is currently set on the test device, ignoring any + // settings we do inside the tests. + return mCurrentLocale; + } } public InputTestsBase() { @@ -261,6 +270,7 @@ 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"); } |