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
main
Tadashi G. Takaoka 2014-10-06 19:25:31 +09:00
parent fcc4cbf6f1
commit 162ca68051
12 changed files with 87 additions and 42 deletions

View File

@ -183,6 +183,7 @@
/> />
<!-- TODO: This Bengali (Bangladesh) keyboard is a preliminary layout. <!-- TODO: This Bengali (Bangladesh) keyboard is a preliminary layout.
This isn't based on the final specification. --> This isn't based on the final specification. -->
<!--
<subtype android:icon="@drawable/ic_ime_switcher_dark" <subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0xa2144b0c" android:subtypeId="0xa2144b0c"
@ -191,6 +192,7 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=bengali_akkhor,EmojiCapable" android:imeSubtypeExtraValue="KeyboardLayoutSet=bengali_akkhor,EmojiCapable"
android:isAsciiCapable="false" android:isAsciiCapable="false"
/> />
-->
<subtype android:icon="@drawable/ic_ime_switcher_dark" <subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0xbff5986c" android:subtypeId="0xbff5986c"
@ -369,6 +371,7 @@
/> />
<!-- TODO: This Hinglish keyboard is a preliminary layout. <!-- TODO: This Hinglish keyboard is a preliminary layout.
This isn't based on the final specification. --> This isn't based on the final specification. -->
<!--
<subtype android:icon="@drawable/ic_ime_switcher_dark" <subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_hi_ZZ" android:label="@string/subtype_hi_ZZ"
android:subtypeId="0x352eb37c" android:subtypeId="0x352eb37c"
@ -377,6 +380,7 @@
android:imeSubtypeExtraValue="AsciiCapable,KeyboardLayoutSet=qwerty,EmojiCapable" android:imeSubtypeExtraValue="AsciiCapable,KeyboardLayoutSet=qwerty,EmojiCapable"
android:isAsciiCapable="true" android:isAsciiCapable="true"
/> />
-->
<subtype android:icon="@drawable/ic_ime_switcher_dark" <subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0x35b7526a" android:subtypeId="0x35b7526a"
@ -549,6 +553,7 @@
/> />
<!-- TODO: This Myanmar keyboard is a preliminary layout. <!-- TODO: This Myanmar keyboard is a preliminary layout.
This isn't based on the final specification. --> This isn't based on the final specification. -->
<!--
<subtype android:icon="@drawable/ic_ime_switcher_dark" <subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0xea266ea4" android:subtypeId="0xea266ea4"
@ -557,6 +562,7 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=myanmar,EmojiCapable,CombiningRules=MyanmarReordering" android:imeSubtypeExtraValue="KeyboardLayoutSet=myanmar,EmojiCapable,CombiningRules=MyanmarReordering"
android:isAsciiCapable="false" android:isAsciiCapable="false"
/> />
-->
<subtype android:icon="@drawable/ic_ime_switcher_dark" <subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0x3f12ee14" android:subtypeId="0x3f12ee14"
@ -639,6 +645,7 @@
/> />
<!-- TODO: This Sinhala keyboard is a preliminary layout. <!-- TODO: This Sinhala keyboard is a preliminary layout.
This isn't based on the final specification. --> This isn't based on the final specification. -->
<!--
<subtype android:icon="@drawable/ic_ime_switcher_dark" <subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0x5c6b3bde" android:subtypeId="0x5c6b3bde"
@ -647,6 +654,7 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=sinhala,EmojiCapable" android:imeSubtypeExtraValue="KeyboardLayoutSet=sinhala,EmojiCapable"
android:isAsciiCapable="false" android:isAsciiCapable="false"
/> />
-->
<subtype android:icon="@drawable/ic_ime_switcher_dark" <subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0x8e94d413" android:subtypeId="0x8e94d413"
@ -673,6 +681,7 @@
/> />
<!-- TODO: This Serbian Latin keyboard is a preliminary layout. <!-- TODO: This Serbian Latin keyboard is a preliminary layout.
This isn't based on the final specification. --> This isn't based on the final specification. -->
<!--
<subtype android:icon="@drawable/ic_ime_switcher_dark" <subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_sr_ZZ" android:label="@string/subtype_sr_ZZ"
android:subtypeId="0xf4a5569c" android:subtypeId="0xf4a5569c"
@ -681,6 +690,7 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=serbian_qwertz,AsciiCapable,EmojiCapable" android:imeSubtypeExtraValue="KeyboardLayoutSet=serbian_qwertz,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true" android:isAsciiCapable="true"
/> />
-->
<subtype android:icon="@drawable/ic_ime_switcher_dark" <subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0x48b4ff43" android:subtypeId="0x48b4ff43"
@ -706,6 +716,7 @@
android:isAsciiCapable="false" android:isAsciiCapable="false"
/> />
<!-- TODO: Enabling/Disabling ta_LK subtype must be aligned with si_LK subtype. --> <!-- TODO: Enabling/Disabling ta_LK subtype must be aligned with si_LK subtype. -->
<!--
<subtype android:icon="@drawable/ic_ime_switcher_dark" <subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0x6ca12d84" android:subtypeId="0x6ca12d84"
@ -714,6 +725,7 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=tamil,EmojiCapable" android:imeSubtypeExtraValue="KeyboardLayoutSet=tamil,EmojiCapable"
android:isAsciiCapable="false" android:isAsciiCapable="false"
/> />
-->
<subtype android:icon="@drawable/ic_ime_switcher_dark" <subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0x785abbd9" android:subtypeId="0x785abbd9"
@ -764,6 +776,7 @@
/> />
<!-- TODO: This Uzbek keyboard is a preliminary layout. <!-- TODO: This Uzbek keyboard is a preliminary layout.
This isn't based on the final specification. --> This isn't based on the final specification. -->
<!--
<subtype android:icon="@drawable/ic_ime_switcher_dark" <subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0xad5cf7f6" android:subtypeId="0xad5cf7f6"
@ -772,6 +785,7 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=uzbek,AsciiCapable,EmojiCapable" android:imeSubtypeExtraValue="KeyboardLayoutSet=uzbek,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true" android:isAsciiCapable="true"
/> />
-->
<subtype android:icon="@drawable/ic_ime_switcher_dark" <subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0x93972eee" android:subtypeId="0x93972eee"

