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/Uzbek.java58
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/TestsUzbek.java36
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/TestsUzbekQwerty.java48
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/UzbekCustomizer.java44
5 files changed, 188 insertions, 2 deletions
diff --git a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetSubtypesCountTests.java b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetSubtypesCountTests.java
index 6daf07144..503d43226 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 = 82;
- private static final int NUMBER_OF_ASCII_CAPABLE_SUBTYPES = 49;
+ private static final int NUMBER_OF_SUBTYPES = 83;
+ private static final int NUMBER_OF_ASCII_CAPABLE_SUBTYPES = 50;
private static final int NUMBER_OF_PREDEFINED_ADDITIONAL_SUBTYPES = 2;
@Override
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/Uzbek.java b/tests/src/com/android/inputmethod/keyboard/layout/Uzbek.java
new file mode 100644
index 000000000..df391a54a
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/layout/Uzbek.java
@@ -0,0 +1,58 @@
+/*
+ * 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.expected.ExpectedKey;
+import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
+
+/**
+ * The Uzbek alphabet keyboard.
+ */
+public final class Uzbek extends LayoutBase {
+ private static final String LAYOUT_NAME = "uzbek";
+
+ public Uzbek(final LayoutCustomizer customizer) {
+ super(customizer, Symbols.class, SymbolsShifted.class);
+ }
+
+ @Override
+ public String getName() { return LAYOUT_NAME; }
+
+ @Override
+ ExpectedKey[][] getCommonAlphabetLayout(final boolean isPhone) { return ALPHABET_COMMON; }
+
+ public static final String ROW1_11 = "ROW1_11";
+ public static final String ROW2_10 = "ROW2_10";
+ public static final String ROW2_11 = "ROW2_11";
+
+ private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder()
+ .setKeysOfRow(1,
+ key("q", additionalMoreKey("1")),
+ key("w", additionalMoreKey("2")),
+ key("e", additionalMoreKey("3")),
+ key("r", additionalMoreKey("4")),
+ key("t", additionalMoreKey("5")),
+ key("y", additionalMoreKey("6")),
+ key("u", additionalMoreKey("7")),
+ key("i", additionalMoreKey("8")),
+ key("o", additionalMoreKey("9")),
+ key("p", additionalMoreKey("0")),
+ ROW1_11)
+ .setKeysOfRow(2, "a", "s", "d", "f", "g", "h", "j", "k", "l", ROW2_10, ROW2_11)
+ .setKeysOfRow(3, "z", "x", "c", "v", "b", "n", "m")
+ .build();
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsUzbek.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsUzbek.java
new file mode 100644
index 000000000..e8801dd58
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsUzbek.java
@@ -0,0 +1,36 @@
+/*
+ * 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.Uzbek;
+
+import java.util.Locale;
+
+/**
+ * uz_UZ: Uzbek (Uzbekistan)/uzbek
+ */
+@SmallTest
+public final class TestsUzbek extends LayoutTestsBase {
+ private static final Locale LOCALE = new Locale("uz", "UZ");
+ private static final LayoutBase LAYOUT = new Uzbek(new UzbekCustomizer(LOCALE));
+
+ @Override
+ LayoutBase getLayout() { return LAYOUT; }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsUzbekQwerty.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsUzbekQwerty.java
new file mode 100644
index 000000000..dec587f85
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsUzbekQwerty.java
@@ -0,0 +1,48 @@
+/*
+ * 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.Qwerty;
+import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
+
+import java.util.Locale;
+
+/**
+ * uz_UZ: Uzbek (Uzbekistan)/qwerty
+ */
+@SmallTest
+public final class TestsUzbekQwerty extends LayoutTestsBase {
+ private static final Locale LOCALE = new Locale("uz", "UZ");
+ private static final LayoutBase LAYOUT = new Qwerty(new UzbekQwertyCustomizer(LOCALE));
+
+ @Override
+ LayoutBase getLayout() { return LAYOUT; }
+
+ private static class UzbekQwertyCustomizer extends UzbekCustomizer {
+ public UzbekQwertyCustomizer(final Locale locale) {
+ super(locale);
+ }
+
+ @Override
+ protected void setUzbekKeys(final ExpectedKeyboardBuilder builder) {
+ // QWERTY layout doesn't have Uzebk keys.
+ }
+ }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/UzbekCustomizer.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/UzbekCustomizer.java
new file mode 100644
index 000000000..6da0b0e45
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/UzbekCustomizer.java
@@ -0,0 +1,44 @@
+/*
+ * 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.Nordic;
+import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
+
+import java.util.Locale;
+
+class UzbekCustomizer extends TurkicCustomizer {
+ public UzbekCustomizer(final Locale locale) {
+ super(locale);
+ }
+
+ protected void setUzbekKeys(final ExpectedKeyboardBuilder builder) {
+ builder
+ // U+006F/U+02BB: "oʻ" LATIN SMALL LETTER O/MODIFIER LETTER TURNED COMMA
+ .replaceKeyOfLabel(Nordic.ROW1_11, "o\u02BB")
+ // U+0067/U+02BB: "gʻ" LATIN SMALL LETTER G/MODIFIER LETTER TURNED COMMA
+ .replaceKeyOfLabel(Nordic.ROW2_10, "g\u02BB")
+ // U+02BC: "ʼ" MODIFIER LETTER APOSTROPHE
+ .replaceKeyOfLabel(Nordic.ROW2_11, "\u02BC");
+ }
+
+ @Override
+ public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
+ setUzbekKeys(builder);
+ return super.setAccentedLetters(builder);
+ }
+} \ No newline at end of file