Skip to content

Commit d9b3014

Browse files
Benjamin TissoiresJiri Kosina
authored andcommitted
selftests/hid: add tests for missing release on the Dell Synaptics
Add a simple test for the corner case not currently covered by the sticky fingers quirk. Because it's a corner case test, we only test this on a couple of devices, not on all of them because the value of adding the same test over and over is rather moot. Signed-off-by: Benjamin Tissoires <bentiss@kernel.org> Signed-off-by: Jiri Kosina <jkosina@suse.com>
1 parent 46f781e commit d9b3014

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

tools/testing/selftests/hid/tests/test_multitouch.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,6 +1752,52 @@ def test_mt_confidence_bad_release(self):
17521752
assert evdev.slots[0][libevdev.EV_ABS.ABS_MT_TRACKING_ID] == -1
17531753

17541754

1755+
@pytest.mark.skip_if_uhdev(
1756+
lambda uhdev: "Confidence" not in uhdev.fields,
1757+
"Device not compatible, missing Confidence usage",
1758+
)
1759+
def test_mt_confidence_bad_multi_release(self):
1760+
"""Check for the sticky finger being properly detected.
1761+
1762+
We first inject 3 fingers, then release only the second.
1763+
After 100 ms, we should receive a generated event about the
1764+
2 missing fingers being released.
1765+
"""
1766+
uhdev = self.uhdev
1767+
evdev = uhdev.get_evdev()
1768+
1769+
# send 3 touches
1770+
t0 = Touch(1, 50, 10)
1771+
t1 = Touch(2, 150, 100)
1772+
t2 = Touch(3, 250, 200)
1773+
r = uhdev.event([t0, t1, t2])
1774+
events = uhdev.next_sync_events()
1775+
self.debug_reports(r, uhdev, events)
1776+
1777+
# release the second
1778+
t1.tipswitch = False
1779+
r = uhdev.event([t1])
1780+
events = uhdev.next_sync_events()
1781+
self.debug_reports(r, uhdev, events)
1782+
1783+
# only the second is released
1784+
assert evdev.slots[0][libevdev.EV_ABS.ABS_MT_TRACKING_ID] != -1
1785+
assert evdev.slots[1][libevdev.EV_ABS.ABS_MT_TRACKING_ID] == -1
1786+
assert evdev.slots[2][libevdev.EV_ABS.ABS_MT_TRACKING_ID] != -1
1787+
1788+
# wait for the timer to kick in
1789+
time.sleep(0.2)
1790+
1791+
events = uhdev.next_sync_events()
1792+
self.debug_reports([], uhdev, events)
1793+
1794+
# now all 3 fingers are released
1795+
assert libevdev.InputEvent(libevdev.EV_KEY.BTN_TOUCH, 0) in events
1796+
assert evdev.slots[0][libevdev.EV_ABS.ABS_MT_TRACKING_ID] == -1
1797+
assert evdev.slots[1][libevdev.EV_ABS.ABS_MT_TRACKING_ID] == -1
1798+
assert evdev.slots[2][libevdev.EV_ABS.ABS_MT_TRACKING_ID] == -1
1799+
1800+
17551801
class TestElanXPS9360(BaseTest.TestWin8Multitouch):
17561802
def create_device(self):
17571803
return Digitizer(
@@ -2086,3 +2132,12 @@ def create_device(self):
20862132
input_info=(BusType.I2C, 0x06CB, 0xCE08),
20872133
rdesc="05 01 09 02 a1 01 85 02 09 01 a1 00 05 09 19 01 29 02 15 00 25 01 75 01 95 02 81 02 95 06 81 01 05 01 09 30 09 31 15 81 25 7f 75 08 95 02 81 06 c0 c0 05 01 09 02 a1 01 85 18 09 01 a1 00 05 09 19 01 29 03 46 00 00 15 00 25 01 75 01 95 03 81 02 95 05 81 01 05 01 09 30 09 31 15 81 25 7f 75 08 95 02 81 06 c0 c0 06 00 ff 09 02 a1 01 85 20 09 01 a1 00 09 03 15 00 26 ff 00 35 00 46 ff 00 75 08 95 05 81 02 c0 c0 05 0d 09 05 a1 01 85 03 05 0d 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 75 01 95 03 81 03 05 01 15 00 26 f8 04 75 10 55 0e 65 11 09 30 35 00 46 24 04 95 01 81 02 46 30 02 26 a0 02 09 31 81 02 c0 05 0d 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 75 01 95 03 81 03 05 01 15 00 26 f8 04 75 10 55 0e 65 11 09 30 35 00 46 24 04 95 01 81 02 46 30 02 26 a0 02 09 31 81 02 c0 05 0d 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 75 01 95 03 81 03 05 01 15 00 26 f8 04 75 10 55 0e 65 11 09 30 35 00 46 24 04 95 01 81 02 46 30 02 26 a0 02 09 31 81 02 c0 05 0d 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 75 01 95 03 81 03 05 01 15 00 26 f8 04 75 10 55 0e 65 11 09 30 35 00 46 24 04 95 01 81 02 46 30 02 26 a0 02 09 31 81 02 c0 05 0d 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 75 01 95 03 81 03 05 01 15 00 26 f8 04 75 10 55 0e 65 11 09 30 35 00 46 24 04 95 01 81 02 46 30 02 26 a0 02 09 31 81 02 c0 05 0d 55 0c 66 01 10 47 ff ff 00 00 27 ff ff 00 00 75 10 95 01 09 56 81 02 09 54 25 7f 95 01 75 08 81 02 05 09 09 01 25 01 75 01 95 01 81 02 95 07 81 03 05 0d 85 08 09 55 09 59 75 04 95 02 25 0f b1 02 85 0d 09 60 75 01 95 01 15 00 25 01 b1 02 95 07 b1 03 85 07 06 00 ff 09 c5 15 00 26 ff 00 75 08 96 00 01 b1 02 c0 05 0d 09 0e a1 01 85 04 09 22 a1 02 09 52 15 00 25 0a 75 08 95 01 b1 02 c0 09 22 a1 00 85 06 09 57 09 58 75 01 95 02 25 01 b1 02 95 06 b1 03 c0 c0 06 00 ff 09 01 a1 01 85 09 09 02 15 00 26 ff 00 75 08 95 14 91 02 85 0a 09 03 15 00 26 ff 00 75 08 95 14 91 02 85 0b 09 04 15 00 26 ff 00 75 08 95 45 81 02 85 0c 09 05 15 00 26 ff 00 75 08 95 45 81 02 85 0f 09 06 15 00 26 ff 00 75 08 95 03 b1 02 85 0e 09 07 15 00 26 ff 00 75 08 95 01 b1 02 c0",
20882134
)
2135+
2136+
class Testsynaptics_06cb_ce26(TestWin8TSConfidence):
2137+
def create_device(self):
2138+
return PTP(
2139+
"uhid test synaptics_06cb_ce26",
2140+
max_contacts=5,
2141+
input_info=(BusType.I2C, 0x06CB, 0xCE26),
2142+
rdesc="05 01 09 02 a1 01 85 02 09 01 a1 00 05 09 19 01 29 02 15 00 25 01 75 01 95 02 81 02 95 06 81 01 05 01 09 30 09 31 15 81 25 7f 75 08 95 02 81 06 c0 c0 05 0d 09 05 a1 01 85 03 05 0d 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 75 01 95 03 81 03 05 01 15 00 26 45 05 75 10 55 0e 65 11 09 30 35 00 46 64 04 95 01 81 02 46 a2 02 26 29 03 09 31 81 02 c0 05 0d 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 75 01 95 03 81 03 05 01 15 00 26 45 05 75 10 55 0e 65 11 09 30 35 00 46 64 04 95 01 81 02 46 a2 02 26 29 03 09 31 81 02 c0 05 0d 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 75 01 95 03 81 03 05 01 15 00 26 45 05 75 10 55 0e 65 11 09 30 35 00 46 64 04 95 01 81 02 46 a2 02 26 29 03 09 31 81 02 c0 05 0d 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 75 01 95 03 81 03 05 01 15 00 26 45 05 75 10 55 0e 65 11 09 30 35 00 46 64 04 95 01 81 02 46 a2 02 26 29 03 09 31 81 02 c0 05 0d 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 75 01 95 03 81 03 05 01 15 00 26 45 05 75 10 55 0e 65 11 09 30 35 00 46 64 04 95 01 81 02 46 a2 02 26 29 03 09 31 81 02 c0 05 0d 55 0c 66 01 10 47 ff ff 00 00 27 ff ff 00 00 75 10 95 01 09 56 81 02 09 54 25 7f 95 01 75 08 81 02 05 09 09 01 25 01 75 01 95 01 81 02 95 07 81 03 05 0d 85 08 09 55 09 59 75 04 95 02 25 0f b1 02 85 0d 09 60 75 01 95 01 15 00 25 01 b1 02 95 07 b1 03 85 07 06 00 ff 09 c5 15 00 26 ff 00 75 08 96 00 01 b1 02 c0 05 0d 09 0e a1 01 85 04 09 22 a1 02 09 52 15 00 25 0a 75 08 95 01 b1 02 c0 09 22 a1 00 85 06 09 57 09 58 75 01 95 02 25 01 b1 02 95 06 b1 03 c0 c0 06 00 ff 09 01 a1 01 85 09 09 02 15 00 26 ff 00 75 08 95 14 91 02 85 0a 09 03 15 00 26 ff 00 75 08 95 14 91 02 85 0b 09 04 15 00 26 ff 00 75 08 95 3d 81 02 85 0c 09 05 15 00 26 ff 00 75 08 95 3d 81 02 85 0f 09 06 15 00 26 ff 00 75 08 95 03 b1 02 85 0e 09 07 15 00 26 ff 00 75 08 95 01 b1 02 c0",
2143+
)

0 commit comments

Comments
 (0)