Loading tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateMultiTouchTests.java +43 −0 Original line number Diff line number Diff line Loading @@ -375,4 +375,47 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase { // Release shift key. releaseKey(CODE_SHIFT, ALPHABET_UNSHIFTED); } public void testLongPressShiftAndChording() { // TODO: The following tests fail due to bug. Temporarily commented. // // Long press shift key, enter maybe shift locked. // longPressKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED); // // Press/release letter key, remain in manual shifted. // chordingPressAndReleaseKey('A', ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED); // // Release shift key, back to alphabet (not shift locked). // releaseKey(CODE_SHIFT, ALPHABET_UNSHIFTED); // // // Long press shift key, enter alphabet shift locked. // longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED, // ALPHABET_SHIFT_LOCKED); // // Long press shift key, enter maybe alphabet. // longPressKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_SHIFT_LOCK_SHIFTED); // // Press/release letter key, remain in manual shifted. // chordingPressAndReleaseKey('A', ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_SHIFT_LOCK_SHIFTED); // // Release shift key, back to shift locked (not alphabet). // releaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCKED); // // Long press shift key, enter alphabet // longPressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_SHIFT_LOCK_SHIFTED, // ALPHABET_UNSHIFTED); // // // Press/release shift key, enter alphabet shifted. // pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED); // // Long press shift key, enter maybe alphabet. // longPressKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED); // // Press/release letter key, remain in manual shifted. // chordingPressAndReleaseKey('A', ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED); // // Release shift key, back to alphabet shifted (not alphabet). // releaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED); // // // Set capitalize the first character of all words mode. // setAutoCapsMode(CAP_MODE_WORDS); // // Load keyboard, should be in automatic shifted. // loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED); // // Long press shift key, enter maybe shift locked. // longPressKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED); // // Press/release letter key, remain in manual shifted. // chordingPressAndReleaseKey('A', ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED); // // Release shift key, back to alphabet (not shift locked). // releaseKey(CODE_SHIFT, ALPHABET_UNSHIFTED); } } tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTestsBase.java +6 −2 Original line number Diff line number Diff line Loading @@ -108,11 +108,15 @@ public class KeyboardStateTestsBase extends AndroidTestCase assertLayout("afterSlide", afterSlide, mSwitcher.getLayoutId()); } public void longPressAndReleaseKey(int code, int afterPress, int afterLongPress, int afterRelease) { public void longPressKey(int code, int afterPress, int afterLongPress) { pressKey(code, afterPress); mSwitcher.onLongPressTimeout(code); assertLayout("afterLongPress", afterLongPress, mSwitcher.getLayoutId()); } public void longPressAndReleaseKey(int code, int afterPress, int afterLongPress, int afterRelease) { longPressKey(code, afterPress, afterLongPress); releaseKey(code, afterRelease); } Loading Loading
tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateMultiTouchTests.java +43 −0 Original line number Diff line number Diff line Loading @@ -375,4 +375,47 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase { // Release shift key. releaseKey(CODE_SHIFT, ALPHABET_UNSHIFTED); } public void testLongPressShiftAndChording() { // TODO: The following tests fail due to bug. Temporarily commented. // // Long press shift key, enter maybe shift locked. // longPressKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED); // // Press/release letter key, remain in manual shifted. // chordingPressAndReleaseKey('A', ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED); // // Release shift key, back to alphabet (not shift locked). // releaseKey(CODE_SHIFT, ALPHABET_UNSHIFTED); // // // Long press shift key, enter alphabet shift locked. // longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED, // ALPHABET_SHIFT_LOCKED); // // Long press shift key, enter maybe alphabet. // longPressKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_SHIFT_LOCK_SHIFTED); // // Press/release letter key, remain in manual shifted. // chordingPressAndReleaseKey('A', ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_SHIFT_LOCK_SHIFTED); // // Release shift key, back to shift locked (not alphabet). // releaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCKED); // // Long press shift key, enter alphabet // longPressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_SHIFT_LOCK_SHIFTED, // ALPHABET_UNSHIFTED); // // // Press/release shift key, enter alphabet shifted. // pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED); // // Long press shift key, enter maybe alphabet. // longPressKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED); // // Press/release letter key, remain in manual shifted. // chordingPressAndReleaseKey('A', ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED); // // Release shift key, back to alphabet shifted (not alphabet). // releaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED); // // // Set capitalize the first character of all words mode. // setAutoCapsMode(CAP_MODE_WORDS); // // Load keyboard, should be in automatic shifted. // loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED); // // Long press shift key, enter maybe shift locked. // longPressKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED); // // Press/release letter key, remain in manual shifted. // chordingPressAndReleaseKey('A', ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED); // // Release shift key, back to alphabet (not shift locked). // releaseKey(CODE_SHIFT, ALPHABET_UNSHIFTED); } }
tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTestsBase.java +6 −2 Original line number Diff line number Diff line Loading @@ -108,11 +108,15 @@ public class KeyboardStateTestsBase extends AndroidTestCase assertLayout("afterSlide", afterSlide, mSwitcher.getLayoutId()); } public void longPressAndReleaseKey(int code, int afterPress, int afterLongPress, int afterRelease) { public void longPressKey(int code, int afterPress, int afterLongPress) { pressKey(code, afterPress); mSwitcher.onLongPressTimeout(code); assertLayout("afterLongPress", afterLongPress, mSwitcher.getLayoutId()); } public void longPressAndReleaseKey(int code, int afterPress, int afterLongPress, int afterRelease) { longPressKey(code, afterPress, afterLongPress); releaseKey(code, afterRelease); } Loading