mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-25 09:20:07 +01:00
test: add no-tool testing to one of the tablet tests
Modifies an existing proximity test to also test for the case where a tablet never sends BTN_TOOL_PEN so we have that case covered. This is implicitly tested by the LITEST_UCLOGIC_TABLET test device but making it explicit is a bit easier to debug. Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1164>
This commit is contained in:
parent
39fa451e7e
commit
e77eb469e8
1 changed files with 10 additions and 4 deletions
|
|
@ -6871,13 +6871,15 @@ START_TEST(huion_static_btn_tool_pen)
|
|||
struct litest_device *dev = litest_current_device();
|
||||
struct libinput *li = dev->libinput;
|
||||
int i;
|
||||
bool send_btn_tool = litest_test_param_get_bool(test_env->params, "send-btn-tool");
|
||||
|
||||
litest_drain_events(li);
|
||||
|
||||
litest_event(dev, EV_ABS, ABS_X, 20000);
|
||||
litest_event(dev, EV_ABS, ABS_Y, 20000);
|
||||
litest_event(dev, EV_ABS, ABS_PRESSURE, 100);
|
||||
litest_event(dev, EV_KEY, BTN_TOOL_PEN, 1);
|
||||
if (send_btn_tool)
|
||||
litest_event(dev, EV_KEY, BTN_TOOL_PEN, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_drain_events(li);
|
||||
|
||||
|
|
@ -6933,13 +6935,15 @@ START_TEST(huion_static_btn_tool_pen_no_timeout_during_usage)
|
|||
struct litest_device *dev = litest_current_device();
|
||||
struct libinput *li = dev->libinput;
|
||||
int i;
|
||||
bool send_btn_tool = litest_test_param_get_bool(test_env->params, "send-btn-tool");
|
||||
|
||||
litest_drain_events(li);
|
||||
|
||||
litest_event(dev, EV_ABS, ABS_X, 20000);
|
||||
litest_event(dev, EV_ABS, ABS_Y, 20000);
|
||||
litest_event(dev, EV_ABS, ABS_PRESSURE, 100);
|
||||
litest_event(dev, EV_KEY, BTN_TOOL_PEN, 1);
|
||||
if (send_btn_tool)
|
||||
litest_event(dev, EV_KEY, BTN_TOOL_PEN, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_drain_events(li);
|
||||
|
||||
|
|
@ -7268,8 +7272,10 @@ TEST_COLLECTION(tablet)
|
|||
litest_add(touch_arbitration_remove_after, LITEST_TABLET | LITEST_DIRECT, LITEST_ANY);
|
||||
litest_add(touch_arbitration_swap_device, LITEST_TABLET, LITEST_ANY);
|
||||
|
||||
litest_add_for_device(huion_static_btn_tool_pen, LITEST_HUION_TABLET);
|
||||
litest_add_for_device(huion_static_btn_tool_pen_no_timeout_during_usage, LITEST_HUION_TABLET);
|
||||
litest_with_parameters(params, "send-btn-tool", 'b') {
|
||||
litest_add_parametrized_for_device(huion_static_btn_tool_pen, LITEST_HUION_TABLET, params);
|
||||
litest_add_parametrized_for_device(huion_static_btn_tool_pen_no_timeout_during_usage, LITEST_HUION_TABLET, params);
|
||||
}
|
||||
|
||||
litest_with_parameters(params, "btn_tool_pen_timeout", 'b') {
|
||||
litest_add_parametrized_for_device(huion_static_btn_tool_pen_disable_quirk_on_prox_out, LITEST_HUION_TABLET, params);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue