Commit e0f467e7 authored by Peter Hutterer's avatar Peter Hutterer

test: upgrade to the Microsoft Surface Type Cover

Almost identical to the one we already had but this one also has ABS_X/Y to
mess things up. Update the existing one, no need to add a separate device here.

The fake MT touch test needs to be updated now though. A fake MT device may be
an absolute device too, so if we use the touch_down() handlers we may generate
abs pointer events. That's valid, we only check for no touch events here.
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Reviewed-By: default avatarDerek Foreman <derekf@osg.samsung.com>
parent 5e85957a
......@@ -35,6 +35,8 @@ litest_ms_surface_cover_setup(void)
}
static struct input_event down[] = {
{ .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_MT_SLOT, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_MT_TRACKING_ID, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_MT_POSITION_X, .value = LITEST_AUTO_ASSIGN },
......@@ -59,6 +61,8 @@ static struct litest_device_interface interface = {
};
static struct input_absinfo absinfo[] = {
{ ABS_X, 0, 1022, 0, 0, 12 },
{ ABS_Y, 0, 487, 0, 0, 12 },
{ ABS_VOLUME, 0, 1023, 0, 0, 0 },
{ ABS_MISC, 0, 255, 0, 0, 0 },
{ 41, 0, 255, 0, 0, 0 },
......@@ -90,7 +94,7 @@ static struct input_absinfo absinfo[] = {
static struct input_id input_id = {
.bustype = 0x3,
.vendor = 0x45e,
.product = 0x7a9,
.product = 0x7dc,
};
static int events[] = {
......@@ -373,12 +377,12 @@ static int events[] = {
struct litest_test_device litest_ms_surface_cover_device = {
.type = LITEST_MS_SURFACE_COVER,
.features = LITEST_KEYS | LITEST_RELATIVE | LITEST_FAKE_MT | LITEST_BUTTON | LITEST_WHEEL,
.features = LITEST_KEYS | LITEST_ABSOLUTE | LITEST_RELATIVE | LITEST_FAKE_MT | LITEST_BUTTON | LITEST_WHEEL,
.shortname = "MS surface cover",
.setup = litest_ms_surface_cover_setup,
.interface = &interface,
.name = "MICROSOFT SAM",
.name = "Microsoft Surface Type Cover",
.id = &input_id,
.events = events,
.absinfo = absinfo,
......
......@@ -462,7 +462,8 @@ START_TEST(fake_mt_no_touch_events)
litest_touch_up(dev, 0);
litest_touch_up(dev, 1);
litest_assert_empty_queue(li);
litest_assert_only_typed_events(li,
LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE);
}
END_TEST
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment