summaryrefslogtreecommitdiff
path: root/test/test-touchpad.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test-touchpad.c')
-rw-r--r--test/test-touchpad.c73
1 files changed, 3 insertions, 70 deletions
diff --git a/test/test-touchpad.c b/test/test-touchpad.c
index d91c244..a380bcf 100644
--- a/test/test-touchpad.c
+++ b/test/test-touchpad.c
@@ -2682,7 +2682,7 @@ START_TEST(touchpad_dwt)
}
END_TEST
-START_TEST(touchpad_dwt_update_keyboard)
+START_TEST(touchpad_dwt_ext_and_int_keyboard)
{
struct litest_device *touchpad = litest_current_device();
struct litest_device *keyboard, *yubikey;
@@ -2730,58 +2730,6 @@ START_TEST(touchpad_dwt_update_keyboard)
}
END_TEST
-START_TEST(touchpad_dwt_update_keyboard_with_state)
-{
- struct litest_device *touchpad = litest_current_device();
- struct litest_device *keyboard, *yubikey;
- struct libinput *li = touchpad->libinput;
-
- if (!has_disable_while_typing(touchpad))
- return;
-
- litest_disable_tap(touchpad->libinput_device);
-
- /* Yubikey is initialized first */
- yubikey = litest_add_device(li, LITEST_YUBIKEY);
- litest_drain_events(li);
-
- litest_keyboard_key(yubikey, KEY_A, true);
- litest_keyboard_key(yubikey, KEY_A, false);
- litest_keyboard_key(yubikey, KEY_A, true);
- litest_assert_only_typed_events(li, LIBINPUT_EVENT_KEYBOARD_KEY);
-
- litest_touch_down(touchpad, 0, 50, 50);
- litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10, 1);
- litest_touch_up(touchpad, 0);
- litest_assert_empty_queue(li);
-
- litest_keyboard_key(yubikey, KEY_A, false);
- litest_keyboard_key(yubikey, KEY_A, true);
- litest_drain_events(li);
-
- /* yubikey still has A down */
- keyboard = dwt_init_paired_keyboard(li, touchpad);
- litest_drain_events(li);
-
- /* expected repairing, dwt should be disabled */
- litest_touch_down(touchpad, 0, 50, 50);
- litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10, 1);
- litest_touch_up(touchpad, 0);
- litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
-
- /* release remaining key */
- litest_keyboard_key(yubikey, KEY_A, false);
- litest_assert_only_typed_events(li, LIBINPUT_EVENT_KEYBOARD_KEY);
-
- litest_touch_down(touchpad, 0, 50, 50);
- litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10, 1);
- litest_touch_up(touchpad, 0);
- litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
-
- litest_delete_device(keyboard);
- litest_delete_device(yubikey);
-}
-END_TEST
START_TEST(touchpad_dwt_enable_touch)
{
struct litest_device *touchpad = litest_current_device();
@@ -3874,24 +3822,11 @@ END_TEST
START_TEST(touchpad_dwt_apple)
{
struct litest_device *touchpad = litest_current_device();
- struct litest_device *keyboard, *apple_keyboard;
+ struct litest_device *apple_keyboard;
struct libinput *li = touchpad->libinput;
ck_assert(has_disable_while_typing(touchpad));
- /* Only the apple keyboard can trigger DWT */
- keyboard = litest_add_device(li, LITEST_KEYBOARD);
- litest_drain_events(li);
-
- litest_keyboard_key(keyboard, KEY_A, true);
- litest_keyboard_key(keyboard, KEY_A, false);
- litest_assert_only_typed_events(li, LIBINPUT_EVENT_KEYBOARD_KEY);
-
- litest_touch_down(touchpad, 0, 50, 50);
- litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10, 1);
- litest_touch_up(touchpad, 0);
- litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
-
apple_keyboard = litest_add_device(li, LITEST_APPLE_KEYBOARD);
litest_drain_events(li);
@@ -3905,7 +3840,6 @@ START_TEST(touchpad_dwt_apple)
libinput_dispatch(li);
litest_assert_empty_queue(li);
- litest_delete_device(keyboard);
litest_delete_device(apple_keyboard);
}
END_TEST
@@ -5108,8 +5042,7 @@ litest_setup_tests_touchpad(void)
litest_add_ranged("touchpad:state", touchpad_initial_state, LITEST_TOUCHPAD, LITEST_ANY, &axis_range);
litest_add("touchpad:dwt", touchpad_dwt, LITEST_TOUCHPAD, LITEST_ANY);
- litest_add_for_device("touchpad:dwt", touchpad_dwt_update_keyboard, LITEST_SYNAPTICS_I2C);
- litest_add_for_device("touchpad:dwt", touchpad_dwt_update_keyboard_with_state, LITEST_SYNAPTICS_I2C);
+ litest_add_for_device("touchpad:dwt", touchpad_dwt_ext_and_int_keyboard, LITEST_SYNAPTICS_I2C);
litest_add("touchpad:dwt", touchpad_dwt_enable_touch, LITEST_TOUCHPAD, LITEST_ANY);
litest_add("touchpad:dwt", touchpad_dwt_touch_hold, LITEST_TOUCHPAD, LITEST_ANY);
litest_add("touchpad:dwt", touchpad_dwt_key_hold, LITEST_TOUCHPAD, LITEST_ANY);