aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMohammadinamul Sheik <inamul@google.com>2015-02-04 12:50:31 -0800
committerMohammadinamul Sheik <inamul@google.com>2015-02-04 12:50:31 -0800
commitb00c054125d9f2aa31c2147920cc52cbf2a45ccc (patch)
treef23abce4d9b6a1ff053d86cf00cfc3874671758e /tests
parent0d3f01f3014e7a519b08c9337bc4b73670f741ef (diff)
downloadlatinime-b00c054125d9f2aa31c2147920cc52cbf2a45ccc.tar.gz
latinime-b00c054125d9f2aa31c2147920cc52cbf2a45ccc.tar.xz
latinime-b00c054125d9f2aa31c2147920cc52cbf2a45ccc.zip
AOSP changes to use KeyboardLayout to support the new DictionaryFacilitator
Change-Id: Ie0c9ce805d9ad009fc9bbaac37b715aff90cd844
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/inputmethod/keyboard/KeyboardLayoutTest.java24
1 files changed, 22 insertions, 2 deletions
diff --git a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutTest.java b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutTest.java
index 9aced5cea..733bf96e2 100644
--- a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutTest.java
+++ b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutTest.java
@@ -45,8 +45,10 @@ public class KeyboardLayoutTest {
assertEquals(0, keyboardLayout.getKeyXCoordinates().length);
assertEquals(0, keyboardLayout.getKeyYCoordinates().length);
- Key key1 = new Key("label1", 101, 102, "101", "101hint", 103, 104, 105, 106, 1100, 1101, 2, 2);
- Key key2 = new Key("label2", 201, 202, "201", "201hint", 203, 204, 205, 206, 2100, 2201, 2, 2);
+ Key key1 = new Key("label1", 101, 102, "101", "101hint", 103, 104, 105, 106, 1100, 1101,
+ 10, 10);
+ Key key2 = new Key("label2", 201, 103, "201", "201hint", 203, 204, 205, 206, 2100, 2101,
+ 10, 10);
ArrayList<Key> sortedKeys = new ArrayList<>(2);
sortedKeys.add(key1);
@@ -57,5 +59,23 @@ public class KeyboardLayoutTest {
assertEquals(2, keyboardLayout.getKeyHeights().length);
assertEquals(2, keyboardLayout.getKeyXCoordinates().length);
assertEquals(2, keyboardLayout.getKeyYCoordinates().length);
+
+ assertEquals(102, keyboardLayout.getKeyCodes()[0]);
+ // xCo + horizontalGap/2
+ assertEquals(105 + 5, keyboardLayout.getKeyXCoordinates()[0]);
+ assertEquals(106, keyboardLayout.getKeyYCoordinates()[0]);
+ // width - horizontalGap
+ assertEquals(1100 - 10, keyboardLayout.getKeyWidths()[0]);
+ // height - verticalGap
+ assertEquals(1101 - 10, keyboardLayout.getKeyHeights()[0]);
+
+ assertEquals(103, keyboardLayout.getKeyCodes()[1]);
+ // xCo + horizontalGap/2
+ assertEquals(205 + 5, keyboardLayout.getKeyXCoordinates()[1]);
+ assertEquals(206, keyboardLayout.getKeyYCoordinates()[1]);
+ // width - horizontalGap
+ assertEquals(2100 - 10, keyboardLayout.getKeyWidths()[1]);
+ // height - verticalGap
+ assertEquals(2101 - 10, keyboardLayout.getKeyHeights()[1]);
}
}