summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2014-10-06 19:25:31 +0900
committerTadashi G. Takaoka <takaoka@google.com>2014-10-06 23:42:14 +0900
commit162ca68051368c737fe1a105f1721e643b2884fe (patch)
tree6ea3727a00130ed28bf812698b89f22375f41f9e
parentfcc4cbf6f18cd71409b6bc5a277e4514a75dad73 (diff)
downloadandroid_packages_inputmethods_LatinIME-162ca68051368c737fe1a105f1721e643b2884fe.tar.gz
android_packages_inputmethods_LatinIME-162ca68051368c737fe1a105f1721e643b2884fe.tar.bz2
android_packages_inputmethods_LatinIME-162ca68051368c737fe1a105f1721e643b2884fe.zip
Remove preliminary subtypes from E-MR1 release
Note that unit test for Sinhala (Sri Lanka) and Tamil (Sri Lanka) have been unexpectedly @suppressed. Bug: 17743363 Change-Id: I4076a61adbf2d4aee58417d0c354b8ef4a938668
-rw-r--r--java/res/xml/method.xml14
-rw-r--r--tests/src/com/android/inputmethod/keyboard/action/KlpActionLabelTests.java34
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/KeyboardLayoutSetSubtypesCountTests.java4
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/TestsBengaliBD.java4
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/TestsHinglish.java4
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/TestsMyanmarMM.java4
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/TestsSerbianLatin.java4
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/TestsSerbianLatinQwerty.java4
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/TestsUzbek.java4
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/TestsUzbekQwerty.java4
-rw-r--r--tests/src/com/android/inputmethod/latin/utils/SpacebarLanguageUtilsTests.java22
-rw-r--r--tests/src/com/android/inputmethod/latin/utils/SubtypeLocaleUtilsTests.java27
12 files changed, 87 insertions, 42 deletions
diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml
index 8cc66425c..77a46f9c7 100644
--- a/java/res/xml/method.xml
+++ b/java/res/xml/method.xml
@@ -183,6 +183,7 @@
/>
<!-- TODO: This Bengali (Bangladesh) keyboard is a preliminary layout.
This isn't based on the final specification. -->
+ <!--
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0xa2144b0c"
@@ -191,6 +192,7 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=bengali_akkhor,EmojiCapable"
android:isAsciiCapable="false"
/>
+ -->
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0xbff5986c"
@@ -369,6 +371,7 @@
/>
<!-- TODO: This Hinglish keyboard is a preliminary layout.
This isn't based on the final specification. -->
+ <!--
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_hi_ZZ"
android:subtypeId="0x352eb37c"
@@ -377,6 +380,7 @@
android:imeSubtypeExtraValue="AsciiCapable,KeyboardLayoutSet=qwerty,EmojiCapable"
android:isAsciiCapable="true"
/>
+ -->
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x35b7526a"
@@ -549,6 +553,7 @@
/>
<!-- TODO: This Myanmar keyboard is a preliminary layout.
This isn't based on the final specification. -->
+ <!--
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0xea266ea4"
@@ -557,6 +562,7 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=myanmar,EmojiCapable,CombiningRules=MyanmarReordering"
android:isAsciiCapable="false"
/>
+ -->
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x3f12ee14"
@@ -639,6 +645,7 @@
/>
<!-- TODO: This Sinhala keyboard is a preliminary layout.
This isn't based on the final specification. -->
+ <!--
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x5c6b3bde"
@@ -647,6 +654,7 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=sinhala,EmojiCapable"
android:isAsciiCapable="false"
/>
+ -->
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x8e94d413"
@@ -673,6 +681,7 @@
/>
<!-- TODO: This Serbian Latin keyboard is a preliminary layout.
This isn't based on the final specification. -->
+ <!--
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_sr_ZZ"
android:subtypeId="0xf4a5569c"
@@ -681,6 +690,7 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=serbian_qwertz,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true"
/>
+ -->
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x48b4ff43"
@@ -706,6 +716,7 @@
android:isAsciiCapable="false"
/>
<!-- TODO: Enabling/Disabling ta_LK subtype must be aligned with si_LK subtype. -->
+ <!--
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x6ca12d84"
@@ -714,6 +725,7 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=tamil,EmojiCapable"
android:isAsciiCapable="false"
/>
+ -->
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x785abbd9"
@@ -764,6 +776,7 @@
/>
<!-- TODO: This Uzbek keyboard is a preliminary layout.
This isn't based on the final specification. -->
+ <!--
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0xad5cf7f6"
@@ -772,6 +785,7 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=uzbek,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true"
/>
+ -->
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x93972eee"
diff --git a/tests/src/com/android/inputmethod/keyboard/action/KlpActionLabelTests.java b/tests/src/com/android/inputmethod/keyboard/action/KlpActionLabelTests.java
index 74343cb6a..07c604e59 100644
--- a/tests/src/com/android/inputmethod/keyboard/action/KlpActionLabelTests.java
+++ b/tests/src/com/android/inputmethod/keyboard/action/KlpActionLabelTests.java
@@ -131,7 +131,7 @@ public class KlpActionLabelTests extends KlpActionTestsBase {
textsSet.getText("label_done_key"));
final ExpectedActionKey previousKey = ExpectedActionKey.newLabelKey(
textsSet.getText("label_previous_key"));
- final String tag = "label=hi_ZZ system=" + systemLocale
+ final String tag = "label=" + subtype.getLocale() + " system=" + systemLocale
+ " " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
final RunInLocale<Void> job = new RunInLocale<Void>() {
@Override
@@ -147,26 +147,34 @@ public class KlpActionLabelTests extends KlpActionTestsBase {
public void testHinglishActionLabel() {
final RichInputMethodManager richImm = RichInputMethodManager.getInstance();
final Locale hi_ZZ = new Locale("hi", "ZZ");
- final InputMethodSubtype hinglish = richImm.findSubtypeByLocaleAndKeyboardLayoutSet(
+ final InputMethodSubtype hiLatn = richImm.findSubtypeByLocaleAndKeyboardLayoutSet(
hi_ZZ.toString(), SubtypeLocaleUtils.QWERTY);
+ // This is a preliminary subtype and may not exist.
+ if (hiLatn == null) {
+ return;
+ }
// An action label should be displayed in subtype's locale regardless of the system locale.
- doTestActionKeysInLocaleWithKeyboardTextsSet(hinglish, hi_ZZ, hi_ZZ);
- doTestActionKeysInLocaleWithKeyboardTextsSet(hinglish, hi_ZZ, Locale.US);
- doTestActionKeysInLocaleWithKeyboardTextsSet(hinglish, hi_ZZ, Locale.FRENCH);
- doTestActionKeysInLocaleWithKeyboardTextsSet(hinglish, hi_ZZ, Locale.ITALIAN);
- doTestActionKeysInLocaleWithKeyboardTextsSet(hinglish, hi_ZZ, Locale.JAPANESE);
+ doTestActionKeysInLocaleWithKeyboardTextsSet(hiLatn, hi_ZZ, new Locale("hi"));
+ doTestActionKeysInLocaleWithKeyboardTextsSet(hiLatn, hi_ZZ, Locale.US);
+ doTestActionKeysInLocaleWithKeyboardTextsSet(hiLatn, hi_ZZ, Locale.FRENCH);
+ doTestActionKeysInLocaleWithKeyboardTextsSet(hiLatn, hi_ZZ, Locale.ITALIAN);
+ doTestActionKeysInLocaleWithKeyboardTextsSet(hiLatn, hi_ZZ, Locale.JAPANESE);
}
public void testSerbianLatinActionLabel() {
final RichInputMethodManager richImm = RichInputMethodManager.getInstance();
final Locale sr_ZZ = new Locale("sr", "ZZ");
- final InputMethodSubtype hinglish = richImm.findSubtypeByLocaleAndKeyboardLayoutSet(
+ final InputMethodSubtype srLatn = richImm.findSubtypeByLocaleAndKeyboardLayoutSet(
sr_ZZ.toString(), "serbian_qwertz");
+ // This is a preliminary subtype and may not exist.
+ if (srLatn == null) {
+ return;
+ }
// An action label should be displayed in subtype's locale regardless of the system locale.
- doTestActionKeysInLocaleWithKeyboardTextsSet(hinglish, sr_ZZ, sr_ZZ);
- doTestActionKeysInLocaleWithKeyboardTextsSet(hinglish, sr_ZZ, Locale.US);
- doTestActionKeysInLocaleWithKeyboardTextsSet(hinglish, sr_ZZ, Locale.FRENCH);
- doTestActionKeysInLocaleWithKeyboardTextsSet(hinglish, sr_ZZ, Locale.ITALIAN);
- doTestActionKeysInLocaleWithKeyboardTextsSet(hinglish, sr_ZZ, Locale.JAPANESE);
+ doTestActionKeysInLocaleWithKeyboardTextsSet(srLatn, sr_ZZ, new Locale("sr"));
+ doTestActionKeysInLocaleWithKeyboardTextsSet(srLatn, sr_ZZ, Locale.US);
+ doTestActionKeysInLocaleWithKeyboardTextsSet(srLatn, sr_ZZ, Locale.FRENCH);
+ doTestActionKeysInLocaleWithKeyboardTextsSet(srLatn, sr_ZZ, Locale.ITALIAN);
+ doTestActionKeysInLocaleWithKeyboardTextsSet(srLatn, sr_ZZ, Locale.JAPANESE);
}
}
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/KeyboardLayoutSetSubtypesCountTests.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/KeyboardLayoutSetSubtypesCountTests.java
index 6f747b377..2134eb5fe 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/tests/KeyboardLayoutSetSubtypesCountTests.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/KeyboardLayoutSetSubtypesCountTests.java
@@ -27,8 +27,8 @@ import java.util.ArrayList;
@SmallTest
public class KeyboardLayoutSetSubtypesCountTests extends KeyboardLayoutSetTestsBase {
- private static final int NUMBER_OF_SUBTYPES = 85;
- private static final int NUMBER_OF_ASCII_CAPABLE_SUBTYPES = 50;
+ private static final int NUMBER_OF_SUBTYPES = 78;
+ private static final int NUMBER_OF_ASCII_CAPABLE_SUBTYPES = 47;
private static final int NUMBER_OF_PREDEFINED_ADDITIONAL_SUBTYPES = 2;
@Override
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsBengaliBD.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsBengaliBD.java
index 62625890e..c39a392eb 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsBengaliBD.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsBengaliBD.java
@@ -16,7 +16,7 @@
package com.android.inputmethod.keyboard.layout.tests;
-import android.test.suitebuilder.annotation.SmallTest;
+import android.test.suitebuilder.annotation.Suppress;
import com.android.inputmethod.keyboard.layout.BengaliAkkhor;
import com.android.inputmethod.keyboard.layout.LayoutBase;
@@ -29,7 +29,7 @@ import java.util.Locale;
/**
* bn_BD: Bengali (Bangladesh)/bengali_akkhor
*/
-@SmallTest
+@Suppress
public final class TestsBengaliBD extends LayoutTestsBase {
private static final Locale LOCALE = new Locale("bn", "BD");
private static final LayoutBase LAYOUT = new BengaliAkkhor(new BengaliBDCustomzier(LOCALE));
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsHinglish.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsHinglish.java
index 613b3bbc2..a8e872316 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsHinglish.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsHinglish.java
@@ -16,7 +16,7 @@
package com.android.inputmethod.keyboard.layout.tests;
-import android.test.suitebuilder.annotation.SmallTest;
+import android.test.suitebuilder.annotation.Suppress;
import com.android.inputmethod.keyboard.layout.LayoutBase;
import com.android.inputmethod.keyboard.layout.Qwerty;
@@ -30,7 +30,7 @@ import java.util.Locale;
/*
* hi_ZZ: Hinglish/qwerty
*/
-@SmallTest
+@Suppress
public final class TestsHinglish extends LayoutTestsBase {
private static final Locale LOCALE = new Locale("hi", "ZZ");
private static final LayoutBase LAYOUT = new Qwerty(new HinglishCustomizer(LOCALE));
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsMyanmarMM.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsMyanmarMM.java
index b581e4a12..18baa6152 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsMyanmarMM.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsMyanmarMM.java
@@ -16,7 +16,7 @@
package com.android.inputmethod.keyboard.layout.tests;
-import android.test.suitebuilder.annotation.SmallTest;
+import android.test.suitebuilder.annotation.Suppress;
import com.android.inputmethod.keyboard.layout.LayoutBase;
import com.android.inputmethod.keyboard.layout.Myanmar;
@@ -26,7 +26,7 @@ import java.util.Locale;
/**
* my_MM: Myanmar (Myanmar)/myanmar
*/
-@SmallTest
+@Suppress
public final class TestsMyanmarMM extends LayoutTestsBase {
private static final Locale LOCALE = new Locale("my", "MM");
private static final LayoutBase LAYOUT = new Myanmar(LOCALE);
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsSerbianLatin.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsSerbianLatin.java
index 7490d30ab..ea957e44f 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsSerbianLatin.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsSerbianLatin.java
@@ -16,7 +16,7 @@
package com.android.inputmethod.keyboard.layout.tests;
-import android.test.suitebuilder.annotation.SmallTest;
+import android.test.suitebuilder.annotation.Suppress;
import com.android.inputmethod.keyboard.layout.LayoutBase;
import com.android.inputmethod.keyboard.layout.SerbianQwertz;
@@ -27,7 +27,7 @@ import java.util.Locale;
/**
* sr_ZZ: Serbian (Latin)/serbian_qwertz
*/
-@SmallTest
+@Suppress
public final class TestsSerbianLatin extends LayoutTestsBase {
private static final Locale LOCALE = new Locale("sr", "ZZ");
private static final LayoutBase LAYOUT = new SerbianQwertz(new SerbianLatinCustomizer(LOCALE));
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsSerbianLatinQwerty.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsSerbianLatinQwerty.java
index 6d9351c9d..a1984735d 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsSerbianLatinQwerty.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsSerbianLatinQwerty.java
@@ -16,7 +16,7 @@
package com.android.inputmethod.keyboard.layout.tests;
-import android.test.suitebuilder.annotation.SmallTest;
+import android.test.suitebuilder.annotation.Suppress;
import com.android.inputmethod.keyboard.layout.LayoutBase;
import com.android.inputmethod.keyboard.layout.Qwerty;
@@ -29,7 +29,7 @@ import java.util.Locale;
/**
* sr_ZZ: Serbian (Latin)/qwerty
*/
-@SmallTest
+@Suppress
public final class TestsSerbianLatinQwerty extends LayoutTestsBase {
private static final Locale LOCALE = new Locale("sr", "ZZ");
private static final LayoutBase LAYOUT = new Qwerty(new SerbianLatinQwertyCustomizer(LOCALE));
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsUzbek.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsUzbek.java
index fd12a6a82..169de1f31 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsUzbek.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsUzbek.java
@@ -16,7 +16,7 @@
package com.android.inputmethod.keyboard.layout.tests;
-import android.test.suitebuilder.annotation.SmallTest;
+import android.test.suitebuilder.annotation.Suppress;
import com.android.inputmethod.keyboard.layout.LayoutBase;
import com.android.inputmethod.keyboard.layout.Uzbek;
@@ -27,7 +27,7 @@ import java.util.Locale;
/**
* uz_UZ: Uzbek (Uzbekistan)/uzbek
*/
-@SmallTest
+@Suppress
public final class TestsUzbek extends LayoutTestsBase {
private static final Locale LOCALE = new Locale("uz", "UZ");
private static final LayoutBase LAYOUT = new Uzbek(new UzbekCustomizer(LOCALE));
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsUzbekQwerty.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsUzbekQwerty.java
index 4c33a8cc1..c210da163 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsUzbekQwerty.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsUzbekQwerty.java
@@ -16,7 +16,7 @@
package com.android.inputmethod.keyboard.layout.tests;
-import android.test.suitebuilder.annotation.SmallTest;
+import android.test.suitebuilder.annotation.Suppress;
import com.android.inputmethod.keyboard.layout.LayoutBase;
import com.android.inputmethod.keyboard.layout.Qwerty;
@@ -28,7 +28,7 @@ import java.util.Locale;
/**
* uz_UZ: Uzbek (Uzbekistan)/qwerty
*/
-@SmallTest
+@Suppress
public final class TestsUzbekQwerty extends LayoutTestsBase {
private static final Locale LOCALE = new Locale("uz", "UZ");
private static final LayoutBase LAYOUT = new Qwerty(new UzbekQwertyCustomizer(LOCALE));
diff --git a/tests/src/com/android/inputmethod/latin/utils/SpacebarLanguageUtilsTests.java b/tests/src/com/android/inputmethod/latin/utils/SpacebarLanguageUtilsTests.java
index 8810eaf37..e6131cf65 100644
--- a/tests/src/com/android/inputmethod/latin/utils/SpacebarLanguageUtilsTests.java
+++ b/tests/src/com/android/inputmethod/latin/utils/SpacebarLanguageUtilsTests.java
@@ -45,7 +45,6 @@ public class SpacebarLanguageUtilsTests extends AndroidTestCase {
RichInputMethodSubtype FR_CH;
RichInputMethodSubtype DE;
RichInputMethodSubtype DE_CH;
- RichInputMethodSubtype HI_ZZ;
RichInputMethodSubtype ZZ;
RichInputMethodSubtype DE_QWERTY;
RichInputMethodSubtype FR_QWERTZ;
@@ -55,6 +54,9 @@ public class SpacebarLanguageUtilsTests extends AndroidTestCase {
RichInputMethodSubtype ZZ_AZERTY;
RichInputMethodSubtype ZZ_PC;
+ // This is a preliminary subtype and may not exist.
+ RichInputMethodSubtype HI_LATN;
+
@Override
protected void setUp() throws Exception {
super.setUp();
@@ -87,8 +89,6 @@ public class SpacebarLanguageUtilsTests extends AndroidTestCase {
Locale.GERMAN.toString(), "qwertz"));
DE_CH = new RichInputMethodSubtype(mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet(
"de_CH", "swiss"));
- HI_ZZ = new RichInputMethodSubtype(mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet(
- "hi_ZZ", "qwerty"));
ZZ = new RichInputMethodSubtype(mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet(
SubtypeLocaleUtils.NO_LANGUAGE, "qwerty"));
DE_QWERTY = new RichInputMethodSubtype(
@@ -112,6 +112,12 @@ public class SpacebarLanguageUtilsTests extends AndroidTestCase {
ZZ_PC = new RichInputMethodSubtype(
AdditionalSubtypeUtils.createAsciiEmojiCapableAdditionalSubtype(
SubtypeLocaleUtils.NO_LANGUAGE, "pcqwerty"));
+
+ final InputMethodSubtype hiLatn = mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet(
+ "hi_ZZ", "qwerty");
+ if (hiLatn != null) {
+ HI_LATN = new RichInputMethodSubtype(hiLatn);
+ }
}
public void testAllFullDisplayNameForSpacebar() {
@@ -192,8 +198,11 @@ public class SpacebarLanguageUtilsTests extends AndroidTestCase {
assertEquals("fr_CH", "Français (Suisse)", FR_CH.getFullDisplayName());
assertEquals("de", "Deutsch", DE.getFullDisplayName());
assertEquals("de_CH", "Deutsch (Schweiz)", DE_CH.getFullDisplayName());
- assertEquals("hi_ZZ", "Hinglish", HI_ZZ.getFullDisplayName());
assertEquals("zz", "QWERTY", ZZ.getFullDisplayName());
+ // This is a preliminary subtype and may not exist.
+ if (HI_LATN != null) {
+ assertEquals("hi_ZZ", "Hinglish", HI_LATN.getFullDisplayName());
+ }
assertEquals("en_US", "English", EN_US.getMiddleDisplayName());
assertEquals("en_GB", "English", EN_GB.getMiddleDisplayName());
@@ -203,8 +212,11 @@ public class SpacebarLanguageUtilsTests extends AndroidTestCase {
assertEquals("fr_CH", "Français", FR_CH.getMiddleDisplayName());
assertEquals("de", "Deutsch", DE.getMiddleDisplayName());
assertEquals("de_CH", "Deutsch", DE_CH.getMiddleDisplayName());
- assertEquals("hi_ZZ", "Hinglish", HI_ZZ.getMiddleDisplayName());
assertEquals("zz", "QWERTY", ZZ.getMiddleDisplayName());
+ // This is a preliminary subtype and may not exist.
+ if (HI_LATN != null) {
+ assertEquals("hi_ZZ", "Hinglish", HI_LATN.getMiddleDisplayName());
+ }
return null;
}
};
diff --git a/tests/src/com/android/inputmethod/latin/utils/SubtypeLocaleUtilsTests.java b/tests/src/com/android/inputmethod/latin/utils/SubtypeLocaleUtilsTests.java
index 02be5138f..dfc3fecfd 100644
--- a/tests/src/com/android/inputmethod/latin/utils/SubtypeLocaleUtilsTests.java
+++ b/tests/src/com/android/inputmethod/latin/utils/SubtypeLocaleUtilsTests.java
@@ -45,7 +45,6 @@ public class SubtypeLocaleUtilsTests extends AndroidTestCase {
InputMethodSubtype FR_CH;
InputMethodSubtype DE;
InputMethodSubtype DE_CH;
- InputMethodSubtype HI_ZZ;
InputMethodSubtype ZZ;
InputMethodSubtype DE_QWERTY;
InputMethodSubtype FR_QWERTZ;
@@ -55,6 +54,9 @@ public class SubtypeLocaleUtilsTests extends AndroidTestCase {
InputMethodSubtype ZZ_AZERTY;
InputMethodSubtype ZZ_PC;
+ // This is a preliminary subtype and may not exist.
+ InputMethodSubtype HI_LATN;
+
@Override
protected void setUp() throws Exception {
super.setUp();
@@ -87,8 +89,6 @@ public class SubtypeLocaleUtilsTests extends AndroidTestCase {
Locale.GERMAN.toString(), "qwertz");
DE_CH = mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet(
"de_CH", "swiss");
- HI_ZZ = mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet(
- "hi_ZZ", "qwerty");
ZZ = mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet(
SubtypeLocaleUtils.NO_LANGUAGE, "qwerty");
DE_QWERTY = AdditionalSubtypeUtils.createAsciiEmojiCapableAdditionalSubtype(
@@ -105,6 +105,8 @@ public class SubtypeLocaleUtilsTests extends AndroidTestCase {
SubtypeLocaleUtils.NO_LANGUAGE, "azerty");
ZZ_PC = AdditionalSubtypeUtils.createAsciiEmojiCapableAdditionalSubtype(
SubtypeLocaleUtils.NO_LANGUAGE, "pcqwerty");
+
+ HI_LATN = mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet("hi_ZZ", "qwerty");
}
public void testAllFullDisplayName() {
@@ -137,8 +139,11 @@ public class SubtypeLocaleUtilsTests extends AndroidTestCase {
assertEquals("fr_CH", "swiss", SubtypeLocaleUtils.getKeyboardLayoutSetName(FR_CH));
assertEquals("de", "qwertz", SubtypeLocaleUtils.getKeyboardLayoutSetName(DE));
assertEquals("de_CH", "swiss", SubtypeLocaleUtils.getKeyboardLayoutSetName(DE_CH));
- assertEquals("hi_ZZ", "qwerty", SubtypeLocaleUtils.getKeyboardLayoutSetName(HI_ZZ));
assertEquals("zz", "qwerty", SubtypeLocaleUtils.getKeyboardLayoutSetName(ZZ));
+ // This is a preliminary subtype and may not exist.
+ if (HI_LATN != null) {
+ assertEquals("hi_ZZ", "qwerty", SubtypeLocaleUtils.getKeyboardLayoutSetName(HI_LATN));
+ }
assertEquals("de qwerty", "qwerty", SubtypeLocaleUtils.getKeyboardLayoutSetName(DE_QWERTY));
assertEquals("fr qwertz", "qwertz", SubtypeLocaleUtils.getKeyboardLayoutSetName(FR_QWERTZ));
@@ -193,10 +198,13 @@ public class SubtypeLocaleUtilsTests extends AndroidTestCase {
SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(DE));
assertEquals("de_CH", "German (Switzerland)",
SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(DE_CH));
- assertEquals("hi_ZZ", "Hinglish",
- SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(HI_ZZ));
assertEquals("zz", "Alphabet (QWERTY)",
SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(ZZ));
+ // This is a preliminary subtype and may not exist.
+ if (HI_LATN != null) {
+ assertEquals("hi_ZZ", "Hinglish",
+ SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(HI_LATN));
+ }
return null;
}
};
@@ -268,10 +276,13 @@ public class SubtypeLocaleUtilsTests extends AndroidTestCase {
SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(DE));
assertEquals("de_CH", "Allemand (Suisse)",
SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(DE_CH));
- assertEquals("hi_ZZ", "Hindi/Anglais",
- SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(HI_ZZ));
assertEquals("zz", "Alphabet latin (QWERTY)",
SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(ZZ));
+ // This is a preliminary subtype and may not exist.
+ if (HI_LATN != null) {
+ assertEquals("hi_ZZ", "Hindi/Anglais",
+ SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(HI_LATN));
+ }
return null;
}
};