Merge "More precise KeyboardState unit test" into jb-dev
This commit is contained in:
commit
16531ad52f
3 changed files with 68 additions and 39 deletions
|
@ -57,7 +57,8 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
|
|||
// Chording input in shift locked.
|
||||
public void testChordingShiftLocked() {
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
|
||||
// Press shift key and hold, enter into choring shift state.
|
||||
pressKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED);
|
||||
|
@ -115,7 +116,8 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
|
|||
// Load keyboard
|
||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
// Press/release "?123" key, enter into symbols.
|
||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||
// Press "ABC" key, enter into chording alphabet shift locked.
|
||||
|
@ -132,7 +134,8 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
|
|||
// Load keyboard
|
||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
// Press/release "?123" key, enter into symbols.
|
||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||
// Press "=\<" key, enter into symbols shifted chording state.
|
||||
|
@ -190,7 +193,8 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
|
|||
// Load keyboard
|
||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
// Press/release "?123" key, enter into symbols.
|
||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||
// Press/release "=\<" key, enter symbols shifted.
|
||||
|
@ -209,7 +213,8 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
|
|||
// Load keyboard
|
||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
// Press/release "?123" key, enter into symbols.
|
||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||
// Press/release "=\<" key, enter symbols shifted.
|
||||
|
|
|
@ -88,7 +88,8 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
|||
// Switching between alphabet shift locked and symbols.
|
||||
public void testAlphabetShiftLockedAndSymbols() {
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
|
||||
// Press/release "?123" key, enter into symbols.
|
||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||
|
@ -129,7 +130,8 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
|||
// Automatic switch back to alphabet shift locked test by space key.
|
||||
public void testSwitchBackBySpaceShiftLocked() {
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
|
||||
// Press/release "?123" key, enter into symbols.
|
||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||
|
@ -181,7 +183,8 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
|||
setLayoutSwitchBackSymbols(switchBackSymbols);
|
||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
|
||||
// Press/release "?123" key, enter into symbols.
|
||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||
|
@ -243,12 +246,14 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
|||
// Load keyboard, should be in alphabet.
|
||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
// Press/release shift key, back to alphabet.
|
||||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED);
|
||||
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
// Press/release letter key, remain in shift locked.
|
||||
pressAndReleaseKey('A', ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
||||
// Press/release word separator, remain in shift locked.
|
||||
|
@ -257,14 +262,17 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
|||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED);
|
||||
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
// Long press shift key, back to alphabet.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED,
|
||||
ALPHABET_UNSHIFTED);
|
||||
|
||||
// Press/release shift key, enter alphabet shifted.
|
||||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
// Press/release shift key, back to alphabet.
|
||||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED);
|
||||
|
||||
|
@ -273,7 +281,8 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
|||
// Load keyboard, should be in automatic shifted.
|
||||
loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED);
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
// Press/release shift key, back to alphabet.
|
||||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED);
|
||||
}
|
||||
|
@ -334,11 +343,13 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
|||
updateShiftState(ALPHABET_UNSHIFTED);
|
||||
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
// Update shift state, remained in alphabet shift locked.
|
||||
updateShiftState(ALPHABET_SHIFT_LOCKED);
|
||||
// Long press shift key, back to alphabet.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED,
|
||||
ALPHABET_UNSHIFTED);
|
||||
|
||||
// Press/release "?123" key, enter into symbols.
|
||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||
|
@ -365,11 +376,13 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
|||
updateShiftState(ALPHABET_AUTOMATIC_SHIFTED);
|
||||
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
// Update shift state, remained in alphabet shift locked (not automatic shifted).
|
||||
updateShiftState(ALPHABET_SHIFT_LOCKED);
|
||||
// Long press shift key, back to alphabet.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED,
|
||||
ALPHABET_UNSHIFTED);
|
||||
|
||||
// Load keyboard, should be in automatic shifted.
|
||||
loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED);
|
||||
|
@ -416,7 +429,8 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
|||
|
||||
// Alphabet shift locked -> shift key + letter -> alphabet shift locked.
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
// Press and slide from "123?" key, enter symbols.
|
||||
pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||
// Enter/release into symbol letter key, switch back to alphabet shift locked.
|
||||
|
@ -467,7 +481,8 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
|||
// Load keyboard
|
||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
// Press/release "?123" key, enter into symbols.
|
||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||
// Press and slide from "ABC" key, enter alphabet shift locked.
|
||||
|
@ -482,7 +497,8 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
|||
// Load keyboard
|
||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
// Press/release "?123" key, enter into symbols.
|
||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||
// Press and slide from "=\<" key, enter symbols shifted.
|
||||
|
@ -535,7 +551,8 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
|||
// Load keyboard
|
||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
// Press/release "?123" key, enter into symbols.
|
||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||
// Press/release "=\<" key, enter into symbols shifted.
|
||||
|
@ -552,7 +569,8 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
|||
// Load keyboard
|
||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
// Press/release "?123" key, enter into symbols.
|
||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||
// Press/release "=\<" key, enter into symbols shifted.
|
||||
|
@ -573,7 +591,8 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
|||
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
// Change focus to new text field.
|
||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||
|
||||
|
@ -603,7 +622,8 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
|||
loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED);
|
||||
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
// Change focus to new text field.
|
||||
loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED);
|
||||
|
||||
|
@ -635,7 +655,8 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
|||
|
||||
// Alphabet shift locked -> rotate -> alphabet shift locked.
|
||||
// Long press shift key, enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
// Rotate device, remain in alphabet shift locked.
|
||||
rotateDevice(ALPHABET_SHIFT_LOCKED);
|
||||
|
||||
|
@ -718,7 +739,8 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
|||
secondPressAndReleaseKey('J', ALPHABET_MANUAL_SHIFTED, ALPHABET_UNSHIFTED);
|
||||
|
||||
// Long press shift key to enter alphabet shift locked.
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
||||
ALPHABET_SHIFT_LOCKED);
|
||||
// Press/release shift key
|
||||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED);
|
||||
// Rapidly press/release letter key.
|
||||
|
|
|
@ -42,31 +42,32 @@ public class KeyboardStateTestsBase extends AndroidTestCase
|
|||
mLayoutSwitchBackSymbols = switchBackSymbols;
|
||||
}
|
||||
|
||||
private static void assertLayout(int expected, int actual) {
|
||||
assertTrue("expected=" + MockKeyboardSwitcher.getLayoutName(expected)
|
||||
private static void assertLayout(String message, int expected, int actual) {
|
||||
assertTrue(message + ": expected=" + MockKeyboardSwitcher.getLayoutName(expected)
|
||||
+ " actual=" + MockKeyboardSwitcher.getLayoutName(actual),
|
||||
expected == actual);
|
||||
}
|
||||
|
||||
public void updateShiftState(int afterUpdate) {
|
||||
mSwitcher.updateShiftState();
|
||||
assertLayout(afterUpdate, mSwitcher.getLayoutId());
|
||||
assertLayout("afterUpdate", afterUpdate, mSwitcher.getLayoutId());
|
||||
}
|
||||
|
||||
public void loadKeyboard(int afterLoad) {
|
||||
mSwitcher.loadKeyboard(mLayoutSwitchBackSymbols);
|
||||
updateShiftState(afterLoad);
|
||||
mSwitcher.updateShiftState();
|
||||
assertLayout("afterLoad", afterLoad, mSwitcher.getLayoutId());
|
||||
}
|
||||
|
||||
public void rotateDevice(int afterRotate) {
|
||||
mSwitcher.saveKeyboardState();
|
||||
mSwitcher.loadKeyboard(mLayoutSwitchBackSymbols);
|
||||
assertLayout(afterRotate, mSwitcher.getLayoutId());
|
||||
assertLayout("afterRotate", afterRotate, mSwitcher.getLayoutId());
|
||||
}
|
||||
|
||||
private void pressKeyWithoutTimerExpire(int code, boolean isSinglePointer, int afterPress) {
|
||||
mSwitcher.onPressKey(code, isSinglePointer);
|
||||
assertLayout(afterPress, mSwitcher.getLayoutId());
|
||||
assertLayout("afterPress", afterPress, mSwitcher.getLayoutId());
|
||||
}
|
||||
|
||||
public void pressKey(int code, int afterPress) {
|
||||
|
@ -77,7 +78,7 @@ public class KeyboardStateTestsBase extends AndroidTestCase
|
|||
public void releaseKey(int code, int afterRelease) {
|
||||
mSwitcher.onCodeInput(code, SINGLE);
|
||||
mSwitcher.onReleaseKey(code, NOT_SLIDING);
|
||||
assertLayout(afterRelease, mSwitcher.getLayoutId());
|
||||
assertLayout("afterRelease", afterRelease, mSwitcher.getLayoutId());
|
||||
}
|
||||
|
||||
public void pressAndReleaseKey(int code, int afterPress, int afterRelease) {
|
||||
|
@ -93,7 +94,7 @@ public class KeyboardStateTestsBase extends AndroidTestCase
|
|||
public void chordingReleaseKey(int code, int afterRelease) {
|
||||
mSwitcher.onCodeInput(code, MULTI);
|
||||
mSwitcher.onReleaseKey(code, NOT_SLIDING);
|
||||
assertLayout(afterRelease, mSwitcher.getLayoutId());
|
||||
assertLayout("afterRelease", afterRelease, mSwitcher.getLayoutId());
|
||||
}
|
||||
|
||||
public void chordingPressAndReleaseKey(int code, int afterPress, int afterRelease) {
|
||||
|
@ -104,14 +105,15 @@ public class KeyboardStateTestsBase extends AndroidTestCase
|
|||
public void pressAndSlideFromKey(int code, int afterPress, int afterSlide) {
|
||||
pressKey(code, afterPress);
|
||||
mSwitcher.onReleaseKey(code, SLIDING);
|
||||
assertLayout(afterSlide, mSwitcher.getLayoutId());
|
||||
assertLayout("afterSlide", afterSlide, mSwitcher.getLayoutId());
|
||||
}
|
||||
|
||||
public void longPressAndReleaseKey(int code, int afterPress, int afterLongPress) {
|
||||
public void longPressAndReleaseKey(int code, int afterPress, int afterLongPress,
|
||||
int afterRelease) {
|
||||
pressKey(code, afterPress);
|
||||
mSwitcher.onLongPressTimeout(code);
|
||||
assertLayout(afterLongPress, mSwitcher.getLayoutId());
|
||||
releaseKey(code, afterLongPress);
|
||||
assertLayout("afterLongPress", afterLongPress, mSwitcher.getLayoutId());
|
||||
releaseKey(code, afterRelease);
|
||||
}
|
||||
|
||||
public void secondPressAndReleaseKey(int code, int afterPress, int afterRelease) {
|
||||
|
|
Loading…
Reference in a new issue