View File

@ -131,7 +131,7 @@ public class KlpActionLabelTests extends KlpActionTestsBase {
textsSet.getText("label_done_key")); textsSet.getText("label_done_key"));
final ExpectedActionKey previousKey = ExpectedActionKey.newLabelKey( final ExpectedActionKey previousKey = ExpectedActionKey.newLabelKey(
textsSet.getText("label_previous_key")); textsSet.getText("label_previous_key"));
final String tag = "label=hi_ZZ system=" + systemLocale final String tag = "label=" + subtype.getLocale() + " system=" + systemLocale
+ " " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype); + " " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
final RunInLocale<Void> job = new RunInLocale<Void>() { final RunInLocale<Void> job = new RunInLocale<Void>() {
@Override @Override
@ -147,26 +147,34 @@ public class KlpActionLabelTests extends KlpActionTestsBase {
public void testHinglishActionLabel() { public void testHinglishActionLabel() {
final RichInputMethodManager richImm = RichInputMethodManager.getInstance(); final RichInputMethodManager richImm = RichInputMethodManager.getInstance();
final Locale hi_ZZ = new Locale("hi", "ZZ"); final Locale hi_ZZ = new Locale("hi", "ZZ");
final InputMethodSubtype hinglish = richImm.findSubtypeByLocaleAndKeyboardLayoutSet( final InputMethodSubtype hiLatn = richImm.findSubtypeByLocaleAndKeyboardLayoutSet(
hi_ZZ.toString(), SubtypeLocaleUtils.QWERTY); 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. // An action label should be displayed in subtype's locale regardless of the system locale.
doTestActionKeysInLocaleWithKeyboardTextsSet(hinglish, hi_ZZ, hi_ZZ); doTestActionKeysInLocaleWithKeyboardTextsSet(hiLatn, hi_ZZ, new Locale("hi"));
doTestActionKeysInLocaleWithKeyboardTextsSet(hinglish, hi_ZZ, Locale.US); doTestActionKeysInLocaleWithKeyboardTextsSet(hiLatn, hi_ZZ, Locale.US);
doTestActionKeysInLocaleWithKeyboardTextsSet(hinglish, hi_ZZ, Locale.FRENCH); doTestActionKeysInLocaleWithKeyboardTextsSet(hiLatn, hi_ZZ, Locale.FRENCH);
doTestActionKeysInLocaleWithKeyboardTextsSet(hinglish, hi_ZZ, Locale.ITALIAN); doTestActionKeysInLocaleWithKeyboardTextsSet(hiLatn, hi_ZZ, Locale.ITALIAN);
doTestActionKeysInLocaleWithKeyboardTextsSet(hinglish, hi_ZZ, Locale.JAPANESE); doTestActionKeysInLocaleWithKeyboardTextsSet(hiLatn, hi_ZZ, Locale.JAPANESE);
} }
public void testSerbianLatinActionLabel() { public void testSerbianLatinActionLabel() {
final RichInputMethodManager richImm = RichInputMethodManager.getInstance(); final RichInputMethodManager richImm = RichInputMethodManager.getInstance();
final Locale sr_ZZ = new Locale("sr", "ZZ"); final Locale sr_ZZ = new Locale("sr", "ZZ");
final InputMethodSubtype hinglish = richImm.findSubtypeByLocaleAndKeyboardLayoutSet( final InputMethodSubtype srLatn = richImm.findSubtypeByLocaleAndKeyboardLayoutSet(
sr_ZZ.toString(), "serbian_qwertz"); 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. // An action label should be displayed in subtype's locale regardless of the system locale.
doTestActionKeysInLocaleWithKeyboardTextsSet(hinglish, sr_ZZ, sr_ZZ); doTestActionKeysInLocaleWithKeyboardTextsSet(srLatn, sr_ZZ, new Locale("sr"));
doTestActionKeysInLocaleWithKeyboardTextsSet(hinglish, sr_ZZ, Locale.US); doTestActionKeysInLocaleWithKeyboardTextsSet(srLatn, sr_ZZ, Locale.US);
doTestActionKeysInLocaleWithKeyboardTextsSet(hinglish, sr_ZZ, Locale.FRENCH); doTestActionKeysInLocaleWithKeyboardTextsSet(srLatn, sr_ZZ, Locale.FRENCH);
doTestActionKeysInLocaleWithKeyboardTextsSet(hinglish, sr_ZZ, Locale.ITALIAN); doTestActionKeysInLocaleWithKeyboardTextsSet(srLatn, sr_ZZ, Locale.ITALIAN);
doTestActionKeysInLocaleWithKeyboardTextsSet(hinglish, sr_ZZ, Locale.JAPANESE); doTestActionKeysInLocaleWithKeyboardTextsSet(srLatn, sr_ZZ, Locale.JAPANESE);
} }
} }

View File

@ -27,8 +27,8 @@ import java.util.ArrayList;
@SmallTest @SmallTest
public class KeyboardLayoutSetSubtypesCountTests extends KeyboardLayoutSetTestsBase { public class KeyboardLayoutSetSubtypesCountTests extends KeyboardLayoutSetTestsBase {
private static final int NUMBER_OF_SUBTYPES = 85; private static final int NUMBER_OF_SUBTYPES = 78;
private static final int NUMBER_OF_ASCII_CAPABLE_SUBTYPES = 50; private static final int NUMBER_OF_ASCII_CAPABLE_SUBTYPES = 47;
private static final int NUMBER_OF_PREDEFINED_ADDITIONAL_SUBTYPES = 2; private static final int NUMBER_OF_PREDEFINED_ADDITIONAL_SUBTYPES = 2;
@Override @Override

View File

@ -16,7 +16,7 @@
package com.android.inputmethod.keyboard.layout.tests; 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.BengaliAkkhor;
import com.android.inputmethod.keyboard.layout.LayoutBase; import com.android.inputmethod.keyboard.layout.LayoutBase;
@ -29,7 +29,7 @@ import java.util.Locale;
/** /**
* bn_BD: Bengali (Bangladesh)/bengali_akkhor * bn_BD: Bengali (Bangladesh)/bengali_akkhor
*/ */
@SmallTest @Suppress
public final class TestsBengaliBD extends LayoutTestsBase { public final class TestsBengaliBD extends LayoutTestsBase {
private static final Locale LOCALE = new Locale("bn", "BD"); private static final Locale LOCALE = new Locale("bn", "BD");
private static final LayoutBase LAYOUT = new BengaliAkkhor(new BengaliBDCustomzier(LOCALE)); private static final LayoutBase LAYOUT = new BengaliAkkhor(new BengaliBDCustomzier(LOCALE));

View File

@ -16,7 +16,7 @@
package com.android.inputmethod.keyboard.layout.tests; 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.LayoutBase;
import com.android.inputmethod.keyboard.layout.Qwerty; import com.android.inputmethod.keyboard.layout.Qwerty;
@ -30,7 +30,7 @@ import java.util.Locale;
/* /*
* hi_ZZ: Hinglish/qwerty * hi_ZZ: Hinglish/qwerty
*/ */
@SmallTest @Suppress
public final class TestsHinglish extends LayoutTestsBase { public final class TestsHinglish extends LayoutTestsBase {
private static final Locale LOCALE = new Locale("hi", "ZZ"); private static final Locale LOCALE = new Locale("hi", "ZZ");
private static final LayoutBase LAYOUT = new Qwerty(new HinglishCustomizer(LOCALE)); private static final LayoutBase LAYOUT = new Qwerty(new HinglishCustomizer(LOCALE));

View File

@ -16,7 +16,7 @@
package com.android.inputmethod.keyboard.layout.tests; 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.LayoutBase;
import com.android.inputmethod.keyboard.layout.Myanmar; import com.android.inputmethod.keyboard.layout.Myanmar;
@ -26,7 +26,7 @@ import java.util.Locale;
/** /**
* my_MM: Myanmar (Myanmar)/myanmar * my_MM: Myanmar (Myanmar)/myanmar
*/ */
@SmallTest @Suppress
public final class TestsMyanmarMM extends LayoutTestsBase { public final class TestsMyanmarMM extends LayoutTestsBase {
private static final Locale LOCALE = new Locale("my", "MM"); private static final Locale LOCALE = new Locale("my", "MM");
private static final LayoutBase LAYOUT = new Myanmar(LOCALE); private static final LayoutBase LAYOUT = new Myanmar(LOCALE);

View File

@ -16,7 +16,7 @@
package com.android.inputmethod.keyboard.layout.tests; 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.LayoutBase;
import com.android.inputmethod.keyboard.layout.SerbianQwertz; import com.android.inputmethod.keyboard.layout.SerbianQwertz;
@ -27,7 +27,7 @@ import java.util.Locale;
/** /**
* sr_ZZ: Serbian (Latin)/serbian_qwertz * sr_ZZ: Serbian (Latin)/serbian_qwertz
*/ */
@SmallTest @Suppress
public final class TestsSerbianLatin extends LayoutTestsBase { public final class TestsSerbianLatin extends LayoutTestsBase {
private static final Locale LOCALE = new Locale("sr", "ZZ"); private static final Locale LOCALE = new Locale("sr", "ZZ");
private static final LayoutBase LAYOUT = new SerbianQwertz(new SerbianLatinCustomizer(LOCALE)); private static final LayoutBase LAYOUT = new SerbianQwertz(new SerbianLatinCustomizer(LOCALE));

View File

@ -16,7 +16,7 @@
package com.android.inputmethod.keyboard.layout.tests; 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.LayoutBase;
import com.android.inputmethod.keyboard.layout.Qwerty; import com.android.inputmethod.keyboard.layout.Qwerty;
@ -29,7 +29,7 @@ import java.util.Locale;
/** /**
* sr_ZZ: Serbian (Latin)/qwerty * sr_ZZ: Serbian (Latin)/qwerty
*/ */
@SmallTest @Suppress
public final class TestsSerbianLatinQwerty extends LayoutTestsBase { public final class TestsSerbianLatinQwerty extends LayoutTestsBase {
private static final Locale LOCALE = new Locale("sr", "ZZ"); private static final Locale LOCALE = new Locale("sr", "ZZ");
private static final LayoutBase LAYOUT = new Qwerty(new SerbianLatinQwertyCustomizer(LOCALE)); private static final LayoutBase LAYOUT = new Qwerty(new SerbianLatinQwertyCustomizer(LOCALE));

View File

@ -16,7 +16,7 @@
package com.android.inputmethod.keyboard.layout.tests; 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.LayoutBase;
import com.android.inputmethod.keyboard.layout.Uzbek; import com.android.inputmethod.keyboard.layout.Uzbek;
@ -27,7 +27,7 @@ import java.util.Locale;
/** /**
* uz_UZ: Uzbek (Uzbekistan)/uzbek * uz_UZ: Uzbek (Uzbekistan)/uzbek
*/ */
@SmallTest @Suppress
public final class TestsUzbek extends LayoutTestsBase { public final class TestsUzbek extends LayoutTestsBase {
private static final Locale LOCALE = new Locale("uz", "UZ"); private static final Locale LOCALE = new Locale("uz", "UZ");
private static final LayoutBase LAYOUT = new Uzbek(new UzbekCustomizer(LOCALE)); private static final LayoutBase LAYOUT = new Uzbek(new UzbekCustomizer(LOCALE));

View File

@ -16,7 +16,7 @@
package com.android.inputmethod.keyboard.layout.tests; 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.LayoutBase;
import com.android.inputmethod.keyboard.layout.Qwerty; import com.android.inputmethod.keyboard.layout.Qwerty;
@ -28,7 +28,7 @@ import java.util.Locale;
/** /**
* uz_UZ: Uzbek (Uzbekistan)/qwerty * uz_UZ: Uzbek (Uzbekistan)/qwerty
*/ */
@SmallTest @Suppress
public final class TestsUzbekQwerty extends LayoutTestsBase { public final class TestsUzbekQwerty extends LayoutTestsBase {
private static final Locale LOCALE = new Locale("uz", "UZ"); private static final Locale LOCALE = new Locale("uz", "UZ");
private static final LayoutBase LAYOUT = new Qwerty(new UzbekQwertyCustomizer(LOCALE)); private static final LayoutBase LAYOUT = new Qwerty(new UzbekQwertyCustomizer(LOCALE));

View File

@ -45,7 +45,6 @@ public class SpacebarLanguageUtilsTests extends AndroidTestCase {
RichInputMethodSubtype FR_CH; RichInputMethodSubtype FR_CH;
RichInputMethodSubtype DE; RichInputMethodSubtype DE;
RichInputMethodSubtype DE_CH; RichInputMethodSubtype DE_CH;
RichInputMethodSubtype HI_ZZ;
RichInputMethodSubtype ZZ; RichInputMethodSubtype ZZ;
RichInputMethodSubtype DE_QWERTY; RichInputMethodSubtype DE_QWERTY;
RichInputMethodSubtype FR_QWERTZ; RichInputMethodSubtype FR_QWERTZ;
@ -55,6 +54,9 @@ public class SpacebarLanguageUtilsTests extends AndroidTestCase {
RichInputMethodSubtype ZZ_AZERTY; RichInputMethodSubtype ZZ_AZERTY;
RichInputMethodSubtype ZZ_PC; RichInputMethodSubtype ZZ_PC;
// This is a preliminary subtype and may not exist.
RichInputMethodSubtype HI_LATN;
@Override @Override
protected void setUp() throws Exception { protected void setUp() throws Exception {
super.setUp(); super.setUp();
@ -87,8 +89,6 @@ public class SpacebarLanguageUtilsTests extends AndroidTestCase {
Locale.GERMAN.toString(), "qwertz")); Locale.GERMAN.toString(), "qwertz"));
DE_CH = new RichInputMethodSubtype(mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet( DE_CH = new RichInputMethodSubtype(mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet(
"de_CH", "swiss")); "de_CH", "swiss"));
HI_ZZ = new RichInputMethodSubtype(mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet(
"hi_ZZ", "qwerty"));
ZZ = new RichInputMethodSubtype(mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet( ZZ = new RichInputMethodSubtype(mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet(
SubtypeLocaleUtils.NO_LANGUAGE, "qwerty")); SubtypeLocaleUtils.NO_LANGUAGE, "qwerty"));
DE_QWERTY = new RichInputMethodSubtype( DE_QWERTY = new RichInputMethodSubtype(
@ -112,6 +112,12 @@ public class SpacebarLanguageUtilsTests extends AndroidTestCase {
ZZ_PC = new RichInputMethodSubtype( ZZ_PC = new RichInputMethodSubtype(
AdditionalSubtypeUtils.createAsciiEmojiCapableAdditionalSubtype( AdditionalSubtypeUtils.createAsciiEmojiCapableAdditionalSubtype(
SubtypeLocaleUtils.NO_LANGUAGE, "pcqwerty")); SubtypeLocaleUtils.NO_LANGUAGE, "pcqwerty"));
final InputMethodSubtype hiLatn = mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet(
"hi_ZZ", "qwerty");
if (hiLatn != null) {
HI_LATN = new RichInputMethodSubtype(hiLatn);
}
} }
public void testAllFullDisplayNameForSpacebar() { public void testAllFullDisplayNameForSpacebar() {
@ -192,8 +198,11 @@ public class SpacebarLanguageUtilsTests extends AndroidTestCase {
assertEquals("fr_CH", "Français (Suisse)", FR_CH.getFullDisplayName()); assertEquals("fr_CH", "Français (Suisse)", FR_CH.getFullDisplayName());
assertEquals("de", "Deutsch", DE.getFullDisplayName()); assertEquals("de", "Deutsch", DE.getFullDisplayName());
assertEquals("de_CH", "Deutsch (Schweiz)", DE_CH.getFullDisplayName()); assertEquals("de_CH", "Deutsch (Schweiz)", DE_CH.getFullDisplayName());
assertEquals("hi_ZZ", "Hinglish", HI_ZZ.getFullDisplayName());
assertEquals("zz", "QWERTY", 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_US", "English", EN_US.getMiddleDisplayName());
assertEquals("en_GB", "English", EN_GB.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("fr_CH", "Français", FR_CH.getMiddleDisplayName());
assertEquals("de", "Deutsch", DE.getMiddleDisplayName()); assertEquals("de", "Deutsch", DE.getMiddleDisplayName());
assertEquals("de_CH", "Deutsch", DE_CH.getMiddleDisplayName()); assertEquals("de_CH", "Deutsch", DE_CH.getMiddleDisplayName());
assertEquals("hi_ZZ", "Hinglish", HI_ZZ.getMiddleDisplayName());
assertEquals("zz", "QWERTY", 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; return null;
} }
}; };

View File

@ -45,7 +45,6 @@ public class SubtypeLocaleUtilsTests extends AndroidTestCase {
InputMethodSubtype FR_CH; InputMethodSubtype FR_CH;
InputMethodSubtype DE; InputMethodSubtype DE;
InputMethodSubtype DE_CH; InputMethodSubtype DE_CH;
InputMethodSubtype HI_ZZ;
InputMethodSubtype ZZ; InputMethodSubtype ZZ;
InputMethodSubtype DE_QWERTY; InputMethodSubtype DE_QWERTY;
InputMethodSubtype FR_QWERTZ; InputMethodSubtype FR_QWERTZ;
@ -55,6 +54,9 @@ public class SubtypeLocaleUtilsTests extends AndroidTestCase {
InputMethodSubtype ZZ_AZERTY; InputMethodSubtype ZZ_AZERTY;
InputMethodSubtype ZZ_PC; InputMethodSubtype ZZ_PC;
// This is a preliminary subtype and may not exist.
InputMethodSubtype HI_LATN;
@Override @Override
protected void setUp() throws Exception { protected void setUp() throws Exception {
super.setUp(); super.setUp();
@ -87,8 +89,6 @@ public class SubtypeLocaleUtilsTests extends AndroidTestCase {
Locale.GERMAN.toString(), "qwertz"); Locale.GERMAN.toString(), "qwertz");
DE_CH = mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet( DE_CH = mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet(
"de_CH", "swiss"); "de_CH", "swiss");
HI_ZZ = mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet(
"hi_ZZ", "qwerty");
ZZ = mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet( ZZ = mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet(
SubtypeLocaleUtils.NO_LANGUAGE, "qwerty"); SubtypeLocaleUtils.NO_LANGUAGE, "qwerty");
DE_QWERTY = AdditionalSubtypeUtils.createAsciiEmojiCapableAdditionalSubtype( DE_QWERTY = AdditionalSubtypeUtils.createAsciiEmojiCapableAdditionalSubtype(
@ -105,6 +105,8 @@ public class SubtypeLocaleUtilsTests extends AndroidTestCase {
SubtypeLocaleUtils.NO_LANGUAGE, "azerty"); SubtypeLocaleUtils.NO_LANGUAGE, "azerty");
ZZ_PC = AdditionalSubtypeUtils.createAsciiEmojiCapableAdditionalSubtype( ZZ_PC = AdditionalSubtypeUtils.createAsciiEmojiCapableAdditionalSubtype(
SubtypeLocaleUtils.NO_LANGUAGE, "pcqwerty"); SubtypeLocaleUtils.NO_LANGUAGE, "pcqwerty");
HI_LATN = mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet("hi_ZZ", "qwerty");
} }
public void testAllFullDisplayName() { public void testAllFullDisplayName() {
@ -137,8 +139,11 @@ public class SubtypeLocaleUtilsTests extends AndroidTestCase {
assertEquals("fr_CH", "swiss", SubtypeLocaleUtils.getKeyboardLayoutSetName(FR_CH)); assertEquals("fr_CH", "swiss", SubtypeLocaleUtils.getKeyboardLayoutSetName(FR_CH));
assertEquals("de", "qwertz", SubtypeLocaleUtils.getKeyboardLayoutSetName(DE)); assertEquals("de", "qwertz", SubtypeLocaleUtils.getKeyboardLayoutSetName(DE));
assertEquals("de_CH", "swiss", SubtypeLocaleUtils.getKeyboardLayoutSetName(DE_CH)); assertEquals("de_CH", "swiss", SubtypeLocaleUtils.getKeyboardLayoutSetName(DE_CH));
assertEquals("hi_ZZ", "qwerty", SubtypeLocaleUtils.getKeyboardLayoutSetName(HI_ZZ));
assertEquals("zz", "qwerty", SubtypeLocaleUtils.getKeyboardLayoutSetName(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("de qwerty", "qwerty", SubtypeLocaleUtils.getKeyboardLayoutSetName(DE_QWERTY));
assertEquals("fr qwertz", "qwertz", SubtypeLocaleUtils.getKeyboardLayoutSetName(FR_QWERTZ)); assertEquals("fr qwertz", "qwertz", SubtypeLocaleUtils.getKeyboardLayoutSetName(FR_QWERTZ));
@ -193,10 +198,13 @@ public class SubtypeLocaleUtilsTests extends AndroidTestCase {
SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(DE)); SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(DE));
assertEquals("de_CH", "German (Switzerland)", assertEquals("de_CH", "German (Switzerland)",
SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(DE_CH)); SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(DE_CH));
assertEquals("hi_ZZ", "Hinglish",
SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(HI_ZZ));
assertEquals("zz", "Alphabet (QWERTY)", assertEquals("zz", "Alphabet (QWERTY)",
SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(ZZ)); 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; return null;
} }
}; };
@ -268,10 +276,13 @@ public class SubtypeLocaleUtilsTests extends AndroidTestCase {
SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(DE)); SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(DE));
assertEquals("de_CH", "Allemand (Suisse)", assertEquals("de_CH", "Allemand (Suisse)",
SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(DE_CH)); SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(DE_CH));
assertEquals("hi_ZZ", "Hindi/Anglais",
SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(HI_ZZ));
assertEquals("zz", "Alphabet latin (QWERTY)", assertEquals("zz", "Alphabet latin (QWERTY)",
SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(ZZ)); 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; return null;
} }
}; };