Commit graph

8 commits

Author SHA1 Message Date
hujianwei
c83e7243e1 Fix the tests
* tests/damage_test.c (handle_test_surface_committed)
(test_surface_listener):
* tests/dmabuf_test.c (handle_test_surface_committed)
(test_surface_listener):
* tests/scale_test.c (handle_test_surface_committed)
(test_surface_listener):
* tests/seat_test.c (handle_test_surface_committed)
(test_surface_listener):
* tests/simple_test.c (handle_test_surface_committed)
(test_surface_listener):
* tests/single_pixel_buffer_test.c (handle_test_surface_committed)
(test_surface_listener):
* tests/subsurface_test.c (handle_test_surface_committed)
(test_surface_listener):
* tests/transform_test.c (handle_test_surface_committed)
(test_surface_listener):
* tests/viewporter_test.c (handle_test_surface_committed)
(test_surface_listener):
* tests/xdg_activation_test.c (handle_test_surface_committed)
(test_surface_listener): Add new committed listeners.
2022-11-22 11:10:40 +00:00
hujianwei
13b3d3d04b Add new seat tests for key presses
* 12to11-test.xml (test_seat_controller) <dispatch_XI_FocusIn>:
<dispatch_XI_FocusOut>
<dispatch_XI_RawKeyPress>
<dispatch_XI_RawKeyRelease>
<dispatch_XI_KeyPress>
<dispatch_XI_KeyRelease>: New requests.

* seat.c (MakeSeatForDevicePair): Prevent seat->key_pressed from
being NULL as long as keymaps have been initialized.

* test_seat.c (DispatchXIFocusIn, DispatchXIFocusOut)
(GenerateRawEvent, DispatchXIRawKeyRelease, DispatchXIKeyPress)
(DispatchXIKeyRelease): New functions.
(seat_controller_impl): Add new functions.
(XLGetTestSeat): Prevent seat->key_pressed from being NULL.

* tests/seat_test.c (enum test_expect_event_kind): Add keyboard
events.
(struct test_recorded_keyboard_enter_event)
(struct test_recorded_keyboard_key_event)
(struct test_recorded_keyboard_modifiers_event): New structs.
(enum test_kind, test_names): Add new test.
(LAST_TEST): Set to key test.
(run_key_test, test_single_step): Implement new test.
(expect_keyboard_enter_event, expect_keyboard_modifiers_event)
(expect_keyboard_key_event): New function.
(handle_keyboard_keymap, handle_keyboard_enter)
(handle_keyboard_leave, handle_keyboard_key)
(handle_keyboard_repeat_info): New functions.
(keyboard_listener, run_test): Attach new keyboard listener.

* tests/test_harness.c (test_init_seat): Initialize keyboard.
* tests/test_harness.h (struct test_seat): New field `keyboard'.
2022-11-16 02:15:47 +00:00
hujianwei
163dca96bd Add scroll valuator tests
* 12to11-test.xml (test_manager): <error>: New errors.
(test_XIDeviceInfo, test_device_controller): New interfaces.
(test_seat_controller): <get_device_controller>: New request.
<device_id>: New event.

* seat.c (NoticeDeviceDisabled): Ignore test seats.
(XLSeatDispatchCoreKeyEvent): Expand commentary.

* test_seat.c (struct _TestDeviceController)
(struct _TestXIDeviceInfo): New structs.
(DestroyXIValuatorState): New function.
(AddValuatorToTestXIValuatorState): Fix crashes.
(XIValuatorState_impl): Add DestroyXIValuatorState.
(DestroyDeviceInfo, SetDeviceId, SetName, SetUse, SetAttachment)
(SetEnabled, AddXIScrollClassInfo, AddXIValuatorClassInfo): New
functions.
(XIDeviceInfo_impl): New interface implementation.
(HandleXIDeviceInfoDestroy): New function.
(DestroyDeviceController, AddDeviceInfo, GetDeviceInfo): New
functions.
(device_controller_impl): New interface.
(HandleTestDeviceControllerDestroy): New function.
(GetDeviceController): New function.
(seat_controller_impl): Add it.
(XLGetTestSeat): Send new `device_id' event.

