diff options
Diffstat (limited to 'tests/TtsTests/src/com')
-rw-r--r-- | tests/TtsTests/src/com/android/speech/tts/TtsEnginesTests.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/TtsTests/src/com/android/speech/tts/TtsEnginesTests.java b/tests/TtsTests/src/com/android/speech/tts/TtsEnginesTests.java index 45e5216..3fbc44b 100644 --- a/tests/TtsTests/src/com/android/speech/tts/TtsEnginesTests.java +++ b/tests/TtsTests/src/com/android/speech/tts/TtsEnginesTests.java @@ -40,6 +40,19 @@ public class TtsEnginesTests extends InstrumentationTestCase { TtsEngines.toOldLocaleStringFormat(new Locale("foo"))); } + public void testNormalizeLocale() { + assertEquals(Locale.UK, + TtsEngines.normalizeTTSLocale(new Locale("eng", "gbr"))); + assertEquals(Locale.UK, + TtsEngines.normalizeTTSLocale(new Locale("eng", "GBR"))); + assertEquals(Locale.GERMANY, + TtsEngines.normalizeTTSLocale(new Locale("deu", "deu"))); + assertEquals(Locale.GERMAN, + TtsEngines.normalizeTTSLocale(new Locale("deu"))); + assertEquals(new Locale("yyy", "DE"), + TtsEngines.normalizeTTSLocale(new Locale("yyy", "DE"))); + } + public void testGetLocalePrefForEngine() { assertEquals(new Locale("en", "US"), mTtsHelper.getLocalePrefForEngine("foo","foo:en-US")); |