From 81a5a10476a8ada6bbcaeb58d7c23d05f4ec1ab0 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Tue, 7 Oct 2014 19:41:19 +0900 Subject: [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 --- tests/src/com/android/inputmethod/latin/InputTestsBase.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/src/com/android/inputmethod/latin/InputTestsBase.java') 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 { 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 { 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 */)); } -- cgit v1.2.3-83-g751a