From 912ad4614f4bd10d871b16b5307fed1405f8c1e2 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Wed, 9 Jan 2013 20:55:41 +0900 Subject: 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 --- java/src/com/android/inputmethod/latin/SubtypeSwitcher.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'java/src') diff --git a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java index fe2908428..eb0ec3990 100644 --- a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java +++ b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java @@ -31,6 +31,7 @@ import android.view.inputmethod.InputMethodInfo; import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodSubtype; +import com.android.inputmethod.annotations.UsedForTesting; import com.android.inputmethod.keyboard.KeyboardSwitcher; import java.util.List; @@ -239,7 +240,14 @@ public final class SubtypeSwitcher { return mNeedsToDisplayLanguage.getValue(); } + private static Locale sForcedLocaleForTesting = null; + @UsedForTesting + void forceLocale(final Locale locale) { + sForcedLocaleForTesting = locale; + } + public Locale getCurrentSubtypeLocale() { + if (null != sForcedLocaleForTesting) return sForcedLocaleForTesting; return SubtypeLocale.getSubtypeLocale(getCurrentSubtype()); } -- cgit v1.2.3-83-g751a