diff options
author | 2014-10-07 19:41:19 +0900 | |
---|---|---|
committer | 2014-10-09 13:13:25 +0900 | |
commit | 81a5a10476a8ada6bbcaeb58d7c23d05f4ec1ab0 (patch) | |
tree | cdb837da177b722f4871a6b66600e970c4849b18 /tests | |
parent | 3c6ac75c48e0f57d389305c9c22a3be960682ed2 (diff) | |
download | latinime-81a5a10476a8ada6bbcaeb58d7c23d05f4ec1ab0.tar.gz latinime-81a5a10476a8ada6bbcaeb58d7c23d05f4ec1ab0.tar.xz latinime-81a5a10476a8ada6bbcaeb58d7c23d05f4ec1ab0.zip |
[ML19] Actually switch the language when appropriate
That is, when auto-correcting or when manually picking.
This is not great, but it's a good starting point.
Bug: 11230254
Change-Id: I07627f48e2de1c28053d6572c7c72625808ec79c
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/InputTestsBase.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputTestsBase.java b/tests/src/com/android/inputmethod/latin/InputTestsBase.java index 6860bea45..ee7942450 100644 --- a/tests/src/com/android/inputmethod/latin/InputTestsBase.java +++ b/tests/src/com/android/inputmethod/latin/InputTestsBase.java @@ -39,6 +39,8 @@ import com.android.inputmethod.compat.InputMethodSubtypeCompatUtils; import com.android.inputmethod.event.Event; import com.android.inputmethod.keyboard.Key; import com.android.inputmethod.keyboard.Keyboard; +import com.android.inputmethod.latin.Dictionary; +import com.android.inputmethod.latin.Dictionary.PhonyDictionary; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; import com.android.inputmethod.latin.settings.DebugSettings; import com.android.inputmethod.latin.settings.Settings; @@ -61,6 +63,10 @@ public class InputTestsBase extends ServiceTestCase<LatinIMEForTests> { protected static final int DELAY_TO_WAIT_FOR_PREDICTIONS = 200; private final int TIMEOUT_TO_WAIT_FOR_LOADING_MAIN_DICTIONARY_IN_SECONDS = 60; + // Type for a test phony dictionary + private static final String TYPE_TEST = "test"; + private static final PhonyDictionary DICTIONARY_TEST = new PhonyDictionary(TYPE_TEST); + protected LatinIME mLatinIME; protected Keyboard mKeyboard; protected MyEditText mEditText; @@ -353,7 +359,7 @@ public class InputTestsBase extends ServiceTestCase<LatinIMEForTests> { protected void pickSuggestionManually(final String suggestion) { mLatinIME.pickSuggestionManually(new SuggestedWordInfo(suggestion, 1, - SuggestedWordInfo.KIND_CORRECTION, null /* sourceDict */, + SuggestedWordInfo.KIND_CORRECTION, DICTIONARY_TEST, SuggestedWordInfo.NOT_AN_INDEX /* indexOfTouchPointOfSecondWord */, SuggestedWordInfo.NOT_A_CONFIDENCE /* autoCommitFirstWordConfidence */)); } |