2 #include "mockclient.h"
3 #include "mockcompositor.h"
4 #include <libds-tizen/text_input.h>
5 #include <libds/seat.h>
6 #include <text-server-protocol.h>
7 #include <text-client-protocol.h>
9 #define TEXT_INPUT_MGR_VERSION 1
10 #define SEAT_VERSION 7
12 class MockTextInputCompositor : public MockCompositor
15 MockTextInputCompositor()
16 : MockCompositor(&MockTextInputCompositor::TestSetup, this)
18 ds_inf("%s : this(%p)", __func__, this);
20 // initialize the flags to check
22 bNewTextInput = false;
26 bInvokeAction = false;
28 bPreferredLanguage = false;
31 ~MockTextInputCompositor()
33 ds_inf("%s : this(%p)", __func__, this);
36 static void TestSetup(void *data)
38 MockTextInputCompositor *mockComp =
39 static_cast<MockTextInputCompositor *>(data);
40 Compositor *comp = mockComp->compositor;
42 ds_inf("%s: mockComp(%p)", __func__, mockComp);
44 ds_seat_create(comp->display, "seat0"); //for client to be bound to wl_seat_interface
46 mockComp->mTextInputMgr = ds_tizen_text_input_manager_create(comp->display);
49 mockComp->mDestroyListener.notify =
50 MockTextInputCompositor::DestroyCallback;
51 mockComp->mDestroyListener.parent = mockComp;
52 ds_tizen_text_input_manager_add_destroy_listener(mockComp->mTextInputMgr,
53 &mockComp->mDestroyListener);
55 mockComp->mNewTextInputListener.notify =
56 MockTextInputCompositor::NewTextInputCallback;
57 mockComp->mNewTextInputListener.parent = mockComp;
58 ds_tizen_text_input_manager_add_new_text_input_listener(mockComp->mTextInputMgr,
59 &mockComp->mNewTextInputListener);
62 static void DestroyCallback(struct wl_listener *listener, void *data)
64 ds_inf("%s", __func__);
66 MockTextInputCompositor *mockComp =
67 reinterpret_cast<DestroyListener *>(listener)->parent;
69 mockComp->bDestroyed = true;
72 static void NewTextInputCallback(struct wl_listener *listener, void *data)
74 struct ds_tizen_text_input *text_input = (ds_tizen_text_input *)data;
75 ds_inf("%s", __func__);
77 MockTextInputCompositor *mockComp =
78 reinterpret_cast<NewTextInputListener *>(listener)->parent;
80 mockComp->bNewTextInput = true;
81 mockComp->mTextInput = text_input;
83 mockComp->mActivateListener.notify =
84 MockTextInputCompositor::ActivateCallback;
85 mockComp->mActivateListener.parent = mockComp;
86 ds_tizen_text_input_add_activate_listener(mockComp->mTextInput,
87 &mockComp->mActivateListener);
89 mockComp->mDeactivateListener.notify =
90 MockTextInputCompositor::DeactivateCallback;
91 mockComp->mDeactivateListener.parent = mockComp;
92 ds_tizen_text_input_add_deactivate_listener(mockComp->mTextInput,
93 &mockComp->mDeactivateListener);
95 mockComp->mResetListener.notify =
96 MockTextInputCompositor::ResetCallback;
97 mockComp->mResetListener.parent = mockComp;
98 ds_tizen_text_input_add_reset_listener(mockComp->mTextInput,
99 &mockComp->mResetListener);
101 mockComp->mContentTypeListener.notify =
102 MockTextInputCompositor::ContentTypeCallback;
103 mockComp->mContentTypeListener.parent = mockComp;
104 ds_tizen_text_input_add_set_content_type_listener(mockComp->mTextInput,
105 &mockComp->mContentTypeListener);
107 mockComp->mInvokeActionListener.notify =
108 MockTextInputCompositor::InvokeActionCallback;
109 mockComp->mInvokeActionListener.parent = mockComp;
110 ds_tizen_text_input_add_invoke_action_listener(mockComp->mTextInput,
111 &mockComp->mInvokeActionListener);
113 mockComp->mCommitStateListener.notify =
114 MockTextInputCompositor::CommitStateCallback;
115 mockComp->mCommitStateListener.parent = mockComp;
116 ds_tizen_text_input_add_commit_state_listener(mockComp->mTextInput,
117 &mockComp->mCommitStateListener);
119 mockComp->mPreferredLanguageListener.notify =
120 MockTextInputCompositor::PreferredLanguageCallback;
121 mockComp->mPreferredLanguageListener.parent = mockComp;
122 ds_tizen_text_input_add_set_preferred_language_listener(mockComp->mTextInput,
123 &mockComp->mPreferredLanguageListener);
126 static void ActivateCallback(struct wl_listener *listener, void *data)
128 struct ds_tizen_text_input_event_activate *event = (struct ds_tizen_text_input_event_activate *)data;
130 ds_inf("%s", __func__);
132 MockTextInputCompositor *mockComp =
133 reinterpret_cast<ActivateListener *>(listener)->parent;
135 mockComp->bActivated = true;
136 mockComp->mSeat = event->seat;
137 mockComp->mSurface = event->surface;
140 static void DeactivateCallback(struct wl_listener *listener, void *data)
142 struct ds_tizen_text_input_event_deactivate *event = (struct ds_tizen_text_input_event_deactivate *)data;
144 ds_inf("%s", __func__);
146 MockTextInputCompositor *mockComp =
147 reinterpret_cast<DeactivateListener *>(listener)->parent;
149 mockComp->bActivated = false;
150 if (mockComp->mSeat == event->seat)
151 mockComp->mSeat = NULL;
152 mockComp->mSurface = NULL;
156 static void ResetCallback(struct wl_listener *listener, void *data)
158 ds_inf("%s", __func__);
160 MockTextInputCompositor *mockComp =
161 reinterpret_cast<DeactivateListener *>(listener)->parent;
163 mockComp->bReset = true;
166 static void ContentTypeCallback(struct wl_listener *listener, void *data)
168 ds_inf("%s", __func__);
170 MockTextInputCompositor *mockComp =
171 reinterpret_cast<DeactivateListener *>(listener)->parent;
173 mockComp->bContentType = true;
176 static void InvokeActionCallback(struct wl_listener *listener, void *data)
178 ds_inf("%s", __func__);
180 MockTextInputCompositor *mockComp =
181 reinterpret_cast<DeactivateListener *>(listener)->parent;
183 mockComp->bInvokeAction = true;
186 static void CommitStateCallback(struct wl_listener *listener, void *data)
188 ds_inf("%s", __func__);
190 MockTextInputCompositor *mockComp =
191 reinterpret_cast<DeactivateListener *>(listener)->parent;
193 mockComp->bCommitState = true;
196 static void PreferredLanguageCallback(struct wl_listener *listener, void *data)
198 ds_inf("%s", __func__);
200 MockTextInputCompositor *mockComp =
201 reinterpret_cast<DeactivateListener *>(listener)->parent;
203 mockComp->bPreferredLanguage = true;
208 ds_inf("%s", __func__);
210 ds_tizen_text_input_send_enter(mTextInput, mSurface);
214 ds_inf("%s", __func__);
216 ds_tizen_text_input_send_leave(mTextInput);
218 void SendModifiersMap(struct wl_array *map)
220 ds_inf("%s", __func__);
222 ds_tizen_text_input_send_modifiers_map(mTextInput, map);
224 void SendInputPanelState(uint32_t state)
226 ds_inf("%s", __func__);
228 ds_tizen_text_input_send_input_panel_state(mTextInput, state);
230 void SendPreeditString(uint32_t serial, const char *text, const char *commit)
232 ds_inf("%s", __func__);
234 ds_tizen_text_input_send_preedit_string(mTextInput, serial, text, commit);
236 void SendPreeditStyling(uint32_t index, uint32_t length, uint32_t style)
238 ds_inf("%s", __func__);
240 ds_tizen_text_input_send_preedit_styling(mTextInput, index, length, style);
242 void SendPreeditCursor(uint32_t index)
244 ds_inf("%s", __func__);
246 ds_tizen_text_input_send_preedit_cursor(mTextInput, index);
248 void SendCommitString(uint32_t serial, const char *text)
250 ds_inf("%s", __func__);
252 ds_tizen_text_input_send_commit_string(mTextInput, serial, text);
254 void SendCursorPosition(int32_t index, int32_t anchor)
256 ds_inf("%s", __func__);
258 ds_tizen_text_input_send_cursor_position(mTextInput, index, anchor);
260 void SendDeleteSurroundingText(int32_t index, uint32_t length)
262 ds_inf("%s", __func__);
264 ds_tizen_text_input_send_delete_surrounding_text(mTextInput, index, length);
266 void SendKeysym(uint32_t serial, uint32_t time, uint32_t sym, uint32_t state,
269 ds_inf("%s", __func__);
271 ds_tizen_text_input_send_keysym(mTextInput, serial, time, sym, state, modifiers);
273 void SendLanguage(uint32_t serial, const char *language)
275 ds_inf("%s", __func__);
277 ds_tizen_text_input_send_language(mTextInput, serial, language);
279 void SendTextDirection(uint32_t serial, uint32_t direction)
281 ds_inf("%s", __func__);
283 ds_tizen_text_input_send_text_direction(mTextInput, serial, direction);
295 bool bPreferredLanguage;
297 struct ds_seat *mSeat;
298 struct ds_surface *mSurface;
301 struct ds_tizen_text_input_manager *mTextInputMgr;
302 struct ds_tizen_text_input *mTextInput;
304 struct DestroyListener: ::wl_listener {
305 MockTextInputCompositor *parent;
307 DestroyListener mDestroyListener;
309 struct NewTextInputListener: ::wl_listener {
310 MockTextInputCompositor *parent;
312 NewTextInputListener mNewTextInputListener;
314 struct ActivateListener: ::wl_listener {
315 MockTextInputCompositor *parent;
317 ActivateListener mActivateListener;
319 struct DeactivateListener: ::wl_listener {
320 MockTextInputCompositor *parent;
322 DeactivateListener mDeactivateListener;
324 struct ResetListener: ::wl_listener {
325 MockTextInputCompositor *parent;
327 ResetListener mResetListener;
329 struct ContentTypeListener: ::wl_listener {
330 MockTextInputCompositor *parent;
332 ContentTypeListener mContentTypeListener;
334 struct InvokeActionListener: ::wl_listener {
335 MockTextInputCompositor *parent;
337 InvokeActionListener mInvokeActionListener;
339 struct CommitStateListener: ::wl_listener {
340 MockTextInputCompositor *parent;
342 CommitStateListener mCommitStateListener;
344 struct PreferredLanguageListener: ::wl_listener {
345 MockTextInputCompositor *parent;
347 PreferredLanguageListener mPreferredLanguageListener;
350 class MockTextInputClient : public MockClient
353 MockTextInputClient()
357 compositor_res(nullptr),
358 wl_text_input_manager(nullptr),
362 MockTextInputClient(const struct wl_registry_listener *listener)
363 : MockClient(listener, this)
365 ds_inf("%s", __func__);
368 ~MockTextInputClient()
370 ds_inf("%s", __func__);
373 void SetWlCompositor(struct wl_compositor *global_res)
375 ds_inf("%s", __func__);
377 compositor_res = global_res;
380 struct wl_compositor *GetWlCompositor()
382 ds_inf("%s", __func__);
384 return compositor_res;
387 void SetTextInputMgr(struct wl_text_input_manager *global_res)
389 ds_inf("%s", __func__);
390 wl_text_input_manager = global_res;
393 struct wl_text_input_manager *GetTextInputMgr()
395 ds_inf("%s", __func__);
397 return wl_text_input_manager;
400 void SetSeat(struct wl_seat *global_res)
402 ds_inf("%s", __func__);
403 wl_seat = global_res;
406 struct wl_seat *GetSeat()
408 ds_inf("%s", __func__);
419 struct wl_compositor *compositor_res;
420 struct wl_text_input_manager *wl_text_input_manager;
421 struct wl_seat *wl_seat;
425 client_registry_cb_global(void *data, struct wl_registry *registry,
426 uint32_t name, const char *interface, uint32_t version)
428 ds_inf("%s", __func__);
430 MockTextInputClient *client = static_cast<MockTextInputClient *>(data);
431 struct wl_compositor *compositor_res;
432 struct wl_text_input_manager *wl_text_input_manager;
433 struct wl_seat *wl_seat;
435 if (!strcmp(interface, "wl_compositor")) {
436 compositor_res = (struct wl_compositor *)wl_registry_bind(registry,
437 name, &wl_compositor_interface, 1);
438 if (compositor_res == nullptr) {
439 ds_err("wl_registry_bind() failed. wl_compositor resource.");
442 client->SetWlCompositor(compositor_res);
443 } else if (!strcmp(interface, "wl_text_input_manager")) {
444 wl_text_input_manager = (struct wl_text_input_manager *)wl_registry_bind(registry,
445 name, &wl_text_input_manager_interface, TEXT_INPUT_MGR_VERSION);
446 if (wl_text_input_manager == nullptr) {
447 ds_err("wl_registry_bind() failed. wl_text_input_manager resource.");
450 client->SetTextInputMgr(wl_text_input_manager);
451 } else if (!strcmp(interface, "wl_seat")) {
452 wl_seat = (struct wl_seat *)wl_registry_bind(registry,
453 name, &wl_seat_interface, SEAT_VERSION);
454 if (wl_seat == nullptr) {
455 ds_err("wl_registry_bind() failed. wl_seat resource.");
458 client->SetSeat(wl_seat);
463 client_registry_cb_global_remove(void *data, struct wl_registry *registry,
466 ds_inf("%s", __func__);
468 MockTextInputClient *client = static_cast<MockTextInputClient *>(data);
469 struct wl_compositor *compositor_res = client->GetWlCompositor();
470 struct wl_text_input_manager *text_input_mgr_res = client->GetTextInputMgr();
471 struct wl_seat *seat_res = client->GetSeat();
473 wl_seat_destroy(seat_res);
474 wl_text_input_manager_destroy(text_input_mgr_res);
475 wl_compositor_destroy(compositor_res);
478 static const struct wl_registry_listener registry_listener = {
479 .global = client_registry_cb_global,
480 .global_remove = client_registry_cb_global_remove
484 text_input_cb_enter(void *data, struct wl_text_input *text_input,
485 struct wl_surface *surface)
487 ds_inf("%s", __func__);
488 MockTextInputClient *client = static_cast<MockTextInputClient *>(data);
489 client->bEnter = true;
492 text_input_cb_leave(void *data, struct wl_text_input *text_input)
494 ds_inf("%s", __func__);
495 MockTextInputClient *client = static_cast<MockTextInputClient *>(data);
496 client->bLeave = true;
499 text_input_cb_modifiers_map(void *data, struct wl_text_input *text_input,
500 struct wl_array *map)
502 ds_inf("%s", __func__);
503 MockTextInputClient *client = static_cast<MockTextInputClient *>(data);
504 client->bCallback = true;
507 text_input_cb_input_panel_state(void *data, struct wl_text_input *text_input,
510 ds_inf("%s", __func__);
511 MockTextInputClient *client = static_cast<MockTextInputClient *>(data);
512 client->bCallback = true;
515 text_input_cb_preedit_string(void *data, struct wl_text_input *text_input,
516 uint32_t serial, const char *text, const char *commit)
518 ds_inf("%s", __func__);
519 MockTextInputClient *client = static_cast<MockTextInputClient *>(data);
520 client->bCallback = true;
523 text_input_cb_preedit_styling(void *data, struct wl_text_input *text_input,
524 uint32_t index, uint32_t length, uint32_t style)
526 ds_inf("%s", __func__);
527 MockTextInputClient *client = static_cast<MockTextInputClient *>(data);
528 client->bCallback = true;
531 text_input_cb_preedit_cursor(void *data, struct wl_text_input *text_input,
534 ds_inf("%s", __func__);
535 MockTextInputClient *client = static_cast<MockTextInputClient *>(data);
536 client->bCallback = true;
539 text_input_cb_commit_string(void *data, struct wl_text_input *text_input,
540 uint32_t serial, const char *text)
542 ds_inf("%s", __func__);
543 MockTextInputClient *client = static_cast<MockTextInputClient *>(data);
544 client->bCallback = true;
547 text_input_cb_cursor_position(void *data, struct wl_text_input *text_input,
548 int32_t index, int32_t anchor)
550 ds_inf("%s", __func__);
551 MockTextInputClient *client = static_cast<MockTextInputClient *>(data);
552 client->bCallback = true;
555 text_input_cb_delete_surrounding_text(void *data,
556 struct wl_text_input *text_input, int32_t index, uint32_t length)
558 ds_inf("%s", __func__);
559 MockTextInputClient *client = static_cast<MockTextInputClient *>(data);
560 client->bCallback = true;
563 text_input_cb_keysym(void *data, struct wl_text_input *text_input,
564 uint32_t serial, uint32_t time, uint32_t sym, uint32_t state,
567 ds_inf("%s", __func__);
568 MockTextInputClient *client = static_cast<MockTextInputClient *>(data);
569 client->bCallback = true;
572 text_input_cb_language(void *data, struct wl_text_input *text_input,
573 uint32_t serial, const char *language)
575 ds_inf("%s", __func__);
576 MockTextInputClient *client = static_cast<MockTextInputClient *>(data);
577 client->bCallback = true;
580 text_input_cb_text_direction(void *data, struct wl_text_input *text_input,
581 uint32_t serial, uint32_t direction)
583 ds_inf("%s", __func__);
584 MockTextInputClient *client = static_cast<MockTextInputClient *>(data);
585 client->bCallback = true;
589 text_input_cb_selection_region(void *data,
590 struct wl_text_input *text_input,
596 text_input_cb_private_command(void *data,
597 struct wl_text_input *text_input,
602 text_input_cb_input_panel_geometry(void *data,
603 struct wl_text_input *text_input,
610 text_input_cb_input_panel_data(void *data,
611 struct wl_text_input *text_input,
613 const char *input_panel_data,
617 text_input_cb_get_selection_text (void *data,
618 struct wl_text_input *text_input,
622 text_input_cb_get_surrounding_text (void *data,
623 struct wl_text_input *text_input,
624 uint32_t maxlen_before,
625 uint32_t maxlen_after,
629 text_input_cb_filter_key_event_done(void *data,
630 struct wl_text_input *text_input,
635 text_input_cb_hide_permission(void *data,
636 struct wl_text_input *text_input,
640 text_input_cb_recapture_string(void *data,
641 struct wl_text_input *text_input,
646 const char *preedit_commit,
650 text_input_cb_input_panel_event(void *data,
651 struct wl_text_input *text_input,
658 text_input_cb_commit_content(void *data,
659 struct wl_text_input *text_input,
662 const char *description,
663 const char *mime_types)
665 static const struct wl_text_input_listener text_input_cb_listener =
667 .enter = text_input_cb_enter,
668 .leave = text_input_cb_leave,
669 .modifiers_map = text_input_cb_modifiers_map,
670 .input_panel_state = text_input_cb_input_panel_state,
671 .preedit_string = text_input_cb_preedit_string,
672 .preedit_styling = text_input_cb_preedit_styling,
673 .preedit_cursor = text_input_cb_preedit_cursor,
674 .commit_string = text_input_cb_commit_string,
675 .cursor_position = text_input_cb_cursor_position,
676 .delete_surrounding_text = text_input_cb_delete_surrounding_text,
677 .keysym = text_input_cb_keysym,
678 .language = text_input_cb_language,
679 .text_direction = text_input_cb_text_direction,
681 .selection_region = text_input_cb_selection_region,
682 .private_command = text_input_cb_private_command,
683 .input_panel_geometry = text_input_cb_input_panel_geometry,
684 .input_panel_data = text_input_cb_input_panel_data,
685 .get_selection_text = text_input_cb_get_selection_text,
686 .get_surrounding_text = text_input_cb_get_surrounding_text,
687 .filter_key_event_done = text_input_cb_filter_key_event_done,
688 .hide_permission = text_input_cb_hide_permission,
689 .recapture_string = text_input_cb_recapture_string,
690 .input_panel_event = text_input_cb_input_panel_event,
691 .commit_content = text_input_cb_commit_content,
694 class TextInputTest : public ::testing::Test
697 void SetUp(void) override;
698 void TearDown(void) override;
700 MockTextInputCompositor *comp;
701 MockTextInputClient *client;
702 struct wl_compositor *compositor_res;
703 struct wl_text_input_manager *text_input_mgr_res;
704 struct wl_text_input *text_input_res;
705 struct wl_seat *seat_res;
709 TextInputTest::SetUp(void)
711 ds_inf("%s", __func__);
713 comp = new MockTextInputCompositor();
714 client = new MockTextInputClient(®istry_listener);
715 compositor_res = client->GetWlCompositor();
716 text_input_mgr_res = client->GetTextInputMgr();
717 seat_res = client->GetSeat();
719 text_input_res = wl_text_input_manager_create_text_input(text_input_mgr_res);
721 wl_text_input_add_listener(text_input_res,
722 &text_input_cb_listener, client);
728 TextInputTest::TearDown(void)
730 ds_inf("%s", __func__);
738 TEST_F(TextInputTest, Create_P)
743 TEST_F(TextInputTest, Req_TextInputMgr_CreateTextInput)
745 EXPECT_TRUE(comp->bNewTextInput);
746 EXPECT_TRUE(text_input_res != NULL);
749 TEST_F(TextInputTest, Req_TextInput_Activate)
751 struct wl_surface *surface_res;
753 surface_res = wl_compositor_create_surface(compositor_res);
755 EXPECT_TRUE(surface_res != NULL);
756 wl_text_input_activate(text_input_res, seat_res, surface_res);
758 EXPECT_TRUE(comp->bActivated);
759 EXPECT_TRUE(comp->mSeat != NULL);
760 EXPECT_TRUE(comp->mSurface != NULL);
762 EXPECT_TRUE(client->bEnter);
765 TEST_F(TextInputTest, Req_TextInput_Deactivate)
767 struct wl_surface *surface_res;
769 surface_res = wl_compositor_create_surface(compositor_res);
771 EXPECT_TRUE(surface_res != NULL);
772 wl_text_input_activate(text_input_res, seat_res, surface_res);
774 EXPECT_TRUE(comp->bActivated);
775 EXPECT_TRUE(comp->mSeat != NULL);
776 EXPECT_TRUE(comp->mSurface != NULL);
778 EXPECT_TRUE(client->bEnter);
780 wl_text_input_deactivate(text_input_res, seat_res);
782 EXPECT_TRUE(comp->bActivated == false);
783 EXPECT_TRUE(comp->mSeat == NULL);
784 EXPECT_TRUE(comp->mSurface == NULL);
786 EXPECT_TRUE(client->bLeave);
789 TEST_F(TextInputTest, Req_TextInput_Reset)
791 wl_text_input_reset(text_input_res);
793 EXPECT_TRUE(comp->bReset);
796 TEST_F(TextInputTest, Req_TextInput_SetContentType)
798 uint32_t hint = 0, purpose = 0;
799 wl_text_input_set_content_type(text_input_res, hint, purpose);
801 EXPECT_TRUE(comp->bContentType);
804 TEST_F(TextInputTest, Req_TextInput_SetPreferredLanguage)
806 wl_text_input_set_preferred_language(text_input_res, "en");
808 EXPECT_TRUE(comp->bPreferredLanguage);
811 TEST_F(TextInputTest, Req_TextInput_CommitState)
815 wl_text_input_commit_state(text_input_res, serial);
817 EXPECT_TRUE(comp->bCommitState);
820 TEST_F(TextInputTest, Req_TextInput_InvokeAction)
822 uint32_t button = 0, index = 1;
823 wl_text_input_invoke_action(text_input_res, button, index);
825 EXPECT_TRUE(comp->bInvokeAction);
828 TEST_F(TextInputTest, Ev_TextInput_Enter)
830 struct wl_surface *surface_res;
832 surface_res = wl_compositor_create_surface(compositor_res);
834 EXPECT_TRUE(surface_res != NULL);
835 wl_text_input_activate(text_input_res, seat_res, surface_res);
838 EXPECT_TRUE(comp->mSurface != NULL);
842 EXPECT_TRUE(client->bEnter);
845 TEST_F(TextInputTest, Ev_TextInput_Leave)
847 struct wl_surface *surface_res;
849 surface_res = wl_compositor_create_surface(compositor_res);
851 EXPECT_TRUE(surface_res != NULL);
852 wl_text_input_activate(text_input_res, seat_res, surface_res);
855 EXPECT_TRUE(comp->mSurface != NULL);
859 EXPECT_TRUE(client->bLeave);
862 TEST_F(TextInputTest, Ev_TextInput_ModifiersMap)
864 struct wl_array map_data;
867 const char *modShift = "Shift", *modControl = "Control", *mod1 = "Mod1";
869 wl_array_init(&map_data);
871 size = strlen(modShift) + 1;
872 data = wl_array_add(&map_data, size);
873 memcpy(data, modShift, size);
875 size = strlen(modControl) + 1;
876 data = wl_array_add(&map_data, size);
877 memcpy(data, modControl, size);
879 size = strlen(mod1) + 1;
880 data = wl_array_add(&map_data, size);
881 memcpy(data, mod1, size);
883 comp->SendModifiersMap(&map_data);
886 EXPECT_TRUE(client->bCallback);
889 TEST_F(TextInputTest, Ev_TextInput_InputPanelState)
891 comp->SendInputPanelState(WL_TEXT_INPUT_INPUT_PANEL_STATE_SHOW);
894 EXPECT_TRUE(client->bCallback);
897 TEST_F(TextInputTest, Ev_TextInput_PreeditString)
899 comp->SendPreeditString(1, "", "");
902 EXPECT_TRUE(client->bCallback);
905 TEST_F(TextInputTest, Ev_TextInput_PreeditStyling)
907 comp->SendPreeditStyling(1, 1, 1);
910 EXPECT_TRUE(client->bCallback);
913 TEST_F(TextInputTest, Ev_TextInput_PreeditCursor)
915 comp->SendPreeditCursor(0);
918 EXPECT_TRUE(client->bCallback);
921 TEST_F(TextInputTest, Ev_TextInput_CommitString)
923 comp->SendCommitString(0, "");
926 EXPECT_TRUE(client->bCallback);
929 TEST_F(TextInputTest, Ev_TextInput_CursorPosition)
931 comp->SendCursorPosition(1, 1);
934 EXPECT_TRUE(client->bCallback);
937 TEST_F(TextInputTest, Ev_TextInput_DeleteSurroundingText)
939 comp->SendDeleteSurroundingText(1, 1);
942 EXPECT_TRUE(client->bCallback);
945 TEST_F(TextInputTest, Ev_TextInput_Keysym)
947 comp->SendKeysym(1, 10, 65, 1, 1);
950 EXPECT_TRUE(client->bCallback);
953 TEST_F(TextInputTest, Ev_TextInput_Language)
955 comp->SendLanguage(1, "en_US");
958 EXPECT_TRUE(client->bCallback);
961 TEST_F(TextInputTest, Ev_TextInput_TextDirection)
963 comp->SendTextDirection(1, 1);
966 EXPECT_TRUE(client->bCallback);