Commit graph

22 commits

Author SHA1 Message Date
Peter Hutterer
430ede8266 test: add tablet-mode suspend/resume keyboard and touchpad tests
Related #155

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-10-16 09:26:25 +10:00
Peter Hutterer
7768d7d981 test: drop the sleep_ms argument
This forces events for every ~10ms now. If we want a slower movement, we need
more steps - just like a real touchpad does it.

Cocinelle spatch files were variants of:
	@@
	expression A, B, C, D, E, F, G, H, I, J, K;
	@@

	- litest_touch_move_two_touches(A, B, C, D, E, F, G, H, I)
	+ litest_touch_move_two_touches(A, B, C, D, E, F, G, H)

The only test that needed a real fix was touchpad_no_palm_detect_2fg_scroll,
it used 12ms before, now it's using 10ms so on the bcm5974 touchpad the second
finger was a speed-thumb. Increasing the events and thus slowing down the
pointer means it's a normal finger and the test succeeds again.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 11:26:12 +10:00
Peter Hutterer
20a9c38db0 test: force 10ms intervals for touch moves, unless specified otherwise
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 11:26:12 +10:00
Peter Hutterer
639ed0b641 Switch from udev property parsing to the quirks system
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-08 14:37:22 +10:00
Peter Hutterer
ce80e40006 test: move all the _setup() functions into a special section
This way we can loop through them instead of having to add them manually.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-23 10:17:52 +10:00
Peter Hutterer
b8bef106c0 test: swap KEY_POWER for KEY_VOLUMEUP on the switch key routing test
If there's anything that listens for KEY_POWER it will likely shut down or
suspend the host. Since it doesn't matter whether we're really testing for
KEY_POWER or just any other key, let's just switch it and avoid one headache.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-02-05 17:49:04 +10:00
Peter Hutterer
6f447cb8de test: use litest_wait_for_event() for the lid switch events
Getting spurious test case failures in these two tests but they're not easily
reproducible. One cause may be a slight delay of the event that we're writing
to the kernel device. If that has a minor delay, we'll miss it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-11-17 10:01:05 +10:00
Peter Hutterer
03e4a6b830 test: add the wmi hotkeys test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-11-09 10:36:03 +10:00
Peter Hutterer
41a70bbe92 fallback: fix lid switch event listener being initialized twice
Once the lid is closed, the keyboard event listener is set up to open the lid
for us on keyboard events. With the right sequence, we can trigger the
listener to be added to the list multiple times, triggering an assert in the
list test code (or an infinite loop in the 1.8 branch).

Conditions:
* SW_LID value 1 - sets up the keyboard listener
* keyboard event - sets lid_is_closed to false
* SW_LID value 0 - is ignored because we're already open
* SW_LID value 1 - sets up the keyboard listener again

https://bugs.freedesktop.org/show_bug.cgi?id=103298

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-27 15:20:35 +10:00
Peter Hutterer
84d49ee49c fallback: suspend internal keyboards and trackpoints on tablet-mode switch
Because on some devices the keyboard is where the fingers are holding the
device when in tablet mode.

https://bugs.freedesktop.org/show_bug.cgi?id=102729

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-25 15:34:45 +10:00
Peter Hutterer
23a611ea1e fallback: allow for multiple keyboards to toggle the lid switch
Previously we only listened for events on the first one to come up, based on
the assumption that there can only be one internal keyboard. The Razer Blade
laptop keyboards come with with multiple event nodes, all looking like a
normal keyboard. The one that comes up first is one for special keys, so
typing on the internal keyboard after a lid switch does not toggle the write
state.

Fix this by allowing for up to 3 keyboard listeners for a lid switch.

https://bugs.freedesktop.org/show_bug.cgi?id=102039

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-25 14:14:20 +10:00
Peter Hutterer
34f28a329b test: remove leftover sleep() for debugging in lid switch test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-19 11:00:50 +10:00
Peter Hutterer
53d53dd18e touchpad: don't resume a disabled touchpad
A touchpad that was disabled by toggling the sendevents option would come back
normally after a lid resume, despite still being nominally disabled.

https://bugzilla.redhat.com/show_bug.cgi?id=1448962

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-18 17:01:24 +10:00
Peter Hutterer
986604fd9d touchpad: if a device has a tablet mode switch, disable the touchpad
On some devices with a tablet mode switch, the touchpad is inacessible when
in tablet mode and we don't really need this except to avoid possible ghost
touches (none have been mentioned so far). On other devices like the Lenovo
Yoga, the touchpad points to the back of the device and it's hard to use the
device without accidentally using the touchpad. For those, disabling the
touchpad is the best solution.

https://bugs.freedesktop.org/show_bug.cgi?id=102408

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-06 09:26:00 +10:00
Peter Hutterer
82f2dd8faa Add support for SW_TABLET_MODE
https://bugs.freedesktop.org/show_bug.cgi?id=101008

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-06 09:26:00 +10:00
Peter Hutterer
f0f6326490 evdev: move lid code to the fallback interface
This was originally designed to deal with devices that only have SW_LID. But
it can be moved into the evdev interface to avoid duplication once we have
SW_TABLET_MODE. The original assumption of the lid switch device being a
standalone device with no other switches is not true, having a separate
dispatch hurts us here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-06 09:26:00 +10:00
Peter Hutterer
d9a729e1a7 Add libinput_device_switch_has_switch()
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-06 09:24:29 +10:00
Peter Hutterer
e320214091 test: make some of the switch tests more generic
Still hardcoded for lid switches, but easier to change for other switches now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-05 10:52:06 +10:00
Peter Hutterer
f9a4676044 test: add test for switch capability
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-05 10:48:19 +10:00
Peter Hutterer
e055803321 test: rename 'sw' to 'dev' for the lid tests
More in line with other tests and allows us to use 'sw' as name for the actual
switch to be toggled later. The variable name 'sw' stays in those tests where
we have touchpad/keyboard/etc. devices as well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-05 10:41:27 +10:00
Peter Hutterer
aeca8739c7 test: make the lid action helper function a generic switch action helper
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-04 12:42:44 +10:00
Peter Hutterer
a3c5f37b28 test: rename test-lid.c to test-switch.c
So we can add other switch tests to it without confusing too many people.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-04 11:26:23 +10:00
Renamed from test/test-lid.c (Browse further)