From: Peter Hutterer Date: Fri, 24 Apr 2015 05:27:34 +0000 (+1000) Subject: test: upgrade to the Microsoft Surface Type Cover X-Git-Tag: 0.15.0~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e0f467e70dfd40d788df0f99478662e21f2d472a;p=platform%2Fupstream%2Flibinput.git 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 Reviewed-By: Derek Foreman --- diff --git a/test/litest-ms-surface-cover.c b/test/litest-ms-surface-cover.c index 633bb79..37fe850 100644 --- a/test/litest-ms-surface-cover.c +++ b/test/litest-ms-surface-cover.c @@ -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, diff --git a/test/touch.c b/test/touch.c index 5c363f9..eb9f4cb 100644 --- a/test/touch.c +++ b/test/touch.c @@ -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