* tests/seat_test.c (enum test_expect_event_kind): Add
POINTER_AXIS_VALUE120_EVENT.
(struct test_recorded_axis_value120_event): New event kind.
(enum test_kind): Add TEST_VALUATOR_KIND.
(test_names): Add test_valuator.
(LAST_TEST): Set to TEST_VALUATOR_KIND.
(run_valuator_test): New function.
(test_single_step): Implement accordingly.
(expect_axis_value120_event, handle_pointer_axis_value120): New
functions.

* tests/test_harness.c (handle_seat_controller_device_id): New
function.
(seat_controller_listener): New listener.
(test_init_seat): Wait for device ID and init device controller.

* tests/test_harness.h (struct test_seat): Add device controller
and device ID fields.
2022-11-10 06:14:51 +00:00
hujianwei
45df6087d6 Update dmabuf and seat tests
* tests/dmabuf_test.c (enum test_kind): Add XBGR888_KIND.
(test_names): Add that test.
(LAST_TEST): Set to XBGR888_KIND.
(verify_single_step, test_single_step, test_next_step):
Implement that test, but keep it disabled for now.
* tests/seat_test.c (struct test_subsurface): New struct.
(enum test_kind): Add TEST_GRAB_KIND.
(test_names): Add that test kind.
(LAST_TEST): Set to TEST_GRAB_KIND.
(make_test_subsurface): New function.
(run_grab_test): New functions.
(test_single_step): Implement new test.
(expect_enter_event): Accept surface arg.
(expect_surface_enter): Adjust accordingly.
(handle_wl_callback_done, wait_frame_callback): New functions.
2022-11-09 02:12:28 +00:00
hujianwei
a8297024f1 Add dma-buf tests
* tests/Imakefile (LOCAL_LIBRARIES): Require libgbm and libdrm.
(OBJS9, SRCS9): Add dmabuf_test.c/.o.
(PROGRAMS): Add dmabuf_test.
(dmabuf_test): New program.
* tests/run_tests.sh: Add dmabuf_test.
* tests/seat_test.c (handle_pointer_enter, handle_pointer_leave)
(handle_pointer_motion): Pacify some GCC warnings.
* tests/svnignore.txt: Add dmabuf_test.
* tests/test_harness.h: Include sys/types.h.
2022-11-08 11:53:25 +00:00
hujianwei
b487cbe320 Add button press and grab test
* tests/seat_test.c (enum test_expect_event_kind): Add leave and
button events.
(struct test_expect_data): Remove structure.
(struct test_recorded_event): New structure.
(struct test_recorded_leave_event)
(struct test_recorded_button_event)
(struct test_recorded_frame_event)
(struct test_recorded_enter_event)
(struct test_recorded_motion_event): New structures.  Replace
old event verification mechanism with a mechanism for recording
events sent from the pointer device. and verifying them later.
(enum test_kind, test_names): Add TEST_CLICK_KIND.
(LAST_TEST): Set to TEST_CLICK_KIND.
(num_listener_data, current_listener_data): Remove variables.
(recording_events, record_tail): New variables.
(run_click_test, test_single_step): Implement new kind of test.
(record_events, expect_button_event, expect_frame_event)
(expect_enter_event, expect_motion_event, expect_leave_event)
(expect_button_event, expect_no_events): New functions for
recording and inspecting input events.
(expect_surface_enter, expect_surface_motion): Reimplement in
terms of those functions.
(get_next_expect_data): Delete function.
(handle_pointer_enter, handle_pointer_leave, handle_pointer_motion)
(handle_pointer_button, handle_pointer_frame): Record events
instead of matching them against a list of verified events.
2022-11-07 10:23:12 +00:00
hujianwei
13a399bd35 * tests/seat_test.c (get_next_expect_data): Remove unused field. 2022-11-07 06:21:46 +00:00
hujianwei
ef456e4d24 Check in new files for seat tests
* test_seat.c:
* tests/seat_test.c:
* tests/seat_test.png: New files.
2022-11-07 06:05:08 +00:00