litest_assert_button_event(li, BTN_LEFT,
LIBINPUT_BUTTON_STATE_PRESSED);
- msleep(300); /* tap-n-drag timeout */
+ litest_timeout_tap();
litest_assert_button_event(li, BTN_LEFT,
LIBINPUT_BUTTON_STATE_RELEASED);
ck_assert_int_eq(libinput_next_event_type(li), LIBINPUT_EVENT_NONE);
- msleep(300); /* tap-n-drag timeout */
+ litest_timeout_tap();
litest_assert_button_event(li, BTN_LEFT,
LIBINPUT_BUTTON_STATE_RELEASED);
litest_touch_up(dev, 0);
litest_touch_down(dev, 0, 50, 50);
libinput_dispatch(li);
- msleep(300);
+ litest_timeout_tap();
litest_assert_button_event(li, BTN_LEFT,
LIBINPUT_BUTTON_STATE_PRESSED);
litest_assert_button_event(li, BTN_RIGHT,
LIBINPUT_BUTTON_STATE_PRESSED);
- msleep(300); /* tap-n-drag timeout */
+ litest_timeout_tap();
litest_assert_button_event(li, BTN_RIGHT,
LIBINPUT_BUTTON_STATE_RELEASED);
litest_assert_button_event(li, BTN_RIGHT,
LIBINPUT_BUTTON_STATE_PRESSED);
- msleep(300); /* tap-n-drag timeout */
+ litest_timeout_tap();
litest_assert_button_event(li, BTN_RIGHT,
LIBINPUT_BUTTON_STATE_RELEASED);
litest_event(dev, EV_KEY, BTN_LEFT, 0);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
- msleep(200);
+ litest_timeout_tap();
libinput_dispatch(li);
*/
litest_touch_down(dev, 0, 50, 50);
libinput_dispatch(dev->libinput);
- msleep(300);
+ litest_timeout_tap();
libinput_dispatch(dev->libinput);
litest_drain_events(dev->libinput);
litest_assert_button_event(li, BTN_MIDDLE,
LIBINPUT_BUTTON_STATE_PRESSED);
- msleep(300); /* tap-n-drag timeout */
+ litest_timeout_tap();
litest_assert_button_event(li, BTN_MIDDLE,
LIBINPUT_BUTTON_STATE_RELEASED);
litest_assert_button_event(li, BTN_MIDDLE,
LIBINPUT_BUTTON_STATE_PRESSED);
- msleep(300); /* tap-n-drag timeout */
+ litest_timeout_tap();
litest_assert_button_event(li, BTN_MIDDLE,
LIBINPUT_BUTTON_STATE_RELEASED);
litest_assert_button_event(li, BTN_MIDDLE,
LIBINPUT_BUTTON_STATE_PRESSED);
- msleep(300); /* tap-n-drag timeout */
+ litest_timeout_tap();
litest_assert_button_event(li, BTN_MIDDLE,
LIBINPUT_BUTTON_STATE_RELEASED);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
litest_touch_up(dev, 0);
libinput_dispatch(li);
- msleep(200);
+ litest_timeout_tap();
libinput_dispatch(li);
/* move out of the area, then wait for softbutton timer */
litest_touch_move_to(dev, 0, 20, 90, 90, 20, 10);
libinput_dispatch(li);
- msleep(400);
+ litest_timeout_softbuttons();
libinput_dispatch(li);
litest_drain_events(li);
litest_touch_down(dev, 0, 50, 5);
libinput_dispatch(li);
- msleep(200);
+ litest_timeout_softbuttons();
libinput_dispatch(li);
litest_assert_empty_queue(li);
litest_touch_move_to(dev, 0, 50, 5, 80, 90, 20);
libinput_dispatch(li);
- msleep(400);
+ litest_timeout_softbuttons();
libinput_dispatch(li);
litest_event(dev, EV_KEY, BTN_LEFT, 1);
END_TEST
static void
-test_2fg_scroll(struct litest_device *dev, double dx, double dy, int sleep)
+test_2fg_scroll(struct litest_device *dev, double dx, double dy, int want_sleep)
{
struct libinput *li = dev->libinput;
litest_touch_move_to(dev, 1, 53, 50, 53 + dx, 50 + dy, 5);
/* Avoid a small scroll being seen as a tap */
- if (sleep) {
+ if (want_sleep) {
libinput_dispatch(li);
- msleep(sleep);
+ litest_timeout_tap();
libinput_dispatch(li);
}