am 9a321180: Add unit tests for double tap shift key
* commit '9a3211802baf11e5749a080e4f451ef7b795220b': Add unit tests for double tap shift keymain
commit
08c295c5bb
|
@ -417,4 +417,41 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
|
||||||
// Release shift key, back to alphabet (not shift locked).
|
// Release shift key, back to alphabet (not shift locked).
|
||||||
releaseKey(CODE_SHIFT, ALPHABET_UNSHIFTED);
|
releaseKey(CODE_SHIFT, ALPHABET_UNSHIFTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testDoubleTapShiftAndChording() {
|
||||||
|
// TODO: The following tests fail due to bug. Temporarily commented.
|
||||||
|
// First shift key tap.
|
||||||
|
pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
||||||
|
// Second shift key tap, maybe shift locked.
|
||||||
|
secondPressKey(CODE_SHIFT, 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 shift locked).
|
||||||
|
releaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED);
|
||||||
|
|
||||||
|
// Long press shift key, enter alphabet shift locked.
|
||||||
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
|
ALPHABET_SHIFT_LOCKED);
|
||||||
|
// First shift key tap.
|
||||||
|
pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_UNSHIFTED);
|
||||||
|
// Second shift key tap, maybe shift unlocked.
|
||||||
|
secondPressKey(CODE_SHIFT, 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);
|
||||||
|
|
||||||
|
// Set capitalize the first character of all words mode.
|
||||||
|
setAutoCapsMode(CAP_MODE_WORDS);
|
||||||
|
// Load keyboard, should be in automatic shifted.
|
||||||
|
loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED);
|
||||||
|
// First shift key tap.
|
||||||
|
pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_UNSHIFTED);
|
||||||
|
// Second shift key tap, maybe shift locked.
|
||||||
|
secondPressKey(CODE_SHIFT, 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,8 +120,12 @@ public class KeyboardStateTestsBase extends AndroidTestCase
|
||||||
releaseKey(code, afterRelease);
|
releaseKey(code, afterRelease);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void secondPressAndReleaseKey(int code, int afterPress, int afterRelease) {
|
public void secondPressKey(int code, int afterPress) {
|
||||||
pressKeyWithoutTimerExpire(code, true, afterPress);
|
pressKeyWithoutTimerExpire(code, true, afterPress);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void secondPressAndReleaseKey(int code, int afterPress, int afterRelease) {
|
||||||
|
secondPressKey(code, afterPress);
|
||||||
releaseKey(code, afterRelease);
|
releaseKey(code, afterRelease);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue