• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2021 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//base/inputmethod/imf/inputmethod.gni")
15import("//build/test.gni")
16
17config("module_private_config") {
18  visibility = [ ":*" ]
19
20  include_dirs = [
21    "${inputmethod_path}/frameworks/ndk/include",
22    "${inputmethod_path}/interfaces/kits/c",
23    "${inputmethod_path}/services/include",
24    "${inputmethod_path}/test/common",
25    "${inputmethod_path}/services/adapter/settings_data_provider/common/include",
26  ]
27}
28
29module_output_path = "imf/imf/cpp"
30
31ohos_unittest("InputMethodControllerTest") {
32  branch_protector_ret = "pac_ret"
33  sanitize = {
34    cfi = true
35    cfi_cross_dso = true
36    debug = false
37    blocklist = "./inputmethod_blocklist.txt"
38  }
39  module_out_path = module_output_path
40
41  sources = [
42    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_agent_service_impl.cpp",
43    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_service_impl.cpp",
44    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_info.cpp",
45    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_service_impl.cpp",
46    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_service_impl.cpp",
47    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_tools.cpp",
48    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/keyevent_consumer_service_impl.cpp",
49    "${inputmethod_path}/services/src/input_control_channel_service_impl.cpp",
50    "${inputmethod_path}/services/src/input_type_manager.cpp",
51    "src/ime_event_monitor_manager_test.cpp",
52    "src/input_method_controller_test.cpp",
53  ]
54
55  configs = [ ":module_private_config" ]
56
57  deps = [
58    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_control_channel_proxy",
59    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_method_core_stub",
60    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
61    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_client_stub",
62    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_method_agent_proxy",
63    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
64    "${inputmethod_path}/services:inputmethod_service_static",
65    "${inputmethod_path}/test/common:inputmethod_test_common",
66    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
67    "${inputmethod_path}/test/unittest/resource/ohos_test:copy_ohos_test",
68  ]
69
70  external_deps = [
71    "ability_base:want",
72    "ability_runtime:ability_context_native",
73    "ability_runtime:ability_manager",
74    "ability_runtime:runtime",
75    "access_token:libaccesstoken_sdk",
76    "bundle_framework:appexecfwk_core",
77    "cJSON:cjson",
78    "c_utils:utils",
79    "config_policy:configpolicy_util",
80    "data_share:datashare_common",
81    "data_share:datashare_consumer",
82    "eventhandler:libeventhandler",
83    "googletest:gtest_main",
84    "graphic_2d:librender_service_base",
85    "hilog:libhilog",
86    "input:libmmi-client",
87    "ipc:ipc_single",
88    "napi:ace_napi",
89    "safwk:system_ability_fwk",
90    "samgr:samgr_proxy",
91    "window_manager:libdm",
92  ]
93
94  if (window_manager_use_sceneboard) {
95    external_deps += [ "window_manager:libwm_lite" ]
96  } else {
97    external_deps += [ "window_manager:libwm" ]
98  }
99
100  if (build_selinux) {
101    external_deps += [ "selinux_adapter:librestorecon" ]
102    cflags = [ "-DWITH_SELINUX" ]
103  }
104}
105
106ohos_unittest("InputMethodAttachTest") {
107  branch_protector_ret = "pac_ret"
108  sanitize = {
109    cfi = true
110    cfi_cross_dso = true
111    debug = false
112  }
113  module_out_path = module_output_path
114
115  sources = [
116    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_info.cpp",
117    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_service_impl.cpp",
118    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_service_impl.cpp",
119    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_tools.cpp",
120    "${inputmethod_path}/services/src/input_control_channel_service_impl.cpp",
121    "${inputmethod_path}/test/common/src/keyboard_listener_test_impl.cpp",
122    "src/input_method_attach_test.cpp",
123  ]
124
125  configs = [ ":module_private_config" ]
126
127  deps = [
128    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_control_channel_proxy",
129    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
130    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_client_stub",
131    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_method_agent_proxy",
132    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
133    "${inputmethod_path}/services:inputmethod_service_static",
134    "${inputmethod_path}/services/json:imf_json_static",
135    "${inputmethod_path}/test/common:inputmethod_test_common",
136    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
137  ]
138
139  external_deps = [
140    "ability_base:want",
141    "ability_runtime:ability_context_native",
142    "ability_runtime:ability_manager",
143    "ability_runtime:runtime",
144    "access_token:libaccesstoken_sdk",
145    "bundle_framework:appexecfwk_core",
146    "cJSON:cjson",
147    "c_utils:utils",
148    "data_share:datashare_common",
149    "data_share:datashare_consumer",
150    "googletest:gmock",
151    "googletest:gtest_main",
152    "hilog:libhilog",
153    "input:libmmi-client",
154    "napi:ace_napi",
155    "safwk:system_ability_fwk",
156    "window_manager:libdm",
157  ]
158
159  if (window_manager_use_sceneboard) {
160    external_deps += [ "window_manager:libwm_lite" ]
161  } else {
162    external_deps += [ "window_manager:libwm" ]
163  }
164}
165ohos_unittest("InputMethodAbilityTest") {
166  branch_protector_ret = "pac_ret"
167  sanitize = {
168    cfi = true
169    cfi_cross_dso = true
170    debug = false
171  }
172  module_out_path = module_output_path
173
174  sources = [
175    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_agent_service_impl.cpp",
176    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_service_impl.cpp",
177    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/task_manager.cpp",
178    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/tasks/task.cpp",
179    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_info.cpp",
180    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_service_impl.cpp",
181    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_service_impl.cpp",
182    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_tools.cpp",
183    "${inputmethod_path}/services/src/input_control_channel_service_impl.cpp",
184    "src/input_method_ability_exception_test.cpp",
185    "src/input_method_ability_test.cpp",
186  ]
187
188  configs = [ ":module_private_config" ]
189
190  deps = [
191    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_control_channel_proxy",
192    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_method_core_proxy",
193    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_method_core_stub",
194    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
195    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_client_stub",
196    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_method_agent_proxy",
197    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_method_agent_stub",
198    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
199    "${inputmethod_path}/services:inputmethod_service_static",
200    "${inputmethod_path}/services/json:imf_json_static",
201    "${inputmethod_path}/test/common:inputmethod_test_common",
202    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
203    "${inputmethod_path}/test/unittest/resource/ohos_test:copy_ohos_test",
204  ]
205
206  external_deps = [
207    "ability_base:want",
208    "ability_runtime:ability_context_native",
209    "ability_runtime:ability_manager",
210    "ability_runtime:runtime",
211    "access_token:libaccesstoken_sdk",
212    "bundle_framework:appexecfwk_base",
213    "bundle_framework:appexecfwk_core",
214    "cJSON:cjson",
215    "c_utils:utils",
216    "data_share:datashare_common",
217    "data_share:datashare_consumer",
218    "googletest:gtest_main",
219    "graphic_2d:librender_service_client",
220    "graphic_2d:window_animation",
221    "hilog:libhilog",
222    "input:libmmi-client",
223    "ipc:ipc_single",
224    "memmgr:memmgrclient",
225    "napi:ace_napi",
226    "os_account:os_account_innerkits",
227    "safwk:system_ability_fwk",
228    "window_manager:libdm",
229    "window_manager:libwsutils",
230  ]
231
232  if (window_manager_use_sceneboard) {
233    external_deps += [ "window_manager:libwm_lite" ]
234  } else {
235    external_deps += [ "window_manager:libwm" ]
236  }
237}
238
239ohos_unittest("InputMethodServiceTest") {
240  branch_protector_ret = "pac_ret"
241  sanitize = {
242    cfi = true
243    cfi_cross_dso = true
244    debug = false
245  }
246  module_out_path = module_output_path
247
248  sources = [ "src/input_method_service_test.cpp" ]
249
250  configs = [ ":module_private_config" ]
251
252  deps = [
253    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
254    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
255    "${inputmethod_path}/services:inputmethod_service",
256    "${inputmethod_path}/test/common:inputmethod_test_common",
257    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
258    "${inputmethod_path}/test/unittest/resource/ohos_test:copy_ohos_test",
259  ]
260
261  external_deps = [
262    "ability_base:want",
263    "ability_runtime:ability_context_native",
264    "ability_runtime:ability_manager",
265    "access_token:libaccesstoken_sdk",
266    "cJSON:cjson",
267    "c_utils:utils",
268    "googletest:gtest_main",
269    "hilog:libhilog",
270    "input:libmmi-client",
271    "ipc:ipc_single",
272    "napi:ace_napi",
273    "window_manager:libdm",
274  ]
275
276  if (window_manager_use_sceneboard) {
277    external_deps += [ "window_manager:libwm_lite" ]
278  } else {
279    external_deps += [ "window_manager:libwm" ]
280  }
281}
282
283ohos_unittest("InputMethodDfxTest") {
284  branch_protector_ret = "pac_ret"
285  sanitize = {
286    cfi = true
287    cfi_cross_dso = true
288    debug = false
289  }
290  module_out_path = module_output_path
291
292  sources = [
293    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_agent_service_impl.cpp",
294    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_service_impl.cpp",
295    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_info.cpp",
296    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_service_impl.cpp",
297    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_service_impl.cpp",
298    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_tools.cpp",
299    "${inputmethod_path}/services/src/input_control_channel_service_impl.cpp",
300    "src/input_method_dfx_test.cpp",
301  ]
302
303  configs = [ ":module_private_config" ]
304
305  deps = [
306    "${inputmethod_path}/common:inputmethod_common",
307    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_control_channel_proxy",
308    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_method_core_stub",
309    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
310    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_client_stub",
311    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_method_agent_proxy",
312    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
313    "${inputmethod_path}/services:inputmethod_service_static",
314    "${inputmethod_path}/test/common:inputmethod_test_common",
315    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
316    "${inputmethod_path}/test/unittest/resource/bundle_dependencies/extImfBundle:extImf",
317    "${inputmethod_path}/test/unittest/resource/ohos_test:copy_ohos_test",
318  ]
319
320  external_deps = [
321    "ability_base:want",
322    "ability_runtime:ability_context_native",
323    "ability_runtime:ability_manager",
324    "ability_runtime:runtime",
325    "access_token:libaccesstoken_sdk",
326    "bundle_framework:appexecfwk_core",
327    "cJSON:cjson",
328    "c_utils:utils",
329    "data_share:datashare_common",
330    "data_share:datashare_consumer",
331    "eventhandler:libeventhandler",
332    "googletest:gtest_main",
333    "graphic_2d:librender_service_base",
334    "hilog:libhilog",
335    "hisysevent:libhisysevent",
336    "hisysevent:libhisyseventmanager",
337    "input:libmmi-client",
338    "ipc:ipc_single",
339    "napi:ace_napi",
340    "safwk:system_ability_fwk",
341    "window_manager:libdm",
342  ]
343
344  if (window_manager_use_sceneboard) {
345    external_deps += [ "window_manager:libwm_lite" ]
346  } else {
347    external_deps += [ "window_manager:libwm" ]
348  }
349}
350
351ohos_unittest("InputMethodPanelTest") {
352  branch_protector_ret = "pac_ret"
353  sanitize = {
354    cfi = true
355    cfi_cross_dso = true
356    debug = false
357  }
358  module_out_path = module_output_path
359
360  sources = [
361    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_agent_service_impl.cpp",
362    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_service_impl.cpp",
363    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_info.cpp",
364    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_service_impl.cpp",
365    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_service_impl.cpp",
366    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_tools.cpp",
367    "${inputmethod_path}/services/src/input_control_channel_service_impl.cpp",
368    "src/input_method_panel_test.cpp",
369  ]
370
371  configs = [ ":module_private_config" ]
372
373  deps = [
374    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_control_channel_proxy",
375    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_method_core_stub",
376    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
377    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
378    "${inputmethod_path}/services:inputmethod_service_static",
379    "${inputmethod_path}/test/common:inputmethod_test_common",
380    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
381    "${inputmethod_path}/test/unittest/resource/bundle_dependencies/extImfBundle:extImf",
382    "${inputmethod_path}/test/unittest/resource/ohos_test:copy_ohos_test",
383  ]
384
385  external_deps = [
386    "ability_base:want",
387    "ability_runtime:ability_context_native",
388    "ability_runtime:ability_manager",
389    "ability_runtime:runtime",
390    "access_token:libaccesstoken_sdk",
391    "bundle_framework:appexecfwk_core",
392    "cJSON:cjson",
393    "c_utils:utils",
394    "common_event_service:cesfwk_innerkits",
395    "data_share:datashare_common",
396    "data_share:datashare_consumer",
397    "eventhandler:libeventhandler",
398    "googletest:gtest_main",
399    "graphic_2d:librender_service_base",
400    "graphic_2d:librender_service_client",
401    "graphic_2d:window_animation",
402    "hilog:libhilog",
403    "input:libmmi-client",
404    "napi:ace_napi",
405    "os_account:os_account_innerkits",
406    "safwk:system_ability_fwk",
407    "window_manager:libdm",
408    "window_manager:libwsutils",
409  ]
410
411  if (window_manager_use_sceneboard) {
412    external_deps += [ "window_manager:libwm_lite" ]
413  } else {
414    external_deps += [ "window_manager:libwm" ]
415  }
416}
417
418ohos_unittest("InputMethodPanelAdjustTest") {
419  branch_protector_ret = "pac_ret"
420  sanitize = {
421    cfi = true
422    cfi_cross_dso = true
423    debug = false
424  }
425  module_out_path = module_output_path
426
427  sources = [
428    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_agent_service_impl.cpp",
429    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_service_impl.cpp",
430    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_info.cpp",
431    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_service_impl.cpp",
432    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_service_impl.cpp",
433    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_tools.cpp",
434    "${inputmethod_path}/services/src/input_control_channel_service_impl.cpp",
435    "src/input_method_panel_adjust_test.cpp",
436  ]
437
438  configs = [ ":module_private_config" ]
439
440  deps = [
441    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_control_channel_proxy",
442    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_method_core_stub",
443    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
444    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_method_agent_proxy",
445    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
446    "${inputmethod_path}/services:inputmethod_service_static",
447    "${inputmethod_path}/test/common:inputmethod_test_common",
448    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
449  ]
450
451  external_deps = [
452    "ability_base:want",
453    "ability_runtime:ability_context_native",
454    "ability_runtime:ability_manager",
455    "ability_runtime:runtime",
456    "access_token:libaccesstoken_sdk",
457    "cJSON:cjson",
458    "c_utils:utils",
459    "data_share:datashare_common",
460    "data_share:datashare_consumer",
461    "googletest:gtest_main",
462    "graphic_2d:librender_service_base",
463    "graphic_2d:librender_service_client",
464    "graphic_2d:window_animation",
465    "hilog:libhilog",
466    "input:libmmi-client",
467    "napi:ace_napi",
468    "safwk:system_ability_fwk",
469    "window_manager:libdm",
470    "window_manager:libwsutils",
471  ]
472
473  if (window_manager_use_sceneboard) {
474    external_deps += [ "window_manager:libwm_lite" ]
475  } else {
476    external_deps += [ "window_manager:libwm" ]
477  }
478}
479
480ohos_unittest("InputMethodSwitchTest") {
481  branch_protector_ret = "pac_ret"
482  sanitize = {
483    cfi = true
484    cfi_cross_dso = true
485    debug = false
486  }
487  module_out_path = module_output_path
488
489  sources = [
490    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_info.cpp",
491    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_service_impl.cpp",
492    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_service_impl.cpp",
493    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_tools.cpp",
494    "src/input_method_switch_test.cpp",
495  ]
496
497  configs = [
498    ":module_private_config",
499    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_native_public_config",
500  ]
501
502  deps = [
503    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_method_agent_proxy",
504    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
505    "${inputmethod_path}/services:inputmethod_service",
506    "${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
507    "${inputmethod_path}/test/common:inputmethod_test_common",
508    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
509    "${inputmethod_path}/test/unittest/resource/bundle_dependencies/extImfBundle:extImf",
510    "${inputmethod_path}/test/unittest/resource/bundle_dependencies/newTestIme:newTestIme",
511    "${inputmethod_path}/test/unittest/resource/ohos_test:copy_ohos_test",
512  ]
513
514  external_deps = [
515    "access_token:libaccesstoken_sdk",
516    "bundle_framework:appexecfwk_base",
517    "bundle_framework:appexecfwk_core",
518    "cJSON:cjson",
519    "c_utils:utils",
520    "data_share:datashare_common",
521    "data_share:datashare_consumer",
522    "googletest:gtest_main",
523    "hilog:libhilog",
524    "input:libmmi-client",
525    "safwk:system_ability_fwk",
526  ]
527
528  if (window_manager_use_sceneboard) {
529    external_deps += [ "window_manager:libwm_lite" ]
530  } else {
531    external_deps += [ "window_manager:libwm" ]
532  }
533
534  if (build_selinux) {
535    external_deps += [ "selinux_adapter:librestorecon" ]
536    cflags = [ "-DWITH_SELINUX" ]
537  }
538}
539
540ohos_unittest("InputMethodPrivateMemberTest") {
541  branch_protector_ret = "pac_ret"
542  sanitize = {
543    cfi = true
544    cfi_cross_dso = true
545    debug = false
546  }
547  module_out_path = module_output_path
548
549  sources = [
550    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_agent_service_impl.cpp",
551    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_service_impl.cpp",
552    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/task_manager.cpp",
553    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/tasks/task.cpp",
554    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_info.cpp",
555    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_service_impl.cpp",
556    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_service_impl.cpp",
557    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_tools.cpp",
558    "${inputmethod_path}/services/adapter/ime_connection_manager/src/ime_connection.cpp",
559    "${inputmethod_path}/services/adapter/settings_data_provider/common/src/settings_data_observer.cpp",
560    "${inputmethod_path}/services/adapter/settings_data_provider/common/src/settings_data_utils.cpp",
561    "${inputmethod_path}/services/src/input_control_channel_service_impl.cpp",
562    "mock/datashare_helper.cpp",
563    "src/input_method_private_member_test.cpp",
564  ]
565
566  configs = [
567    ":module_private_config",
568    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_native_public_config",
569  ]
570
571  deps = [
572    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_control_channel_proxy",
573    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_method_core_stub",
574    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
575    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_method_agent_proxy",
576    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_method_agent_stub",
577    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
578    "${inputmethod_path}/services:inputmethod_service_static",
579    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
580    "${inputmethod_path}/test/unittest/resource/bundle_dependencies/newTestIme:newTestIme",
581    "${inputmethod_path}/test/unittest/resource/ohos_test:copy_ohos_test",
582  ]
583
584  external_deps = [
585    "ability_runtime:ability_connect_callback_stub",
586    "ability_runtime:ability_manager",
587    "ability_runtime:runtime",
588    "access_token:libaccesstoken_sdk",
589    "bundle_framework:appexecfwk_base",
590    "bundle_framework:appexecfwk_core",
591    "cJSON:cjson",
592    "c_utils:utils",
593    "data_share:datashare_common",
594    "data_share:datashare_consumer",
595    "googletest:gtest_main",
596    "hilog:libhilog",
597    "input:libmmi-client",
598    "ipc:ipc_core",
599    "ipc:ipc_single",
600    "napi:ace_napi",
601    "os_account:os_account_innerkits",
602    "safwk:system_ability_fwk",
603    "window_manager:libdm",
604  ]
605
606  if (window_manager_use_sceneboard) {
607    external_deps += [ "window_manager:libwm_lite" ]
608  } else {
609    external_deps += [ "window_manager:libwm" ]
610  }
611}
612
613ohos_unittest("InputMethodEditorTest") {
614  branch_protector_ret = "pac_ret"
615  sanitize = {
616    cfi = true
617    cfi_cross_dso = true
618    debug = false
619  }
620  module_out_path = module_output_path
621
622  sources = [
623    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_info.cpp",
624    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_service_impl.cpp",
625    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_service_impl.cpp",
626    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_tools.cpp",
627    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/keyevent_consumer_service_impl.cpp",
628    "${inputmethod_path}/services/src/input_control_channel_service_impl.cpp",
629    "src/input_method_editor_test.cpp",
630  ]
631
632  configs = [ ":module_private_config" ]
633
634  deps = [
635    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_control_channel_proxy",
636    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
637    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_client_stub",
638    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_method_agent_proxy",
639    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
640    "${inputmethod_path}/services:inputmethod_service_static",
641    "${inputmethod_path}/services/json:imf_json_static",
642    "${inputmethod_path}/test/common:inputmethod_test_common",
643    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
644    "${inputmethod_path}/test/unittest/resource/ohos_test:copy_ohos_test",
645  ]
646
647  external_deps = [
648    "ability_base:want",
649    "ability_runtime:ability_context_native",
650    "ability_runtime:ability_manager",
651    "ability_runtime:runtime",
652    "access_token:libaccesstoken_sdk",
653    "bundle_framework:appexecfwk_core",
654    "cJSON:cjson",
655    "c_utils:utils",
656    "data_share:datashare_common",
657    "data_share:datashare_consumer",
658    "eventhandler:libeventhandler",
659    "googletest:gtest_main",
660    "hilog:libhilog",
661    "input:libmmi-client",
662    "ipc:ipc_single",
663    "napi:ace_napi",
664    "safwk:system_ability_fwk",
665    "window_manager:libdm",
666  ]
667
668  if (window_manager_use_sceneboard) {
669    external_deps += [ "window_manager:libwm_lite" ]
670  } else {
671    external_deps += [ "window_manager:libwm" ]
672  }
673}
674
675ohos_unittest("NewImeSwitchTest") {
676  branch_protector_ret = "pac_ret"
677  sanitize = {
678    cfi = true
679    cfi_cross_dso = true
680    debug = false
681  }
682  module_out_path = module_output_path
683
684  sources = [
685    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_info.cpp",
686    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_service_impl.cpp",
687    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_service_impl.cpp",
688    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_tools.cpp",
689    "src/newIme_switch_test.cpp",
690  ]
691
692  configs = [
693    ":module_private_config",
694    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_native_public_config",
695  ]
696
697  deps = [
698    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_method_agent_proxy",
699    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
700    "${inputmethod_path}/services:inputmethod_service",
701    "${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
702    "${inputmethod_path}/test/common:inputmethod_test_common",
703    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
704    "${inputmethod_path}/test/unittest/resource/bundle_dependencies/newTestIme:newTestIme",
705    "${inputmethod_path}/test/unittest/resource/ohos_test:copy_ohos_test",
706  ]
707
708  external_deps = [
709    "access_token:libaccesstoken_sdk",
710    "bundle_framework:appexecfwk_base",
711    "bundle_framework:appexecfwk_core",
712    "cJSON:cjson",
713    "c_utils:utils",
714    "data_share:datashare_common",
715    "data_share:datashare_consumer",
716    "googletest:gtest_main",
717    "hilog:libhilog",
718    "input:libmmi-client",
719    "safwk:system_ability_fwk",
720  ]
721
722  if (window_manager_use_sceneboard) {
723    external_deps += [ "window_manager:libwm_lite" ]
724  } else {
725    external_deps += [ "window_manager:libwm" ]
726  }
727
728  if (build_selinux) {
729    external_deps += [ "selinux_adapter:librestorecon" ]
730    cflags = [ "-DWITH_SELINUX" ]
731  }
732}
733
734ohos_unittest("NumKeyAppsManagerTest") {
735  branch_protector_ret = "pac_ret"
736  sanitize = {
737    cfi = true
738    cfi_cross_dso = true
739    debug = false
740  }
741  module_out_path = module_output_path
742  include_dirs = [ "${inputmethod_path}/common/include" ]
743  sources = [ "src/numkey_apps_manager_test.cpp" ]
744
745  configs = [ ":module_private_config" ]
746  deps = [
747    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
748    "${inputmethod_path}/services:inputmethod_service_static",
749    "${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
750    "${inputmethod_path}/services/file:imf_file_static",
751    "${inputmethod_path}/services/json:imf_json_static",
752    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
753  ]
754
755  external_deps = [
756    "ability_base:want",
757    "bundle_framework:appexecfwk_core",
758    "c_utils:utils",
759    "config_policy:configpolicy_util",
760    "data_share:datashare_common",
761    "data_share:datashare_consumer",
762    "googletest:gtest_main",
763    "hilog:libhilog",
764    "init:libbeget_proxy",
765    "init:libbegetutil",
766    "input:libmmi-client",
767    "resource_management:global_resmgr",
768  ]
769}
770
771ohos_unittest("IdentityCheckerTest") {
772  branch_protector_ret = "pac_ret"
773  sanitize = {
774    cfi = true
775    cfi_cross_dso = true
776    debug = false
777    blocklist = "./inputmethod_blocklist.txt"
778  }
779  module_out_path = module_output_path
780
781  sources = [
782    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_info.cpp",
783    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_tools.cpp",
784    "${inputmethod_path}/services/adapter/ime_connection_manager/src/ime_connection.cpp",
785    "${inputmethod_path}/services/src/input_control_channel_service_impl.cpp",
786    "src/identity_checker_test.cpp",
787  ]
788
789  configs = [ ":module_private_config" ]
790
791  deps = [
792    "${inputmethod_path}/services:inputmethod_service_static",
793    "${inputmethod_path}/test/common:inputmethod_test_common",
794    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
795  ]
796
797  external_deps = [
798    "ability_base:want",
799    "ability_runtime:ability_context_native",
800    "ability_runtime:ability_manager",
801    "access_token:libaccesstoken_sdk",
802    "bundle_framework:appexecfwk_core",
803    "cJSON:cjson",
804    "c_utils:utils",
805    "data_share:datashare_common",
806    "data_share:datashare_consumer",
807    "googletest:gtest_main",
808    "hilog:libhilog",
809    "input:libmmi-client",
810    "ipc:ipc_single",
811    "napi:ace_napi",
812    "safwk:system_ability_fwk",
813    "window_manager:libdm",
814  ]
815
816  if (window_manager_use_sceneboard) {
817    external_deps += [ "window_manager:libwm_lite" ]
818  } else {
819    external_deps += [ "window_manager:libwm" ]
820  }
821}
822
823ohos_unittest("TextListenerInnerApiTest") {
824  branch_protector_ret = "pac_ret"
825  sanitize = {
826    cfi = true
827    cfi_cross_dso = true
828    debug = false
829  }
830  module_out_path = module_output_path
831
832  sources = [
833    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_info.cpp",
834    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_service_impl.cpp",
835    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_service_impl.cpp",
836    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_tools.cpp",
837    "src/text_listener_inner_api_test.cpp",
838  ]
839
840  configs = [ ":module_private_config" ]
841
842  deps = [
843    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
844    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_method_agent_proxy",
845    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
846    "${inputmethod_path}/services:inputmethod_service",
847    "${inputmethod_path}/test/common:inputmethod_test_common",
848    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
849  ]
850
851  external_deps = [
852    "ability_base:want",
853    "ability_runtime:ability_context_native",
854    "ability_runtime:ability_manager",
855    "access_token:libaccesstoken_sdk",
856    "bundle_framework:appexecfwk_core",
857    "c_utils:utils",
858    "eventhandler:libeventhandler",
859    "googletest:gmock",
860    "googletest:gtest_main",
861    "hilog:libhilog",
862    "input:libmmi-client",
863    "ipc:ipc_single",
864    "napi:ace_napi",
865    "safwk:system_ability_fwk",
866    "samgr:samgr_proxy",
867  ]
868
869  if (window_manager_use_sceneboard) {
870    external_deps += [ "window_manager:libwm_lite" ]
871  } else {
872    external_deps += [ "window_manager:libwm" ]
873  }
874}
875
876ohos_unittest("ImeProxyAgentImeTest") {
877  branch_protector_ret = "pac_ret"
878  sanitize = {
879    cfi = true
880    cfi_cross_dso = true
881    debug = false
882  }
883  module_out_path = module_output_path
884
885  sources = [
886    "${inputmethod_path}/services/src/sys_cfg_parser.cpp",
887    "src/ime_proxy_agent_ime_test.cpp",
888  ]
889
890  configs = [ ":module_private_config" ]
891
892  deps = [
893    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
894    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
895    "${inputmethod_path}/services:inputmethod_service",
896    "${inputmethod_path}/services/file:imf_file_static",
897    "${inputmethod_path}/services/json:imf_json_static",
898    "${inputmethod_path}/test/common:inputmethod_test_common",
899    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
900    "${inputmethod_path}/test/unittest/resource/bundle_dependencies/editorBox:editorBox",
901    "${inputmethod_path}/test/unittest/resource/bundle_dependencies/extImfBundle:extImf",
902    "${inputmethod_path}/test/unittest/resource/ohos_test:copy_ohos_test",
903  ]
904
905  external_deps = [
906    "ability_base:want",
907    "ability_runtime:ability_context_native",
908    "ability_runtime:ability_manager",
909    "access_token:libaccesstoken_sdk",
910    "bundle_framework:appexecfwk_core",
911    "c_utils:utils",
912    "config_policy:configpolicy_util",
913    "googletest:gtest_main",
914    "graphic_2d:librender_service_client",
915    "graphic_2d:window_animation",
916    "hilog:libhilog",
917    "input:libmmi-client",
918    "ipc:ipc_single",
919    "napi:ace_napi",
920    "samgr:samgr_proxy",
921    "window_manager:libdm",
922  ]
923
924  if (window_manager_use_sceneboard) {
925    external_deps += [ "window_manager:libwm_lite" ]
926  } else {
927    external_deps += [ "window_manager:libwm" ]
928  }
929
930  if (build_selinux) {
931    external_deps += [ "selinux_adapter:librestorecon" ]
932    cflags = [ "-DWITH_SELINUX" ]
933  }
934}
935
936ohos_unittest("ImeProxyTest") {
937  branch_protector_ret = "pac_ret"
938  sanitize = {
939    cfi = true
940    cfi_cross_dso = true
941    debug = false
942  }
943  module_out_path = module_output_path
944
945  sources = [
946    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_info.cpp",
947    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_service_impl.cpp",
948    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_service_impl.cpp",
949    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_tools.cpp",
950    "${inputmethod_path}/test/common/src/keyboard_listener_test_impl.cpp",
951    "src/ime_proxy_test.cpp",
952  ]
953
954  configs = [ ":module_private_config" ]
955
956  deps = [
957    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_control_channel_proxy",
958    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_method_core_stub",
959    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
960    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_client_stub",
961    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_method_agent_proxy",
962    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
963    "${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
964    "${inputmethod_path}/services:inputmethod_service_static",
965    "${inputmethod_path}/services/json:imf_json_static",
966    "${inputmethod_path}/test/common:inputmethod_test_common",
967    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
968    "${inputmethod_path}/test/unittest/resource/bundle_dependencies/editorBox:editorBox",
969    "${inputmethod_path}/test/unittest/resource/bundle_dependencies/extImfBundle:extImf",
970    "${inputmethod_path}/test/unittest/resource/ohos_test:copy_ohos_test",
971  ]
972
973  external_deps = [
974    "ability_base:want",
975    "ability_runtime:ability_context_native",
976    "ability_runtime:ability_manager",
977    "ability_runtime:runtime",
978    "access_token:libaccesstoken_sdk",
979    "bundle_framework:appexecfwk_core",
980    "c_utils:utils",
981    "cJSON:cjson",
982    "data_share:datashare_common",
983    "data_share:datashare_consumer",
984    "googletest:gtest_main",
985    "graphic_2d:librender_service_client",
986    "graphic_2d:window_animation",
987    "hilog:libhilog",
988    "input:libmmi-client",
989    "ipc:ipc_single",
990    "napi:ace_napi",
991    "safwk:system_ability_fwk",
992    "window_manager:libdm",
993  ]
994
995  if (window_manager_use_sceneboard) {
996    external_deps += [ "window_manager:libwm_lite" ]
997  } else {
998    external_deps += [ "window_manager:libwm" ]
999  }
1000  if (build_selinux) {
1001    external_deps += [ "selinux_adapter:librestorecon" ]
1002    cflags = [ "-DWITH_SELINUX" ]
1003  }
1004}
1005
1006ohos_unittest("TaskManagerTest") {
1007  branch_protector_ret = "pac_ret"
1008  sanitize = {
1009    cfi = true
1010    cfi_cross_dso = true
1011    debug = false
1012  }
1013  module_out_path = module_output_path
1014
1015  sources = [
1016    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/task_manager.cpp",
1017    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/tasks/task.cpp",
1018    "src/task_manager_test.cpp",
1019  ]
1020
1021  configs = [ ":module_private_config" ]
1022
1023  deps = [
1024    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
1025    "${inputmethod_path}/test/common:inputmethod_test_common",
1026    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
1027  ]
1028
1029  external_deps = [
1030    "bundle_framework:appexecfwk_core",
1031    "c_utils:utils",
1032    "eventhandler:libeventhandler",
1033    "googletest:gtest_main",
1034    "hilog:libhilog",
1035  ]
1036}
1037
1038ohos_unittest("ImeFreezeManagerTest") {
1039  branch_protector_ret = "pac_ret"
1040  sanitize = {
1041    cfi = true
1042    cfi_cross_dso = true
1043    debug = false
1044  }
1045  module_out_path = module_output_path
1046
1047  sources = [
1048    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_info.cpp",
1049    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_utils.cpp",
1050    "${inputmethod_path}/services/src/input_control_channel_service_impl.cpp",
1051    "src/ime_freeze_manager_test.cpp",
1052    "src/ime_lifecycle_manager_test.cpp",
1053    "src/ime_state_manager_factory_test.cpp",
1054  ]
1055
1056  configs = [ ":module_private_config" ]
1057
1058  deps = [
1059    "${inputmethod_path}/services:inputmethod_service_static",
1060    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
1061  ]
1062
1063  external_deps = [
1064    "ability_runtime:ability_manager",
1065    "access_token:libaccesstoken_sdk",
1066    "bundle_framework:appexecfwk_base",
1067    "bundle_framework:appexecfwk_core",
1068    "cJSON:cjson",
1069    "c_utils:utils",
1070    "data_share:datashare_common",
1071    "data_share:datashare_consumer",
1072    "eventhandler:libeventhandler",
1073    "googletest:gtest_main",
1074    "hilog:libhilog",
1075    "input:libmmi-client",
1076    "ipc:ipc_core",
1077    "ipc:ipc_single",
1078    "napi:ace_napi",
1079    "os_account:os_account_innerkits",
1080    "safwk:system_ability_fwk",
1081  ]
1082
1083  if (window_manager_use_sceneboard) {
1084    external_deps += [ "window_manager:libwm_lite" ]
1085  } else {
1086    external_deps += [ "window_manager:libwm" ]
1087  }
1088}
1089
1090ohos_unittest("JsonOperateTest") {
1091  branch_protector_ret = "pac_ret"
1092  sanitize = {
1093    cfi = true
1094    cfi_cross_dso = true
1095    debug = false
1096  }
1097  module_out_path = module_output_path
1098
1099  sources = [ "src/json_operate_test.cpp" ]
1100
1101  deps = [
1102    "${inputmethod_path}/services:inputmethod_service_static",
1103    "${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
1104    "${inputmethod_path}/services/json:imf_json_static",
1105  ]
1106
1107  external_deps = [
1108    "bundle_framework:appexecfwk_base",
1109    "bundle_framework:appexecfwk_core",
1110    "cJSON:cjson",
1111    "data_share:datashare_common",
1112    "data_share:datashare_consumer",
1113    "googletest:gtest_main",
1114    "hilog:libhilog",
1115    "input:libmmi-client",
1116    "ipc:ipc_single",
1117    "resource_management:global_resmgr",
1118  ]
1119}
1120
1121ohos_unittest("VirtualListenerTest") {
1122  branch_protector_ret = "pac_ret"
1123  sanitize = {
1124    cfi = true
1125    cfi_cross_dso = true
1126    debug = false
1127  }
1128  module_out_path = module_output_path
1129
1130  sources = [ "src/virtual_listener_test.cpp" ]
1131
1132  configs = [ ":module_private_config" ]
1133
1134  deps = [
1135    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
1136    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
1137    "${inputmethod_path}/services:inputmethod_service",
1138    "${inputmethod_path}/test/common:inputmethod_test_common",
1139  ]
1140
1141  external_deps = [
1142    "ability_base:want",
1143    "ability_runtime:ability_context_native",
1144    "ability_runtime:ability_manager",
1145    "access_token:libaccesstoken_sdk",
1146    "bundle_framework:appexecfwk_core",
1147    "c_utils:utils",
1148    "eventhandler:libeventhandler",
1149    "googletest:gmock",
1150    "googletest:gtest_main",
1151    "hilog:libhilog",
1152    "input:libmmi-client",
1153    "ipc:ipc_single",
1154    "napi:ace_napi",
1155    "safwk:system_ability_fwk",
1156    "samgr:samgr_proxy",
1157  ]
1158
1159  if (window_manager_use_sceneboard) {
1160    external_deps += [ "window_manager:libwm_lite" ]
1161  } else {
1162    external_deps += [ "window_manager:libwm" ]
1163  }
1164}
1165
1166ohos_unittest("ImeSystemChannelTest") {
1167  branch_protector_ret = "pac_ret"
1168  sanitize = {
1169    cfi = true
1170    cfi_cross_dso = true
1171    debug = false
1172    blocklist = "./inputmethod_blocklist.txt"
1173  }
1174  module_out_path = module_output_path
1175
1176  sources = [
1177    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/system_cmd_channel_service_impl.cpp",
1178    "src/ime_system_channel_test.cpp",
1179  ]
1180
1181  configs = [ ":module_private_config" ]
1182
1183  deps = [
1184    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
1185    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_method_agent_proxy",
1186    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
1187    "${inputmethod_path}/services:inputmethod_service",
1188    "${inputmethod_path}/test/common:inputmethod_test_common",
1189    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
1190  ]
1191
1192  external_deps = [
1193    "ability_base:want",
1194    "ability_runtime:ability_context_native",
1195    "ability_runtime:ability_manager",
1196    "access_token:libaccesstoken_sdk",
1197    "bundle_framework:appexecfwk_core",
1198    "c_utils:utils",
1199    "eventhandler:libeventhandler",
1200    "googletest:gtest_main",
1201    "hilog:libhilog",
1202    "input:libmmi-client",
1203    "ipc:ipc_single",
1204    "napi:ace_napi",
1205    "safwk:system_ability_fwk",
1206    "samgr:samgr_proxy",
1207  ]
1208
1209  if (window_manager_use_sceneboard) {
1210    external_deps += [ "window_manager:libwm_lite" ]
1211  } else {
1212    external_deps += [ "window_manager:libwm" ]
1213  }
1214}
1215
1216if (defined(build_seccomp) && build_seccomp) {
1217  ohos_unittest("InputMethodSeccompTest") {
1218    module_out_path = module_output_path
1219    sanitize = {
1220      cfi = true
1221      cfi_cross_dso = true
1222      debug = false
1223      blocklist = "./inputmethod_blocklist.txt"
1224    }
1225    sources = [ "src/input_method_ext_seccomp_test.cpp" ]
1226    external_deps = [ "init:seccomp" ]
1227  }
1228} else {
1229  group("InputMethodSeccompTest") {
1230  }
1231}
1232
1233ohos_unittest("ImeControllerCpaiTest") {
1234  sanitize = {
1235    cfi = true
1236    cfi_cross_dso = true
1237    debug = false
1238    blocklist = "./inputmethod_blocklist.txt"
1239  }
1240  module_out_path = module_output_path
1241
1242  sources = [
1243    "src/inputmethod_controller_capi_test.cpp",
1244    "src/native_text_changed_listener_test.cpp",
1245  ]
1246
1247  configs = [ "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_native_public_config" ]
1248
1249  include_dirs = [
1250    "${inputmethod_path}/interfaces/kits/c",
1251    "${inputmethod_path}/frameworks/ndk/include",
1252    "${inputmethod_path}/test/unittest/cpp_test/mock",
1253  ]
1254
1255  defines = [
1256    "OHOS_IMF_TEST"
1257  ]
1258
1259  deps = [
1260    "${inputmethod_path}/frameworks/ndk:ohinputmethod_static",
1261    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
1262  ]
1263
1264  external_deps = [
1265    "googletest:gtest_main",
1266    "googletest:gmock",
1267    "hilog:libhilog",
1268    "input:libmmi-client",
1269  ]
1270}
1271
1272ohos_unittest("FullImeInfoManagerTest") {
1273  sanitize = {
1274    cfi = true
1275    cfi_cross_dso = true
1276    debug = false
1277    blocklist = "./inputmethod_blocklist.txt"
1278  }
1279  module_out_path = module_output_path
1280
1281  sources = [
1282    "${inputmethod_path}/services/src/full_ime_info_manager.cpp",
1283    "mock/ime_enabled_info_manager.cpp",
1284    "mock/ime_info_inquirer.cpp",
1285    "mock/os_account_adapter.cpp",
1286    "src/full_ime_info_manager_test.cpp",
1287  ]
1288  include_dirs = [
1289    "${inputmethod_path}/common/include",
1290    "${inputmethod_path}/frameworks/native/inputmethod_controller/include",
1291    "${inputmethod_path}/test/unittest/cpp_test/mock",
1292  ]
1293
1294  deps = [ "${inputmethod_path}/common:inputmethod_common" ]
1295
1296  external_deps = [
1297    "c_utils:utils",
1298    "eventhandler:libeventhandler",
1299    "googletest:gtest_main",
1300    "hilog:libhilog",
1301    "input:libmmi-client",
1302    "ipc:ipc_single",
1303  ]
1304}
1305
1306ohos_unittest("InputMethodMessageHandlerTest") {
1307  branch_protector_ret = "pac_ret"
1308  sanitize = {
1309    cfi = true
1310    cfi_cross_dso = true
1311    debug = false
1312    blocklist = "./inputmethod_blocklist.txt"
1313  }
1314  module_out_path = module_output_path
1315
1316  sources = [
1317    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_agent_service_impl.cpp",
1318    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_service_impl.cpp",
1319    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_info.cpp",
1320    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_service_impl.cpp",
1321    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_service_impl.cpp",
1322    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_tools.cpp",
1323    "${inputmethod_path}/services/src/input_control_channel_service_impl.cpp",
1324    "${inputmethod_path}/services/src/input_type_manager.cpp",
1325    "src/input_method_message_handler_test.cpp",
1326  ]
1327
1328  configs = [
1329    ":module_private_config",
1330    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_native_public_config",
1331  ]
1332
1333  deps = [
1334    "${inputmethod_path}/frameworks/ndk:ohinputmethod_static",
1335    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_control_channel_proxy",
1336    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_method_core_proxy",
1337    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_method_core_stub",
1338    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
1339    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_method_agent_proxy",
1340    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
1341    "${inputmethod_path}/services:inputmethod_service_static",
1342    "${inputmethod_path}/test/common:inputmethod_test_common",
1343    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
1344  ]
1345
1346  external_deps = [
1347    "ability_base:want",
1348    "ability_runtime:ability_context_native",
1349    "ability_runtime:ability_manager",
1350    "ability_runtime:runtime",
1351    "access_token:libaccesstoken_sdk",
1352    "bundle_framework:appexecfwk_core",
1353    "cJSON:cjson",
1354    "c_utils:utils",
1355    "config_policy:configpolicy_util",
1356    "data_share:datashare_common",
1357    "data_share:datashare_consumer",
1358    "eventhandler:libeventhandler",
1359    "googletest:gtest_main",
1360    "graphic_2d:librender_service_base",
1361    "hilog:libhilog",
1362    "input:libmmi-client",
1363    "ipc:ipc_single",
1364    "napi:ace_napi",
1365    "safwk:system_ability_fwk",
1366    "samgr:samgr_proxy",
1367    "window_manager:libdm",
1368  ]
1369
1370  if (window_manager_use_sceneboard) {
1371    external_deps += [ "window_manager:libwm_lite" ]
1372  } else {
1373    external_deps += [ "window_manager:libwm" ]
1374  }
1375}
1376
1377ohos_unittest("OnDemandStartStopSaTest") {
1378  sanitize = {
1379    cfi = true
1380    cfi_cross_dso = true
1381    debug = false
1382    blocklist = "./inputmethod_blocklist.txt"
1383  }
1384  module_out_path = module_output_path
1385
1386  sources = [
1387    "${inputmethod_path}/common/src/on_demand_start_stop_sa.cpp",
1388    "src/on_demand_start_stop_sa_test.cpp",
1389  ]
1390  include_dirs = [
1391    "${inputmethod_path}/common/include",
1392    "mock/",
1393  ]
1394
1395  external_deps = [
1396    "c_utils:utils",
1397    "googletest:gtest_main",
1398    "hilog:libhilog",
1399    "ipc:ipc_single",
1400    "samgr:samgr_proxy",
1401  ]
1402}
1403
1404ohos_unittest("ImfHisysEventReporterTest") {
1405  branch_protector_ret = "pac_ret"
1406  sanitize = {
1407    cfi = true
1408    cfi_cross_dso = true
1409    debug = false
1410  }
1411  module_out_path = module_output_path
1412  include_dirs = [ "${inputmethod_path}/common/include" ]
1413  sources = [ "src/imf_hisysevent_report_test.cpp" ]
1414
1415  configs = [
1416    ":module_private_config",
1417    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_native_public_config",
1418    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_native_public_config",
1419  ]
1420
1421  deps = [
1422    "${inputmethod_path}/common/imf_hisysevent:imf_hisysevent",
1423    "${inputmethod_path}/services/json:imf_json_static",
1424    "${inputmethod_path}/test/unittest/resource/ohos_test:copy_ohos_test",
1425  ]
1426
1427  external_deps = [
1428    "c_utils:utils",
1429    "googletest:gtest_main",
1430    "hilog:libhilog",
1431    "hisysevent:libhisysevent",
1432    "hisysevent:libhisyseventmanager",
1433    "input:libmmi-client",
1434    "ipc:ipc_core",
1435  ]
1436}
1437
1438ohos_unittest("WindowAdapterTest") {
1439  branch_protector_ret = "pac_ret"
1440  sanitize = {
1441    cfi = true
1442    cfi_cross_dso = true
1443    debug = false
1444  }
1445  module_out_path = module_output_path
1446
1447  include_dirs = [
1448    "${inputmethod_path}/common/include",
1449    "${inputmethod_path}/services/adapter/window_adapter/include",
1450  ]
1451  sources = [
1452    "${inputmethod_path}/services/adapter/window_adapter/src/window_adapter.cpp",
1453    "${inputmethod_path}/services/adapter/window_adapter/src/window_display_changed_listener.cpp",
1454    "src/window_adapter_test.cpp",
1455  ]
1456  configs = [ ":module_private_config" ]
1457  external_deps = [
1458    "c_utils:utils",
1459    "googletest:gtest_main",
1460    "hilog:libhilog",
1461    "ipc:ipc_single",
1462  ]
1463  defines = []
1464  if (window_manager_use_sceneboard) {
1465    external_deps += [ "window_manager:libwm_lite" ]
1466    defines += [ "SCENE_BOARD_ENABLE" ]
1467  } else {
1468    external_deps += [ "window_manager:libwm" ]
1469  }
1470}
1471
1472ohos_unittest("ImaTextEditTest") {
1473  branch_protector_ret = "pac_ret"
1474  sanitize = {
1475    cfi = true
1476    cfi_cross_dso = true
1477    debug = false
1478  }
1479  module_out_path = module_output_path
1480
1481  sources = [
1482    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_info.cpp",
1483    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_service_impl.cpp",
1484    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_service_impl.cpp",
1485    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_tools.cpp",
1486    "${inputmethod_path}/test/common/src/keyboard_listener_test_impl.cpp",
1487    "src/ima_text_edit_test.cpp",
1488  ]
1489
1490  configs = [ ":module_private_config" ]
1491
1492  deps = [
1493    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_control_channel_proxy",
1494    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_method_core_stub",
1495    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
1496    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_client_stub",
1497    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_method_agent_proxy",
1498    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
1499    "${inputmethod_path}/services:inputmethod_service",
1500    "${inputmethod_path}/test/common:inputmethod_test_common",
1501    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
1502    "${inputmethod_path}/test/unittest/resource/bundle_dependencies/editorBox:editorBox",
1503    "${inputmethod_path}/test/unittest/resource/ohos_test:copy_ohos_test",
1504  ]
1505
1506  external_deps = [
1507    "ability_base:want",
1508    "ability_runtime:ability_context_native",
1509    "ability_runtime:ability_manager",
1510    "ability_runtime:runtime",
1511    "access_token:libaccesstoken_sdk",
1512    "bundle_framework:appexecfwk_core",
1513    "c_utils:utils",
1514    "googletest:gtest_main",
1515    "graphic_2d:librender_service_client",
1516    "graphic_2d:window_animation",
1517    "hilog:libhilog",
1518    "input:libmmi-client",
1519    "ipc:ipc_single",
1520    "napi:ace_napi",
1521    "safwk:system_ability_fwk",
1522    "window_manager:libdm",
1523  ]
1524
1525  if (window_manager_use_sceneboard) {
1526    external_deps += [ "window_manager:libwm_lite" ]
1527  } else {
1528    external_deps += [ "window_manager:libwm" ]
1529  }
1530  if (build_selinux) {
1531    external_deps += [ "selinux_adapter:librestorecon" ]
1532    cflags = [ "-DWITH_SELINUX" ]
1533  }
1534}
1535
1536ohos_unittest("StringUtilsTest") {
1537  branch_protector_ret = "pac_ret"
1538  sanitize = {
1539    cfi = true
1540    cfi_cross_dso = true
1541    debug = false
1542  }
1543  module_out_path = module_output_path
1544
1545  include_dirs = [ "${inputmethod_path}/common/include" ]
1546
1547  sources = [ "src/string_utils_test.cpp" ]
1548
1549  configs = [ ":module_private_config" ]
1550
1551  deps = [ "${inputmethod_path}/common:inputmethod_common" ]
1552
1553  external_deps = [
1554    "c_utils:utils",
1555    "googletest:gtest_main",
1556    "hilog:libhilog",
1557  ]
1558}
1559
1560ohos_unittest("InputMethodManagerCommandTest") {
1561  branch_protector_ret = "pac_ret"
1562  sanitize = {
1563    cfi = true
1564    cfi_cross_dso = true
1565    debug = false
1566  }
1567  module_out_path = module_output_path
1568
1569  sources = [
1570    "${inputmethod_path}/tools/ime/src/input_method_manager_command.cpp",
1571    "src/input_method_manager_command_test.cpp",
1572  ]
1573
1574  include_dirs = [
1575    "include",
1576    "${inputmethod_path}/tools/ime/include",
1577    "${inputmethod_path}/common/include",
1578    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller/include",
1579  ]
1580
1581  deps = [
1582    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client",
1583    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
1584    "${inputmethod_path}/test/unittest/resource/bundle_dependencies/newTestIme:newTestIme",
1585    "${inputmethod_path}/test/unittest/resource/ohos_test:copy_ohos_test",
1586  ]
1587
1588  external_deps = [
1589    "bundle_framework:appexecfwk_core",
1590    "c_utils:utils",
1591    "hilog:libhilog",
1592    "input:libmmi-client",
1593  ]
1594
1595  if (window_manager_use_sceneboard) {
1596    external_deps += [ "window_manager:libwm_lite" ]
1597  } else {
1598    external_deps += [ "window_manager:libwm" ]
1599  }
1600}
1601
1602ohos_unittest("ImeEnabledInfoManagerTest") {
1603  branch_protector_ret = "pac_ret"
1604  sanitize = {
1605    cfi = true
1606    cfi_cross_dso = true
1607    debug = false
1608  }
1609  module_out_path = module_output_path
1610  include_dirs = [ "${inputmethod_path}/common/include" ]
1611  sources = [ "src/ime_enabled_info_manager_test.cpp" ]
1612
1613  configs = [ ":module_private_config" ]
1614  deps = [
1615    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
1616    "${inputmethod_path}/services:inputmethod_service_static",
1617    "${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
1618    "${inputmethod_path}/services/file:imf_file_static",
1619    "${inputmethod_path}/services/json:imf_json_static",
1620    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
1621    "${inputmethod_path}/test/unittest/resource/bundle_dependencies/newTestIme:newTestIme",
1622    "${inputmethod_path}/test/unittest/resource/ohos_test:copy_ohos_test",
1623  ]
1624
1625  external_deps = [
1626    "ability_base:want",
1627    "bundle_framework:appexecfwk_core",
1628    "c_utils:utils",
1629    "config_policy:configpolicy_util",
1630    "data_share:datashare_common",
1631    "data_share:datashare_consumer",
1632    "googletest:gtest_main",
1633    "hilog:libhilog",
1634    "init:libbeget_proxy",
1635    "init:libbegetutil",
1636    "input:libmmi-client",
1637    "resource_management:global_resmgr",
1638  ]
1639  if (window_manager_use_sceneboard) {
1640    external_deps += [ "window_manager:libwm_lite" ]
1641  } else {
1642    external_deps += [ "window_manager:libwm" ]
1643  }
1644}
1645
1646ohos_unittest("ImeMirrorTest") {
1647  branch_protector_ret = "pac_ret"
1648  sanitize = {
1649    cfi = true
1650    cfi_cross_dso = true
1651    debug = false
1652  }
1653  module_out_path = module_output_path
1654
1655  sources = [
1656    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_info.cpp",
1657    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_client_service_impl.cpp",
1658    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_data_channel_service_impl.cpp",
1659    "${inputmethod_path}/frameworks/native/inputmethod_controller/src/input_method_tools.cpp",
1660    "${inputmethod_path}/services/src/sys_cfg_parser.cpp",
1661    "${inputmethod_path}/test/common/src/keyboard_listener_test_impl.cpp",
1662    "src/ime_mirror_test.cpp",
1663  ]
1664
1665  configs = [ ":module_private_config" ]
1666
1667  deps = [
1668    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_control_channel_proxy",
1669    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:input_method_core_stub",
1670    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
1671    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_client_stub",
1672    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:input_method_agent_proxy",
1673    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
1674    "${inputmethod_path}/services:inputmethod_service",
1675    "${inputmethod_path}/services/file:imf_file_static",
1676    "${inputmethod_path}/services/json:imf_json_static",
1677    "${inputmethod_path}/test/common:inputmethod_test_common",
1678    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
1679    "${inputmethod_path}/test/unittest/resource/bundle_dependencies/editorBox:editorBox",
1680    "${inputmethod_path}/test/unittest/resource/bundle_dependencies/extImfBundle:extImf",
1681    "${inputmethod_path}/test/unittest/resource/ohos_test:copy_ohos_test",
1682  ]
1683
1684  external_deps = [
1685    "ability_base:want",
1686    "ability_runtime:ability_context_native",
1687    "ability_runtime:ability_manager",
1688    "access_token:libaccesstoken_sdk",
1689    "bundle_framework:appexecfwk_core",
1690    "c_utils:utils",
1691    "config_policy:configpolicy_util",
1692    "googletest:gtest_main",
1693    "graphic_2d:librender_service_client",
1694    "graphic_2d:window_animation",
1695    "hilog:libhilog",
1696    "input:libmmi-client",
1697    "ipc:ipc_single",
1698    "napi:ace_napi",
1699    "samgr:samgr_proxy",
1700    "window_manager:libdm",
1701  ]
1702
1703  if (window_manager_use_sceneboard) {
1704    external_deps += [ "window_manager:libwm_lite" ]
1705  } else {
1706    external_deps += [ "window_manager:libwm" ]
1707  }
1708
1709  if (build_selinux) {
1710    external_deps += [ "selinux_adapter:librestorecon" ]
1711    cflags = [ "-DWITH_SELINUX" ]
1712  }
1713}
1714
1715ohos_executable("ImeMirrorDemo") {
1716  branch_protector_ret = "pac_ret"
1717  sanitize = {
1718    cfi = true
1719    cfi_cross_dso = true
1720    debug = false
1721  }
1722
1723  sources = [
1724    "${inputmethod_path}/services/src/sys_cfg_parser.cpp",
1725    "src/ime_mirror_demo.cpp",
1726  ]
1727  include_dirs =
1728      [ "${inputmethod_path}/interfaces/inner_api/inputmethod_ability/include" ]
1729
1730  deps = [
1731    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
1732    "${inputmethod_path}/services/file:imf_file_static",
1733    "${inputmethod_path}/services/json:imf_json_static",
1734  ]
1735
1736  configs = [ ":module_private_config" ]
1737
1738  external_deps = [
1739    "c_utils:utils",
1740    "config_policy:configpolicy_util",
1741    "hilog:libhilog",
1742    "input:libmmi-client",
1743    "ipc:ipc_single",
1744  ]
1745
1746  install_enable = false
1747  subsystem_name = "inputmethod"
1748  part_name = "imf"
1749}
1750