aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2014-12-12 04:49:24 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-12-12 04:49:24 +0000
commit1f890c4d824fc24e0a1d90e2f437ee4f936a01ad (patch)
tree34174bb23d0ebd3f9ae692bee7696d3cb70be72b /tests/src
parent7907757943a99fe27a57b6158640ec0594f480a0 (diff)
parent8cfad7ed64d08c5a131c9c539aa4fc964030c214 (diff)
downloadlatinime-1f890c4d824fc24e0a1d90e2f437ee4f936a01ad.tar.gz
latinime-1f890c4d824fc24e0a1d90e2f437ee4f936a01ad.tar.xz
latinime-1f890c4d824fc24e0a1d90e2f437ee4f936a01ad.zip
am 8cfad7ed: Merge "Make LanguageOnSpacebarHelper as utility class"
* commit '8cfad7ed64d08c5a131c9c539aa4fc964030c214': Make LanguageOnSpacebarHelper as utility class
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/com/android/inputmethod/latin/utils/LanguageOnSpacebarUtilsTests.java (renamed from tests/src/com/android/inputmethod/keyboard/internal/LanguageOnSpacebarHelperTests.java)24
1 files changed, 11 insertions, 13 deletions
diff --git a/tests/src/com/android/inputmethod/keyboard/internal/LanguageOnSpacebarHelperTests.java b/tests/src/com/android/inputmethod/latin/utils/LanguageOnSpacebarUtilsTests.java
index 6bb255b01..7f7f493b1 100644
--- a/tests/src/com/android/inputmethod/keyboard/internal/LanguageOnSpacebarHelperTests.java
+++ b/tests/src/com/android/inputmethod/latin/utils/LanguageOnSpacebarUtilsTests.java
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package com.android.inputmethod.keyboard.internal;
+package com.android.inputmethod.latin.utils;
-import static com.android.inputmethod.keyboard.internal.LanguageOnSpacebarHelper.FORMAT_TYPE_FULL_LOCALE;
-import static com.android.inputmethod.keyboard.internal.LanguageOnSpacebarHelper.FORMAT_TYPE_LANGUAGE_ONLY;
-import static com.android.inputmethod.keyboard.internal.LanguageOnSpacebarHelper.FORMAT_TYPE_NONE;
+import static com.android.inputmethod.latin.utils.LanguageOnSpacebarUtils.FORMAT_TYPE_FULL_LOCALE;
+import static com.android.inputmethod.latin.utils.LanguageOnSpacebarUtils.FORMAT_TYPE_LANGUAGE_ONLY;
+import static com.android.inputmethod.latin.utils.LanguageOnSpacebarUtils.FORMAT_TYPE_NONE;
import android.content.Context;
import android.test.AndroidTestCase;
@@ -28,6 +28,7 @@ import android.view.inputmethod.InputMethodSubtype;
import com.android.inputmethod.latin.RichInputMethodManager;
import com.android.inputmethod.latin.RichInputMethodSubtype;
import com.android.inputmethod.latin.utils.AdditionalSubtypeUtils;
+import com.android.inputmethod.latin.utils.LanguageOnSpacebarUtils;
import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
import java.util.ArrayList;
@@ -36,10 +37,7 @@ import java.util.Locale;
import javax.annotation.Nonnull;
@SmallTest
-public class LanguageOnSpacebarHelperTests extends AndroidTestCase {
- private final LanguageOnSpacebarHelper mLanguageOnSpacebarHelper =
- new LanguageOnSpacebarHelper();
-
+public class LanguageOnSpacebarUtilsTests extends AndroidTestCase {
private RichInputMethodManager mRichImm;
RichInputMethodSubtype EN_US_QWERTY;
@@ -84,21 +82,21 @@ public class LanguageOnSpacebarHelperTests extends AndroidTestCase {
return new RichInputMethodSubtype(subtype);
}
- private void enableSubtypes(final RichInputMethodSubtype ... subtypes) {
+ private static void enableSubtypes(final RichInputMethodSubtype ... subtypes) {
final ArrayList<InputMethodSubtype> enabledSubtypes = new ArrayList<>();
for (final RichInputMethodSubtype subtype : subtypes) {
enabledSubtypes.add(subtype.getRawSubtype());
}
- mLanguageOnSpacebarHelper.onUpdateEnabledSubtypes(enabledSubtypes);
+ LanguageOnSpacebarUtils.setEnabledSubtypes(enabledSubtypes);
}
- private void assertFormatType(final RichInputMethodSubtype subtype,
+ private static void assertFormatType(final RichInputMethodSubtype subtype,
final boolean implicitlyEnabledSubtype, final Locale systemLocale,
final int expectedFormat) {
- mLanguageOnSpacebarHelper.onSubtypeChanged(subtype, implicitlyEnabledSubtype, systemLocale);
+ LanguageOnSpacebarUtils.onSubtypeChanged(subtype, implicitlyEnabledSubtype, systemLocale);
assertEquals(subtype.getLocales()[0] + " implicitly=" + implicitlyEnabledSubtype
+ " in " + systemLocale, expectedFormat,
- mLanguageOnSpacebarHelper.getLanguageOnSpacebarFormatType(subtype));
+ LanguageOnSpacebarUtils.getLanguageOnSpacebarFormatType(subtype));
}
public void testOneSubtypeImplicitlyEnabled() {