summaryrefslogtreecommitdiff
path: root/test/test-switch.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2017-11-06 15:28:04 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2017-11-09 10:36:03 +1000
commit03e4a6b8307100e8759aa7cf9465fddac29790d6 (patch)
tree554146d03179a7f24d06c9ec97f6b04b13f4722b /test/test-switch.c
parentbf53c4e04d4d9027f5c54a1171a4b57e6e8fabba (diff)
test: add the wmi hotkeys test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'test/test-switch.c')
-rw-r--r--test/test-switch.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/test-switch.c b/test/test-switch.c
index d62ca9fa..12488cbb 100644
--- a/test/test-switch.c
+++ b/test/test-switch.c
@@ -1021,6 +1021,25 @@ START_TEST(tablet_mode_disable_trackpoint_on_init)
}
END_TEST
+START_TEST(dock_toggle)
+{
+ struct litest_device *sw = litest_current_device();
+ struct libinput *li = sw->libinput;
+
+ if (!libevdev_has_event_code(sw->evdev, EV_SW, SW_DOCK))
+ return;
+
+ litest_drain_events(li);
+
+ litest_event(sw, EV_SW, SW_DOCK, 1);
+ libinput_dispatch(li);
+
+ litest_event(sw, EV_SW, SW_DOCK, 0);
+ libinput_dispatch(li);
+
+ litest_assert_empty_queue(li);
+}
+END_TEST
void
litest_setup_tests_lid(void)
{
@@ -1057,4 +1076,6 @@ litest_setup_tests_lid(void)
litest_add("tablet-mode:keyboard", tablet_mode_disable_keyboard_on_init, LITEST_SWITCH, LITEST_ANY);
litest_add("tablet-mode:trackpoint", tablet_mode_disable_trackpoint, LITEST_SWITCH, LITEST_ANY);
litest_add("tablet-mode:trackpoint", tablet_mode_disable_trackpoint_on_init, LITEST_SWITCH, LITEST_ANY);
+
+ litest_add("lid:dock", dock_toggle, LITEST_SWITCH, LITEST_ANY);
}