diff options
author | 2011-12-26 23:40:09 +0900 | |
---|---|---|
committer | 2012-01-10 15:13:05 +0900 | |
commit | ee4be6e3c6eed719683fd3019d48365ba76790e2 (patch) | |
tree | 674c5753ad538d65d27d454bc3efc3b61a58333c /tests/src | |
parent | 8edd3067181a425ce1383bb950184f9742af7557 (diff) | |
download | latinime-ee4be6e3c6eed719683fd3019d48365ba76790e2.tar.gz latinime-ee4be6e3c6eed719683fd3019d48365ba76790e2.tar.xz latinime-ee4be6e3c6eed719683fd3019d48365ba76790e2.zip |
Call KeyboardState.onUpdateShiftState from onCodeInput if code is a normal letter
This will be helpful to write unit test code.
Change-Id: Ib61cc46ac547084e0dc9ecd3a50814fecf08ace2
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTests.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTests.java b/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTests.java index 3cd6a8944..1f6141e50 100644 --- a/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTests.java +++ b/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTests.java @@ -90,7 +90,8 @@ public class KeyboardStateTests extends AndroidTestCase { // Argument for KeyboardState.onCodeInput. private static final boolean SINGLE = true; private static final boolean MULTI = false; - + private static final boolean NO_AUTO_CAPS = false; + private static final boolean AUTO_CAPS = true; private void assertAlphabetNormal() { assertEquals(ALPHABET_UNSHIFTED, mSwitcher.mLayout); @@ -213,7 +214,7 @@ public class KeyboardStateTests extends AndroidTestCase { // Long press recognized in LatinKeyboardView.KeyTimerHandler. mState.onToggleCapsLock(); assertAlphabetShiftLocked(); - mState.onCodeInput(Keyboard.CODE_CAPSLOCK, SINGLE); + mState.onCodeInput(Keyboard.CODE_CAPSLOCK, SINGLE, NO_AUTO_CAPS); assertAlphabetShiftLocked(); mState.onReleaseShift(NOT_SLIDING); assertAlphabetShiftLocked(); @@ -224,7 +225,7 @@ public class KeyboardStateTests extends AndroidTestCase { // Long press recognized in LatinKeyboardView.KeyTimerHandler. mState.onToggleCapsLock(); assertAlphabetNormal(); - mState.onCodeInput(Keyboard.CODE_CAPSLOCK, SINGLE); + mState.onCodeInput(Keyboard.CODE_CAPSLOCK, SINGLE, NO_AUTO_CAPS); assertAlphabetNormal(); mState.onReleaseShift(NOT_SLIDING); assertAlphabetNormal(); @@ -236,7 +237,7 @@ public class KeyboardStateTests extends AndroidTestCase { // First shift key tap. mState.onPressShift(NOT_SLIDING); assertAlphabetManualShifted(); - mState.onCodeInput(Keyboard.CODE_SHIFT, SINGLE); + mState.onCodeInput(Keyboard.CODE_SHIFT, SINGLE, NO_AUTO_CAPS); assertAlphabetManualShifted(); mState.onReleaseShift(NOT_SLIDING); assertAlphabetManualShifted(); @@ -244,13 +245,13 @@ public class KeyboardStateTests extends AndroidTestCase { // Double tap recognized in LatinKeyboardView.KeyTimerHandler. mState.onToggleCapsLock(); assertAlphabetShiftLocked(); - mState.onCodeInput(Keyboard.CODE_SHIFT, SINGLE); + mState.onCodeInput(Keyboard.CODE_SHIFT, SINGLE, NO_AUTO_CAPS); assertAlphabetShiftLocked(); // First shift key tap. mState.onPressShift(NOT_SLIDING); assertAlphabetManualShifted(); - mState.onCodeInput(Keyboard.CODE_SHIFT, SINGLE); + mState.onCodeInput(Keyboard.CODE_SHIFT, SINGLE, NO_AUTO_CAPS); assertAlphabetManualShifted(); mState.onReleaseShift(NOT_SLIDING); assertAlphabetNormal(); |