aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/Arabic.java355
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/Azerty.java77
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/TestsArabic.java37
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/TestsDutchBE.java108
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/TestsFrench.java101
5 files changed, 678 insertions, 0 deletions
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/Arabic.java b/tests/src/com/android/inputmethod/keyboard/layout/Arabic.java
new file mode 100644
index 000000000..65b050be7
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/layout/Arabic.java
@@ -0,0 +1,355 @@
+/*
+ * 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;
+
+import com.android.inputmethod.keyboard.layout.Symbols.RtlSymbols;
+import com.android.inputmethod.keyboard.layout.SymbolsShifted.RtlSymbolsShifted;
+import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
+import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
+import com.android.inputmethod.latin.Constants;
+
+import java.util.Locale;
+
+public final class Arabic extends LayoutBase {
+ private static final String LAYOUT_NAME = "arabic";
+
+ public Arabic(final LayoutCustomizer customizer) {
+ super(customizer, ArabicSymbols.class, ArabicSymbolsShifted.class);
+ }
+
+ @Override
+ public String getName() { return LAYOUT_NAME; }
+
+ public static class ArabicCustomizer extends LayoutCustomizer {
+ public ArabicCustomizer(final Locale locale) {
+ super(locale);
+ }
+
+ @Override
+ public ExpectedKey getAlphabetKey() { return ARABIC_ALPHABET_KEY; }
+
+ @Override
+ public ExpectedKey getSymbolsKey() { return ARABIC_SYMBOLS_KEY; }
+
+ @Override
+ public ExpectedKey getBackToSymbolsKey() { return ARABIC_BACK_TO_SYMBOLS_KEY; }
+
+ @Override
+ public ExpectedKey[] getDoubleAngleQuoteKeys() {
+ return RtlSymbols.DOUBLE_ANGLE_QUOTES_LR_RTL;
+ }
+
+ @Override
+ public ExpectedKey[] getSingleAngleQuoteKeys() {
+ return RtlSymbols.SINGLE_ANGLE_QUOTES_LR_RTL;
+ }
+
+ @Override
+ public ExpectedKey[] getLeftShiftKeys(final boolean isPhone) {
+ return EMPTY_KEYS;
+ }
+
+ @Override
+ public ExpectedKey[] getRightShiftKeys(final boolean isPhone) {
+ return EMPTY_KEYS;
+ }
+
+ @Override
+ public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) {
+ if (isPhone) {
+ // U+060C: "،" ARABIC COMMA
+ return joinKeys(key("\u060C", joinMoreKeys(",", SETTINGS_KEY)));
+ }
+ return super.getKeysLeftToSpacebar(isPhone);
+ }
+
+ @Override
+ public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) {
+ if (isPhone) {
+ return super.getKeysRightToSpacebar(isPhone);
+ }
+ // U+060C: "،" ARABIC COMMA
+ // U+061F: "؟" ARABIC QUESTION MARK
+ // U+061B: "؛" ARABIC SEMICOLON
+ return joinKeys(
+ key("\u060C", joinMoreKeys(":", "!", "\u061F", "\u061B", "-", "/", "\"", "'")),
+ key(".", getPunctuationMoreKeys(isPhone)));
+ }
+
+ @Override
+ public ExpectedKey[] getPunctuationMoreKeys(final boolean isPhone) {
+ return ARABIC_DIACRITICS;
+ }
+
+ // U+0623: "ا" ARABIC LETTER ALEF
+ // U+200C: ZERO WIDTH NON-JOINER
+ // U+0628: "ب" ARABIC LETTER BEH
+ // U+062C: "پ" ARABIC LETTER PEH
+ private static final ExpectedKey ARABIC_ALPHABET_KEY = key(
+ "\u0623\u200C\u0628\u200C\u062C", Constants.CODE_SWITCH_ALPHA_SYMBOL);
+ // U+0663: "٣" ARABIC-INDIC DIGIT THREE
+ // U+0662: "٢" ARABIC-INDIC DIGIT TWO
+ // U+0661: "١" ARABIC-INDIC DIGIT ONE
+ // U+061F: "؟" ARABIC QUESTION MARK
+ private static final ExpectedKey ARABIC_SYMBOLS_KEY = key(
+ "\u0663\u0662\u0661\u061F", Constants.CODE_SWITCH_ALPHA_SYMBOL);
+ // U+0663: "٣" ARABIC-INDIC DIGIT THREE
+ // U+0662: "٢" ARABIC-INDIC DIGIT TWO
+ // U+0661: "١" ARABIC-INDIC DIGIT ONE
+ // U+061F: "؟" ARABIC QUESTION MARK
+ private static final ExpectedKey ARABIC_BACK_TO_SYMBOLS_KEY = key(
+ "\u0663\u0662\u0661\u061F", Constants.CODE_SHIFT);
+
+ private static final ExpectedKey[] ARABIC_DIACRITICS = {
+ // U+0655: "ٕ" ARABIC HAMZA BELOW
+ // U+0654: "ٔ" ARABIC HAMZA ABOVE
+ // U+0652: "ْ" ARABIC SUKUN
+ // U+064D: "ٍ" ARABIC KASRATAN
+ // U+064C: "ٌ" ARABIC DAMMATAN
+ // U+064B: "ً" ARABIC FATHATAN
+ // U+0651: "ّ" ARABIC SHADDA
+ // U+0656: "ٖ" ARABIC SUBSCRIPT ALEF
+ // U+0670: "ٰ" ARABIC LETTER SUPERSCRIPT ALEF
+ // U+0653: "ٓ" ARABIC MADDAH ABOVE
+ // U+0650: "ِ" ARABIC KASRA
+ // U+064F: "ُ" ARABIC DAMMA
+ // U+064E: "َ" ARABIC FATHA
+ // U+0640: "ـ" ARABIC TATWEEL
+ moreKey(" \u0655", "\u0655"), moreKey(" \u0654", "\u0654"),
+ moreKey(" \u0652", "\u0652"), moreKey(" \u064D", "\u064D"),
+ moreKey(" \u064C", "\u064C"), moreKey(" \u064B", "\u064B"),
+ moreKey(" \u0651", "\u0651"), moreKey(" \u0656", "\u0656"),
+ moreKey(" \u0670", "\u0670"), moreKey(" \u0653", "\u0653"),
+ moreKey(" \u0650", "\u0650"), moreKey(" \u064F", "\u064F"),
+ moreKey(" \u064E", "\u064E"), moreKey("\u0640\u0640\u0640", "\u0640")
+ };
+ }
+
+ @Override
+ ExpectedKey[][] getCommonAlphabetLayout(final boolean isPhone) {
+ if (isPhone) {
+ return ALPHABET_COMMON;
+ } else {
+ final ExpectedKeyboardBuilder builder = new ExpectedKeyboardBuilder(ALPHABET_COMMON);
+ // U+0626: "ئ" ARABIC LETTER YEH WITH HAMZA ABOVE
+ builder.insertKeysAtRow(3, 2, key("\u0626"));
+ return builder.build();
+ }
+ }
+
+ @Override
+ ExpectedKey[][] getCommonAlphabetShiftLayout(final boolean isPhone, final int elementId) {
+ return null;
+ }
+
+ private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder()
+ .setKeysOfRow(1,
+ // U+0636: "ض" ARABIC LETTER DAD
+ // U+0661: "١" ARABIC-INDIC DIGIT ONE
+ key("\u0636", joinMoreKeys("1", "\u0661")),
+ // U+0635: "ص" ARABIC LETTER SAD
+ // U+0662: "٢" ARABIC-INDIC DIGIT TWO
+ key("\u0635", joinMoreKeys("2", "\u0662")),
+ // U+062B: "ث" ARABIC LETTER THEH
+ // U+0663: "٣" ARABIC-INDIC DIGIT THREE
+ key("\u062B", joinMoreKeys("3", "\u0663")),
+ // U+0642: "ق" ARABIC LETTER QAF
+ // U+0664: "٤" ARABIC-INDIC DIGIT FOUR
+ // U+06A8: "ڨ" ARABIC LETTER QAF WITH THREE DOTS ABOVE
+ key("\u0642", joinMoreKeys("4", "\u0664", "\u06A8")),
+ // U+0641: "ف" ARABIC LETTER FEH
+ // U+0665: "٥" ARABIC-INDIC DIGIT FIVE
+ // U+06A4: "ڤ" ARABIC LETTER VEH
+ // U+06A2: "ڢ" ARABIC LETTER FEH WITH DOT MOVED BELOW
+ // U+06A5: "ڥ" ARABIC LETTER FEH WITH THREE DOTS BELOW
+ key("\u0641", joinMoreKeys("5", "\u0665", "\u06A4", "\u06A2", "\u06A5")),
+ // U+063A: "غ" ARABIC LETTER GHAIN
+ // U+0666: "٦" ARABIC-INDIC DIGIT SIX
+ key("\u063A", joinMoreKeys("6", "\u0666")),
+ // U+0639: "ع" ARABIC LETTER AIN
+ // U+0667: "٧" ARABIC-INDIC DIGIT SEVEN
+ key("\u0639", joinMoreKeys("7", "\u0667")),
+ // U+0647: "ه" ARABIC LETTER HEH
+ // U+0668: "٨" ARABIC-INDIC DIGIT EIGHT
+ // U+FEEB: "ﻫ" ARABIC LETTER HEH INITIAL FORM
+ // U+0647 U+200D: ARABIC LETTER HEH + ZERO WIDTH JOINER
+ key("\u0647", joinMoreKeys("8", "\u0668", moreKey("\uFEEB", "\u0647\u200D"))),
+ // U+062E: "خ" ARABIC LETTER KHAH
+ // U+0669: "٩" ARABIC-INDIC DIGIT NINE
+ key("\u062E", joinMoreKeys("9", "\u0669")),
+ // U+062D: "ح" ARABIC LETTER HAH
+ // U+0660: "٠" ARABIC-INDIC DIGIT ZERO
+ key("\u062D", joinMoreKeys("0", "\u0660")),
+ // U+062C: "ج" ARABIC LETTER JEEM
+ // U+0686: "چ" ARABIC LETTER TCHEH
+ key("\u062C", moreKey("\u0686")))
+ .setKeysOfRow(2,
+ // U+0634: "ش" ARABIC LETTER SHEEN
+ // U+069C: "ڜ" ARABIC LETTER SEEN WITH THREE DOTS BELOW AND THREE DOTS ABOVE
+ key("\u0634", moreKey("\u069C")),
+ // U+0633: "س" ARABIC LETTER SEEN
+ key("\u0633"),
+ // U+064A: "ي" ARABIC LETTER YEH
+ // U+0626: "ئ" ARABIC LETTER YEH WITH HAMZA ABOVE
+ // U+0649: "ى" ARABIC LETTER ALEF MAKSURA
+ key("\u064A", joinMoreKeys("\u0626", "\u0649")),
+ // U+0628: "ب" ARABIC LETTER BEH
+ // U+067E: "پ" ARABIC LETTER PEH
+ key("\u0628", moreKey("\u067E")),
+ // U+0644: "ل" ARABIC LETTER LAM
+ // U+FEFB: "ﻻ" ARABIC LIGATURE LAM WITH ALEF ISOLATED FORM
+ // U+0627: "ا" ARABIC LETTER ALEF
+ // U+FEF7: "ﻷ" ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE ISOLATED FORM
+ // U+0623: "أ" ARABIC LETTER ALEF WITH HAMZA ABOVE
+ // U+FEF9: "ﻹ" ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW ISOLATED FORM
+ // U+0625: "إ" ARABIC LETTER ALEF WITH HAMZA BELOW
+ // U+FEF5: "ﻵ" ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE ISOLATED FORM
+ // U+0622: "آ" ARABIC LETTER ALEF WITH MADDA ABOVE -->
+ key("\u0644",
+ moreKey("\uFEFB", "\u0644\u0627"), moreKey("\uFEF7", "\u0644\u0623"),
+ moreKey("\uFEF9", "\u0644\u0625"), moreKey("\uFEF5", "\u0644\u0622")),
+ // U+0627: "ا" ARABIC LETTER ALEF
+ // U+0622: "آ" ARABIC LETTER ALEF WITH MADDA ABOVE
+ // U+0621: "ء" ARABIC LETTER HAMZA
+ // U+0623: "أ" ARABIC LETTER ALEF WITH HAMZA ABOVE
+ // U+0625: "إ" ARABIC LETTER ALEF WITH HAMZA BELOW
+ // U+0671: "ٱ" ARABIC LETTER ALEF WASLA
+ key("\u0627", joinMoreKeys("\u0622", "\u0621", "\u0623", "\u0625", "\u0671")),
+ // U+062A: "ت" ARABIC LETTER TEH
+ key("\u062A"),
+ // U+0646: "ن" ARABIC LETTER NOON
+ key("\u0646"),
+ // U+0645: "م" ARABIC LETTER MEEM
+ key("\u0645"),
+ // U+0643: "ك" ARABIC LETTER KAF
+ // U+06AF: "گ" ARABIC LETTER GAF
+ // U+06A9: "ک" ARABIC LETTER KEHEH
+ key("\u0643", joinMoreKeys("\u06AF", "\u06A9")),
+ // U+0637: "ط" ARABIC LETTER TAH
+ key("\u0637"))
+ .setKeysOfRow(3, joinKeys(
+ // U+0630: "ذ" ARABIC LETTER THAL
+ // U+0621: "ء" ARABIC LETTER HAMZA
+ // U+0624: "ؤ" ARABIC LETTER WAW WITH HAMZA ABOVE
+ // U+0631: "ر" ARABIC LETTER REH
+ "\u0630", "\u0621", "\u0624", "\u0631",
+ // U+0649: "ى" ARABIC LETTER ALEF MAKSURA
+ // U+0626: "ئ" ARABIC LETTER YEH WITH HAMZA ABOVE
+ key("\u0649", moreKey("\u0626")),
+ // U+0629: "ة" ARABIC LETTER TEH MARBUTA
+ // U+0648: "و" ARABIC LETTER WAW
+ "\u0629", "\u0648",
+ // U+0632: "ز" ARABIC LETTER ZAIN
+ // U+0698: "ژ" ARABIC LETTER JEH
+ key("\u0632", moreKey("\u0698")),
+ // U+0638: "ظ" ARABIC LETTER ZAH
+ // U+062F: "د" ARABIC LETTER DAL
+ "\u0638", "\u062F"))
+ .build();
+
+ private static class ArabicSymbols extends RtlSymbols {
+ public ArabicSymbols(final LayoutCustomizer customizer) {
+ super(customizer);
+ }
+
+ @Override
+ public ExpectedKey[][] getLayout(final boolean isPhone) {
+ return new ExpectedKeyboardBuilder(super.getLayout(isPhone))
+ // U+0661: "١" ARABIC-INDIC DIGIT ONE
+ // U+00B9: "¹" SUPERSCRIPT ONE
+ // U+00BD: "½" VULGAR FRACTION ONE HALF
+ // U+2153: "⅓" VULGAR FRACTION ONE THIRD
+ // U+00BC: "¼" VULGAR FRACTION ONE QUARTER
+ // U+215B: "⅛" VULGAR FRACTION ONE EIGHTH
+ .replaceKeyOfLabel("1", key("\u0661",
+ joinMoreKeys("1", "\u00B9", "\u00BD", "\u2153", "\u00BC", "\u215B")))
+ // U+0662: "٢" ARABIC-INDIC DIGIT TWO
+ // U+00B2: "²" SUPERSCRIPT TWO
+ // U+2154: "⅔" VULGAR FRACTION TWO THIRDS
+ .replaceKeyOfLabel("2", key("\u0662", joinMoreKeys("2", "\u00B2", "\u2154")))
+ // U+0663: "٣" ARABIC-INDIC DIGIT THREE
+ // U+00B3: "³" SUPERSCRIPT THREE
+ // U+00BE: "¾" VULGAR FRACTION THREE QUARTERS
+ // U+215C: "⅜" VULGAR FRACTION THREE EIGHTHS
+ .replaceKeyOfLabel("3", key("\u0663",
+ joinMoreKeys("3", "\u00B3", "\u00BE", "\u215C")))
+ // U+0664: "٤" ARABIC-INDIC DIGIT FOUR
+ // U+2074: "⁴" SUPERSCRIPT FOUR
+ .replaceKeyOfLabel("4", key("\u0664", joinMoreKeys("4", "\u2074")))
+ // U+0665: "٥" ARABIC-INDIC DIGIT FIVE
+ // U+215D: "⅝" VULGAR FRACTION FIVE EIGHTHS
+ .replaceKeyOfLabel("5", key("\u0665", joinMoreKeys("5", "\u215D")))
+ // U+0666: "٦" ARABIC-INDIC DIGIT SIX
+ .replaceKeyOfLabel("6", key("\u0666", moreKey("6")))
+ // U+0667: "٧" ARABIC-INDIC DIGIT SEVEN
+ // U+215E: "⅞" VULGAR FRACTION SEVEN EIGHTHS
+ .replaceKeyOfLabel("7", key("\u0667", joinMoreKeys("7", "\u215E")))
+ // U+0668: "٨" ARABIC-INDIC DIGIT EIGHT
+ .replaceKeyOfLabel("8", key("\u0668", moreKey("8")))
+ // U+0669: "٩" ARABIC-INDIC DIGIT NINE
+ .replaceKeyOfLabel("9", key("\u0669", moreKey("9")))
+ // U+0660: "٠" ARABIC-INDIC DIGIT ZERO
+ // U+066B: "٫" ARABIC DECIMAL SEPARATOR
+ // U+066C: "٬" ARABIC THOUSANDS SEPARATOR
+ // U+207F: "ⁿ" SUPERSCRIPT LATIN SMALL LETTER N
+ // U+2205: "∅" EMPTY SET
+ .replaceKeyOfLabel("0", key("\u0660",
+ joinMoreKeys("0", "\u066B", "\u066C", "\u207F", "\u2205")))
+ // U+066A: "٪" ARABIC PERCENT SIGN
+ // U+2030: "‰" PER MILLE SIGN
+ .replaceKeyOfLabel("%", key("\u066A", joinMoreKeys("%", "\u2030")))
+ // U+061B: "؛" ARABIC SEMICOLON
+ .replaceKeyOfLabel(";", key("\u061B", moreKey(";")))
+ // U+061F: "؟" ARABIC QUESTION MARK
+ // U+00BF: "¿" INVERTED QUESTION MARK
+ .replaceKeyOfLabel("?", key("\u061F", joinMoreKeys("?", "\u00BF")))
+ // U+060C: "،" ARABIC COMMA
+ .replaceKeyOfLabel(",", key("\u060C", moreKey(",")))
+ // U+FD3E: "﴾" ORNATE LEFT PARENTHESIS
+ // U+FD3F: "﴿" ORNATE RIGHT PARENTHESIS
+ .replaceKeyOfLabel("(", key("(", ")",
+ moreKey("\uFD3E", "\uFD3F"), moreKey("<", ">"), moreKey("{", "}"),
+ moreKey("[", "]")))
+ // U+FD3F: "﴿" ORNATE RIGHT PARENTHESIS
+ // U+FD3E: "﴾" ORNATE LEFT PARENTHESIS
+ .replaceKeyOfLabel(")", key(")", "(",
+ moreKey("\uFD3F", "\uFD3E"), moreKey(">", "<"), moreKey("}", "{"),
+ moreKey("]", "[")))
+ // U+2605: "★" BLACK STAR
+ // U+066D: "٭" ARABIC FIVE POINTED STAR
+ .setMoreKeysOf("*", "\u2605", "\u066D")
+ .build();
+ }
+ }
+
+ private static class ArabicSymbolsShifted extends RtlSymbolsShifted {
+ public ArabicSymbolsShifted(final LayoutCustomizer customizer) {
+ super(customizer);
+ }
+
+ @Override
+ public ExpectedKey[][] getLayout(final boolean isPhone) {
+ return new ExpectedKeyboardBuilder(super.getLayout(isPhone))
+ // U+2022: "•" BULLET
+ // U+266A: "♪" EIGHTH NOTE
+ .setMoreKeysOf("\u2022", "\u266A")
+ // U+060C: "،" ARABIC COMMA
+ .replaceKeyOfLabel(",", key("\u060C", moreKey(",")))
+ .build();
+ }
+ }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/Azerty.java b/tests/src/com/android/inputmethod/keyboard/layout/Azerty.java
new file mode 100644
index 000000000..24d85cf76
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/layout/Azerty.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;
+
+import com.android.inputmethod.keyboard.KeyboardId;
+import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
+import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
+
+/**
+ * The AZERTY alphabet keyboard.
+ */
+public final class Azerty extends LayoutBase {
+ public Azerty(final LayoutCustomizer customizer) {
+ super(customizer, Symbols.class, SymbolsShifted.class);
+ }
+
+ @Override
+ public String getName() { return "azerty"; }
+
+ @Override
+ ExpectedKey[][] getCommonAlphabetLayout(final boolean isPhone) {
+ final LayoutCustomizer customizer = getCustomizer();
+ final ExpectedKeyboardBuilder builder = new ExpectedKeyboardBuilder(ALPHABET_COMMON);
+ customizer.setAccentedLetters(builder);
+ builder.replaceKeyOfLabel(ROW3_QUOTE, key("'", joinMoreKeys(
+ customizer.getSingleQuoteMoreKeys(),
+ customizer.getSingleAngleQuoteKeys())));
+ return builder.build();
+ }
+
+ @Override
+ ExpectedKey[][] getCommonAlphabetShiftLayout(final boolean isPhone, final int elementId) {
+ final ExpectedKeyboardBuilder builder;
+ if (elementId == KeyboardId.ELEMENT_ALPHABET_AUTOMATIC_SHIFTED
+ || elementId == KeyboardId.ELEMENT_ALPHABET_SHIFT_LOCKED) {
+ builder = new ExpectedKeyboardBuilder(getCommonAlphabetLayout(isPhone));
+ } else {
+ builder = new ExpectedKeyboardBuilder(ALPHABET_COMMON);
+ getCustomizer().setAccentedLetters(builder);
+ builder.replaceKeyOfLabel(ROW3_QUOTE, key("?"));
+ }
+ builder.toUpperCase(getLocale());
+ return builder.build();
+ }
+
+ private static final String ROW3_QUOTE = "ROW3_QUOUTE";
+
+ private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder()
+ .setKeysOfRow(1,
+ key("a", moreKey("1")),
+ key("z", moreKey("2")),
+ key("e", moreKey("3")),
+ key("r", moreKey("4")),
+ key("t", moreKey("5")),
+ key("y", moreKey("6")),
+ key("u", moreKey("7")),
+ key("i", moreKey("8")),
+ key("o", moreKey("9")),
+ key("p", moreKey("0")))
+ .setLabelsOfRow(2, "q", "s", "d", "f", "g", "h", "j", "k", "l", "m")
+ .setLabelsOfRow(3, "w", "x", "c", "v", "b", "n", ROW3_QUOTE)
+ .build();
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsArabic.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsArabic.java
new file mode 100644
index 000000000..7c97df5af
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsArabic.java
@@ -0,0 +1,37 @@
+/*
+ * 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.Arabic;
+import com.android.inputmethod.keyboard.layout.Arabic.ArabicCustomizer;
+import com.android.inputmethod.keyboard.layout.LayoutBase;
+
+import java.util.Locale;
+
+/**
+ * ar: TestsArabic/arabic
+ */
+@SmallTest
+public class TestsArabic extends LayoutTestsBase {
+ private static final Locale LOCALE = new Locale("ar");
+ private static final LayoutBase LAYOUT = new Arabic(new ArabicCustomizer(LOCALE));
+
+ @Override
+ LayoutBase getLayout() { return LAYOUT; }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsDutchBE.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsDutchBE.java
new file mode 100644
index 000000000..aa706f601
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsDutchBE.java
@@ -0,0 +1,108 @@
+/*
+ * 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.Azerty;
+import com.android.inputmethod.keyboard.layout.LayoutBase;
+import com.android.inputmethod.keyboard.layout.LayoutBase.EuroLayoutCustomizer;
+import com.android.inputmethod.keyboard.layout.Symbols;
+import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
+import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
+
+import java.util.Locale;
+
+/**
+ * nl_BE: Dutch (Belgium)/azerty
+ */
+@SmallTest
+public final class TestsDutchBE extends LayoutTestsBase {
+ private static final Locale LOCALE = new Locale("nl", "BE");
+ private static final LayoutBase LAYOUT = new Azerty(new DutchBECustomizer(LOCALE));
+
+ @Override
+ LayoutBase getLayout() { return LAYOUT; }
+
+ private static class DutchBECustomizer extends EuroLayoutCustomizer {
+ public DutchBECustomizer(final Locale locale) { super(locale); }
+
+ @Override
+ public ExpectedKey[] getDoubleQuoteMoreKeys() { return Symbols.DOUBLE_QUOTES_L9R; }
+
+ @Override
+ public ExpectedKey[] getSingleQuoteMoreKeys() { return Symbols.SINGLE_QUOTES_L9R; }
+
+ @Override
+ public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
+ return builder
+ // U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
+ // U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
+ // U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
+ // U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
+ // 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
+ .setMoreKeysOf("a",
+ "1", "\u00E1", "\u00E4", "\u00E2", "\u00E0", "\u00E6", "\u00E3",
+ "\u00E5", "\u0101")
+ // U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE
+ // U+00EB: "ë" LATIN SMALL LETTER E WITH DIAERESIS
+ // U+00EA: "ê" LATIN SMALL LETTER E WITH CIRCUMFLEX
+ // U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE
+ // 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",
+ "3", "\u00E9", "\u00EB", "\u00EA", "\u00E8", "\u0119", "\u0117",
+ "\u0113")
+ // U+0133: "ij" LATIN SMALL LIGATURE IJ
+ .setMoreKeysOf("y", "6", "\u0133")
+ // U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE
+ // U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS
+ // U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX
+ // U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE
+ // U+016B: "ū" LATIN SMALL LETTER U WITH MACRON
+ .setMoreKeysOf("u", "7", "\u00FA", "\u00FC", "\u00FB", "\u00F9", "\u016B")
+ // U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE
+ // U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS
+ // U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE
+ // U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX
+ // U+012F: "į" LATIN SMALL LETTER I WITH OGONEK
+ // U+012B: "ī" LATIN SMALL LETTER I WITH MACRON
+ // U+0133: "ij" LATIN SMALL LIGATURE IJ
+ .setMoreKeysOf("i",
+ "8", "\u00ED", "\u00EF", "\u00EC", "\u00EE", "\u012F", "\u012B",
+ "\u0133")
+ // U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE
+ // U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS
+ // U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX
+ // U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE
+ // 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
+ .setMoreKeysOf("o",
+ "9", "\u00F3", "\u00F6", "\u00F4", "\u00F2", "\u00F5", "\u0153",
+ "\u00F8", "\u014D")
+ // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE
+ // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE
+ .setMoreKeysOf("n", "\u00F1", "\u0144");
+ }
+ }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsFrench.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsFrench.java
new file mode 100644
index 000000000..5f8ecd6e1
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsFrench.java
@@ -0,0 +1,101 @@
+/*
+ * 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.Azerty;
+import com.android.inputmethod.keyboard.layout.LayoutBase;
+import com.android.inputmethod.keyboard.layout.LayoutBase.EuroLayoutCustomizer;
+import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
+
+import java.util.Locale;
+
+/**
+ * fr: French/azerty
+ */
+@SmallTest
+public final class TestsFrench extends LayoutTestsBase {
+ private static final Locale LOCALE = new Locale("fr");
+ private static final LayoutBase LAYOUT = new Azerty(new FrenchCustomizer(LOCALE));
+
+ @Override
+ LayoutBase getLayout() { return LAYOUT; }
+
+ private static class FrenchCustomizer extends EuroLayoutCustomizer {
+ public FrenchCustomizer(final Locale locale) { super(locale); }
+
+ @Override
+ public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
+ return builder
+ // U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
+ // U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
+ // U+00E6: "æ" LATIN SMALL LETTER AE
+ // U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
+ // U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
+ // 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", "\u00E2", "1", "\u00E6", "\u00E1", "\u00E4", "\u00E3",
+ "\u00E5", "\u0101", "\u00AA")
+ // U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE
+ // U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE
+ // 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",
+ "\u00E9", "\u00E8", "\u00EA", "\u00EB", "3", "\u0119", "\u0117",
+ "\u0113")
+ // U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS
+ .setMoreKeysOf("y", "6", "\u00FF")
+ // U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE
+ // U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX
+ // U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS
+ // U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE
+ // U+016B: "ū" LATIN SMALL LETTER U WITH MACRON
+ .setMoreKeysOf("u", "\u00F9", "\u00FB", "7", "\u00FC", "\u00FA", "\u016B")
+ // U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX
+ // U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS
+ // U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE
+ // U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE
+ // U+012F: "į" LATIN SMALL LETTER I WITH OGONEK
+ // U+012B: "ī" LATIN SMALL LETTER I WITH MACRON
+ .setMoreKeysOf("i", "\u00EE", "8", "\u00EF", "\u00EC", "\u00ED", "\u012F",
+ "\u012B")
+ // U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX
+ // U+0153: "œ" LATIN SMALL LIGATURE OE
+ // U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS
+ // U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE
+ // U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE
+ // U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE
+ // U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE
+ // U+014D: "ō" LATIN SMALL LETTER O WITH MACRON
+ // U+00BA: "º" MASCULINE ORDINAL INDICATOR
+ .setMoreKeysOf("o",
+ "\u00F4", "\u0153", "9", "\u00F6", "\u00F2", "\u00F3", "\u00F5",
+ "\u00F8", "\u014D", "\u00BA")
+ // U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA
+ // U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE
+ // U+010D: "č" LATIN SMALL LETTER C WITH CARON
+ .setMoreKeysOf("c", "\u00E7", "\u0107", "\u010D");
+ }
+ }
+} \ No newline at end of file