aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetSubtypesCountTests.java4
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/Greek.java8
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/ItalianCustomizer.java77
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/TestsItalian.java59
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/TestsItalianCH.java56
5 files changed, 148 insertions, 56 deletions
diff --git a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetSubtypesCountTests.java b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetSubtypesCountTests.java
index 18390b2cd..e4aaf0317 100644
--- a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetSubtypesCountTests.java
+++ b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetSubtypesCountTests.java
@@ -25,8 +25,8 @@ import java.util.ArrayList;
@SmallTest
public class KeyboardLayoutSetSubtypesCountTests extends KeyboardLayoutSetTestsBase {
- private static final int NUMBER_OF_SUBTYPES = 69;
- private static final int NUMBER_OF_ASCII_CAPABLE_SUBTYPES = 44;
+ private static final int NUMBER_OF_SUBTYPES = 70;
+ private static final int NUMBER_OF_ASCII_CAPABLE_SUBTYPES = 45;
private static final int NUMBER_OF_PREDEFINED_ADDITIONAL_SUBTYPES = 2;
private static String toString(final ArrayList<InputMethodSubtype> subtypeList) {
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/Greek.java b/tests/src/com/android/inputmethod/keyboard/layout/Greek.java
index 0ec9f4cf4..475052c75 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/Greek.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/Greek.java
@@ -85,7 +85,7 @@ public final class Greek extends LayoutBase {
key(ROW1_2, moreKey("2")),
// U+03B5: "ε" GREEK SMALL LETTER EPSILON
// U+03AD: "έ" GREEK SMALL LETTER EPSILON WITH TONOS
- key("\u03B5", joinMoreKeys("3", "\u03AD")),
+ key("\u03B5", joinMoreKeys("\u03AD", "3")),
// U+03C1: "ρ" GREEK SMALL LETTER RHO
key("\u03C1", moreKey("4")),
// U+03C4: "τ" GREEK SMALL LETTER TAU
@@ -94,17 +94,17 @@ public final class Greek extends LayoutBase {
// U+03CD: "ύ" GREEK SMALL LETTER UPSILON WITH TONOS
// U+03CB: "ϋ" GREEK SMALL LETTER UPSILON WITH DIALYTIKA
// U+03B0: "ΰ" GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
- key("\u03C5", joinMoreKeys("6", "\u03CD", "\u03CB", "\u03B0")),
+ key("\u03C5", joinMoreKeys("\u03CD", "6", "\u03CB", "\u03B0")),
// U+03B8: "θ" GREEK SMALL LETTER THETA
key("\u03B8", moreKey("7")),
// U+03B9: "ι" GREEK SMALL LETTER IOTA
// U+03AF: "ί" GREEK SMALL LETTER IOTA WITH TONOS
// U+03CA: "ϊ" GREEK SMALL LETTER IOTA WITH DIALYTIKA
// U+0390: "ΐ" GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
- key("\u03B9", joinMoreKeys("8", "\u03AF", "\u03CA", "\u0390")),
+ key("\u03B9", joinMoreKeys("\u03AF", "8", "\u03CA", "\u0390")),
// U+03BF: "ο" GREEK SMALL LETTER OMICRON
// U+03CC: "ό" GREEK SMALL LETTER OMICRON WITH TONOS
- key("\u03BF", joinMoreKeys("9", "\u03CC")),
+ key("\u03BF", joinMoreKeys("\u03CC", "9")),
// U+03C0: "π" GREEK SMALL LETTER PI
key("\u03C0", moreKey("0")))
.setKeysOfRow(2,
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/ItalianCustomizer.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/ItalianCustomizer.java
new file mode 100644
index 000000000..735070946
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/ItalianCustomizer.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.inputmethod.keyboard.layout.tests;
+
+import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
+import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
+
+import java.util.Locale;
+
+class ItalianCustomizer extends LayoutCustomizer {
+ public ItalianCustomizer(final Locale locale) { super(locale); }
+
+ @Override
+ public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
+ return builder
+ // U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE
+ // U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE
+ // U+00EA: "ê" LATIN SMALL LETTER E WITH CIRCUMFLEX
+ // U+00EB: "ë" LATIN SMALL LETTER E WITH DIAERESIS
+ // U+0119: "ę" LATIN SMALL LETTER E WITH OGONEK
+ // U+0117: "ė" LATIN SMALL LETTER E WITH DOT ABOVE
+ // U+0113: "ē" LATIN SMALL LETTER E WITH MACRON
+ .setMoreKeysOf("e",
+ "\u00E8", "\u00E9", "\u00EA", "\u00EB", "\u0119", "\u0117", "\u0113")
+ // U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE
+ // U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE
+ // U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX
+ // U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS
+ // U+016B: "ū" LATIN SMALL LETTER U WITH MACRON
+ .setMoreKeysOf("u", "\u00F9", "\u00FA", "\u00FB", "\u00FC", "\u016B")
+ // U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE
+ // U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE
+ // U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX
+ // U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS
+ // U+012F: "į" LATIN SMALL LETTER I WITH OGONEK
+ // U+012B: "ī" LATIN SMALL LETTER I WITH MACRON
+ .setMoreKeysOf("i", "\u00EC", "\u00ED", "\u00EE", "\u00EF", "\u012F", "\u012B")
+ // U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE
+ // U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE
+ // U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX
+ // U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS
+ // U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE
+ // U+0153: "œ" LATIN SMALL LIGATURE OE
+ // U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE
+ // U+014D: "ō" LATIN SMALL LETTER O WITH MACRON
+ // U+00BA: "º" MASCULINE ORDINAL INDICATOR
+ .setMoreKeysOf("o",
+ "\u00F2", "\u00F3", "\u00F4", "\u00F6", "\u00F5", "\u0153", "\u00F8",
+ "\u014D", "\u00BA")
+ // U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
+ // U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
+ // U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
+ // U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
+ // U+00E6: "æ" LATIN SMALL LETTER AE
+ // U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE
+ // U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE
+ // U+0101: "ā" LATIN SMALL LETTER A WITH MACRON
+ // U+00AA: "ª" FEMININE ORDINAL INDICATOR
+ .setMoreKeysOf("a",
+ "\u00E0", "\u00E1", "\u00E2", "\u00E4", "\u00E6", "\u00E3", "\u00E5",
+ "\u0101", "\u00AA");
+ }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsItalian.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsItalian.java
index 4a2200364..f3c610c8b 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsItalian.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsItalian.java
@@ -31,63 +31,22 @@ import java.util.Locale;
@SmallTest
public final class TestsItalian extends LayoutTestsBase {
private static final Locale LOCALE = new Locale("it");
- private static final LayoutBase LAYOUT = new Qwerty(new ItalianCustomizer(LOCALE));
+ private static final LayoutBase LAYOUT = new Qwerty(new ItalianITCustomizer(LOCALE));
@Override
LayoutBase getLayout() { return LAYOUT; }
- private static class ItalianCustomizer extends EuroCustomizer {
- public ItalianCustomizer(final Locale locale) { super(locale); }
+ private static class ItalianITCustomizer extends EuroCustomizer {
+ private final ItalianCustomizer mItalianCustomizer;
+
+ public ItalianITCustomizer(final Locale locale) {
+ super(locale);
+ mItalianCustomizer = new ItalianCustomizer(locale);
+ }
@Override
public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
- return builder
- // U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE
- // U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE
- // U+00EA: "ê" LATIN SMALL LETTER E WITH CIRCUMFLEX
- // U+00EB: "ë" LATIN SMALL LETTER E WITH DIAERESIS
- // U+0119: "ę" LATIN SMALL LETTER E WITH OGONEK
- // U+0117: "ė" LATIN SMALL LETTER E WITH DOT ABOVE
- // U+0113: "ē" LATIN SMALL LETTER E WITH MACRON
- .setMoreKeysOf("e",
- "\u00E8", "\u00E9", "\u00EA", "\u00EB", "\u0119", "\u0117", "\u0113")
- // U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE
- // U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE
- // U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX
- // U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS
- // U+016B: "ū" LATIN SMALL LETTER U WITH MACRON
- .setMoreKeysOf("u", "\u00F9", "\u00FA", "\u00FB", "\u00FC", "\u016B")
- // U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE
- // U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE
- // U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX
- // U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS
- // U+012F: "į" LATIN SMALL LETTER I WITH OGONEK
- // U+012B: "ī" LATIN SMALL LETTER I WITH MACRON
- .setMoreKeysOf("i", "\u00EC", "\u00ED", "\u00EE", "\u00EF", "\u012F", "\u012B")
- // U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE
- // U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE
- // U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX
- // U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS
- // U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE
- // U+0153: "œ" LATIN SMALL LIGATURE OE
- // U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE
- // U+014D: "ō" LATIN SMALL LETTER O WITH MACRON
- // U+00BA: "º" MASCULINE ORDINAL INDICATOR
- .setMoreKeysOf("o",
- "\u00F2", "\u00F3", "\u00F4", "\u00F6", "\u00F5", "\u0153", "\u00F8",
- "\u014D", "\u00BA")
- // U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
- // U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
- // U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
- // U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
- // U+00E6: "æ" LATIN SMALL LETTER AE
- // U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE
- // U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE
- // U+0101: "ā" LATIN SMALL LETTER A WITH MACRON
- // U+00AA: "ª" FEMININE ORDINAL INDICATOR
- .setMoreKeysOf("a",
- "\u00E0", "\u00E1", "\u00E2", "\u00E4", "\u00E6", "\u00E3", "\u00E5",
- "\u0101", "\u00AA");
+ return mItalianCustomizer.setAccentedLetters(builder);
}
}
}
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsItalianCH.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsItalianCH.java
new file mode 100644
index 000000000..d32f9e957
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsItalianCH.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.inputmethod.keyboard.layout.tests;
+
+import android.test.suitebuilder.annotation.SmallTest;
+
+import com.android.inputmethod.keyboard.layout.LayoutBase;
+import com.android.inputmethod.keyboard.layout.Swiss;
+import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
+
+import java.util.Locale;
+
+/**
+ * it_CH: Italian (Switzerland)/swiss
+ */
+@SmallTest
+public final class TestsItalianCH extends LayoutTestsBase {
+ private static final Locale LOCALE = new Locale("it", "CH");
+ private static final LayoutBase LAYOUT = new Swiss(new ItalianCHCustomizer(LOCALE));
+
+ @Override
+ LayoutBase getLayout() { return LAYOUT; }
+
+ private static class ItalianCHCustomizer extends ItalianCustomizer {
+ public ItalianCHCustomizer(final Locale locale) { super(locale); }
+
+ @Override
+ public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
+ super.setAccentedLetters(builder);
+ return builder
+ // U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS
+ // U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE
+ .replaceKeyOfLabel(Swiss.ROW1_11, key("\u00FC", moreKey("\u00E8")))
+ // U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS
+ // U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE
+ .replaceKeyOfLabel(Swiss.ROW2_10, key("\u00F6", moreKey("\u00E9")))
+ // U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
+ // U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
+ .replaceKeyOfLabel(Swiss.ROW2_11, key("\u00E4", moreKey("\u00E0")));
+ }
+ }
+}