summaryrefslogtreecommitdiffstats
path: root/tests/TtsTests
diff options
context:
space:
mode:
authorPrzemyslaw Szczepaniak <pszczepaniak@google.com>2014-07-01 17:04:25 +0100
committerPrzemyslaw Szczepaniak <pszczepaniak@google.com>2014-07-04 11:28:06 +0100
commitad6df74ada7c478257425b746588f22eeec199a6 (patch)
treefa5675220d901f86dc3b5c264fefe45bffb6637c /tests/TtsTests
parent96aacd2a2c04f5feeb58e025cacc3c83fc902339 (diff)
downloadframeworks_base-ad6df74ada7c478257425b746588f22eeec199a6.zip
frameworks_base-ad6df74ada7c478257425b746588f22eeec199a6.tar.gz
frameworks_base-ad6df74ada7c478257425b746588f22eeec199a6.tar.bz2
Add support for voices in TTS API.
Voices allow to expose multiple backends/voice packs for a single Locale. This is an attempt to port this feature from V2 API. Bug: 15834470 Change-Id: I0117de238cfcf028bcec5344b8d65c960b96b98c
Diffstat (limited to 'tests/TtsTests')
-rw-r--r--tests/TtsTests/src/com/android/speech/tts/TtsEnginesTests.java13
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"));