aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java2
-rw-r--r--tests/src/com/android/inputmethod/latin/utils/LanguageOnSpacebarUtilsTests.java (renamed from tests/src/com/android/inputmethod/keyboard/internal/LanguageOnSpacebarHelperTests.java)24
2 files changed, 12 insertions, 14 deletions
diff --git a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java
index 88550802c..7f828111d 100644
--- a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java
+++ b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java
@@ -155,7 +155,7 @@ public abstract class KeyboardLayoutSetTestsBase extends AndroidTestCase {
final boolean languageSwitchKeyEnabled, final boolean splitLayoutEnabled) {
final Context context = getContext();
final Resources res = context.getResources();
- final int keyboardWidth = ResourceUtils.getKeyboardFrameWidth(res);
+ final int keyboardWidth = ResourceUtils.getDefaultKeyboardWidth(res);
final int keyboardHeight = ResourceUtils.getDefaultKeyboardHeight(res);
final Builder builder = new Builder(context, editorInfo);
builder.setKeyboardGeometry(keyboardWidth, keyboardHeight)
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() {