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}/services/include",
22    "${inputmethod_path}/test/common",
23    "${inputmethod_path}/services/adapter/settings_data_provider/common/include",
24  ]
25}
26
27module_output_path = "imf/cpp"
28
29ohos_unittest("InputMethodControllerTest") {
30  branch_protector_ret = "pac_ret"
31  sanitize = {
32    cfi = true
33    cfi_cross_dso = true
34    debug = false
35    blocklist = "./inputmethod_blocklist.txt"
36  }
37  module_out_path = module_output_path
38
39  sources = [
40    "${inputmethod_path}/services/src/input_type_manager.cpp",
41    "src/ime_event_monitor_manager_test.cpp",
42    "src/input_method_controller_test.cpp",
43  ]
44
45  configs = [ ":module_private_config" ]
46
47  deps = [
48    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
49    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
50    "${inputmethod_path}/services:inputmethod_service_static",
51    "${inputmethod_path}/test/common:inputmethod_test_common",
52    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
53    "//third_party/googletest:gtest_main",
54  ]
55
56  external_deps = [
57    "ability_base:want",
58    "ability_runtime:ability_context_native",
59    "ability_runtime:ability_manager",
60    "access_token:libaccesstoken_sdk",
61    "bundle_framework:appexecfwk_core",
62    "c_utils:utils",
63    "config_policy:configpolicy_util",
64    "data_share:datashare_common",
65    "data_share:datashare_consumer",
66    "eventhandler:libeventhandler",
67    "hilog:libhilog",
68    "input:libmmi-client",
69    "ipc:ipc_single",
70    "napi:ace_napi",
71    "safwk:system_ability_fwk",
72    "samgr:samgr_proxy",
73    "window_manager:libdm",
74  ]
75
76  if (window_manager_use_sceneboard) {
77    external_deps += [ "window_manager:libwm_lite" ]
78  } else {
79    external_deps += [ "window_manager:libwm" ]
80  }
81}
82
83ohos_unittest("InputMethodAttachTest") {
84  branch_protector_ret = "pac_ret"
85  sanitize = {
86    cfi = true
87    cfi_cross_dso = true
88    debug = false
89  }
90  module_out_path = module_output_path
91
92  sources = [ "src/input_method_attach_test.cpp" ]
93
94  configs = [ ":module_private_config" ]
95
96  deps = [
97    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
98    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
99    "${inputmethod_path}/services:inputmethod_service_static",
100    "${inputmethod_path}/services/json:imf_json_static",
101    "${inputmethod_path}/test/common:inputmethod_test_common",
102    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
103    "//third_party/googletest:gmock",
104    "//third_party/googletest:gtest_main",
105  ]
106
107  external_deps = [
108    "ability_base:want",
109    "ability_runtime:ability_context_native",
110    "ability_runtime:ability_manager",
111    "access_token:libaccesstoken_sdk",
112    "bundle_framework:appexecfwk_core",
113    "c_utils:utils",
114    "data_share:datashare_common",
115    "data_share:datashare_consumer",
116    "hilog:libhilog",
117    "input:libmmi-client",
118    "napi:ace_napi",
119    "window_manager:libdm",
120  ]
121
122  if (window_manager_use_sceneboard) {
123    external_deps += [ "window_manager:libwm_lite" ]
124  } else {
125    external_deps += [ "window_manager:libwm" ]
126  }
127}
128ohos_unittest("InputMethodAbilityTest") {
129  branch_protector_ret = "pac_ret"
130  sanitize = {
131    cfi = true
132    cfi_cross_dso = true
133    debug = false
134  }
135  module_out_path = module_output_path
136
137  sources = [
138    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_agent_stub.cpp",
139    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_proxy.cpp",
140    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_stub.cpp",
141    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/task_manager.cpp",
142    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/tasks/task.cpp",
143    "${inputmethod_path}/services/src/input_control_channel_proxy.cpp",
144    "src/input_method_ability_exception_test.cpp",
145    "src/input_method_ability_test.cpp",
146  ]
147
148  configs = [ ":module_private_config" ]
149
150  deps = [
151    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
152    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
153    "${inputmethod_path}/services:inputmethod_service_static",
154    "${inputmethod_path}/services/json:imf_json_static",
155    "${inputmethod_path}/test/common:inputmethod_test_common",
156    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
157    "//third_party/googletest:gtest_main",
158  ]
159
160  external_deps = [
161    "ability_base:want",
162    "ability_runtime:ability_context_native",
163    "ability_runtime:ability_manager",
164    "access_token:libaccesstoken_sdk",
165    "bundle_framework:appexecfwk_core",
166    "c_utils:utils",
167    "data_share:datashare_common",
168    "data_share:datashare_consumer",
169    "graphic_2d:librender_service_client",
170    "graphic_2d:window_animation",
171    "hilog:libhilog",
172    "input:libmmi-client",
173    "ipc:ipc_single",
174    "memmgr:memmgrclient",
175    "napi:ace_napi",
176    "os_account:os_account_innerkits",
177    "window_manager:libdm",
178    "window_manager:libwsutils",
179  ]
180
181  if (window_manager_use_sceneboard) {
182    external_deps += [ "window_manager:libwm_lite" ]
183  } else {
184    external_deps += [ "window_manager:libwm" ]
185  }
186}
187
188ohos_unittest("InputMethodServiceTest") {
189  branch_protector_ret = "pac_ret"
190  sanitize = {
191    cfi = true
192    cfi_cross_dso = true
193    debug = false
194  }
195  module_out_path = module_output_path
196
197  sources = [ "src/input_method_service_test.cpp" ]
198
199  configs = [ ":module_private_config" ]
200
201  deps = [
202    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
203    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
204    "${inputmethod_path}/services:inputmethod_service",
205    "${inputmethod_path}/test/common:inputmethod_test_common",
206    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
207    "//third_party/cJSON:cjson",
208    "//third_party/googletest:gtest_main",
209  ]
210
211  external_deps = [
212    "ability_base:want",
213    "ability_runtime:ability_context_native",
214    "ability_runtime:ability_manager",
215    "access_token:libaccesstoken_sdk",
216    "c_utils:utils",
217    "hilog:libhilog",
218    "input:libmmi-client",
219    "ipc:ipc_single",
220    "napi:ace_napi",
221    "window_manager:libdm",
222  ]
223
224  if (window_manager_use_sceneboard) {
225    external_deps += [ "window_manager:libwm_lite" ]
226  } else {
227    external_deps += [ "window_manager:libwm" ]
228  }
229}
230
231ohos_unittest("InputMethodDfxTest") {
232  branch_protector_ret = "pac_ret"
233  sanitize = {
234    cfi = true
235    cfi_cross_dso = true
236    debug = false
237  }
238  module_out_path = module_output_path
239
240  sources = [ "src/input_method_dfx_test.cpp" ]
241
242  configs = [ ":module_private_config" ]
243
244  deps = [
245    "${inputmethod_path}/common:inputmethod_common",
246    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
247    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
248    "${inputmethod_path}/services:inputmethod_service_static",
249    "${inputmethod_path}/test/common:inputmethod_test_common",
250    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
251    "//third_party/googletest:gtest_main",
252  ]
253
254  external_deps = [
255    "ability_base:want",
256    "ability_runtime:ability_context_native",
257    "ability_runtime:ability_manager",
258    "access_token:libaccesstoken_sdk",
259    "bundle_framework:appexecfwk_core",
260    "c_utils:utils",
261    "data_share:datashare_common",
262    "data_share:datashare_consumer",
263    "eventhandler:libeventhandler",
264    "hilog:libhilog",
265    "hisysevent:libhisysevent",
266    "hisysevent:libhisyseventmanager",
267    "input:libmmi-client",
268    "ipc:ipc_single",
269    "napi:ace_napi",
270    "window_manager:libdm",
271  ]
272
273  if (window_manager_use_sceneboard) {
274    external_deps += [ "window_manager:libwm_lite" ]
275  } else {
276    external_deps += [ "window_manager:libwm" ]
277  }
278}
279
280ohos_unittest("InputMethodPanelTest") {
281  branch_protector_ret = "pac_ret"
282  sanitize = {
283    cfi = true
284    cfi_cross_dso = true
285    debug = false
286  }
287  module_out_path = module_output_path
288
289  sources = [ "src/input_method_panel_test.cpp" ]
290
291  configs = [ ":module_private_config" ]
292
293  deps = [
294    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
295    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
296    "${inputmethod_path}/services:inputmethod_service_static",
297    "${inputmethod_path}/test/common:inputmethod_test_common",
298    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
299    "//third_party/googletest:gtest_main",
300  ]
301
302  external_deps = [
303    "ability_base:want",
304    "ability_runtime:ability_context_native",
305    "ability_runtime:ability_manager",
306    "access_token:libaccesstoken_sdk",
307    "bundle_framework:appexecfwk_core",
308    "c_utils:utils",
309    "common_event_service:cesfwk_innerkits",
310    "data_share:datashare_common",
311    "data_share:datashare_consumer",
312    "eventhandler:libeventhandler",
313    "graphic_2d:librender_service_client",
314    "graphic_2d:window_animation",
315    "hilog:libhilog",
316    "input:libmmi-client",
317    "napi:ace_napi",
318    "os_account:os_account_innerkits",
319    "window_manager:libdm",
320    "window_manager:libwsutils",
321  ]
322
323  if (window_manager_use_sceneboard) {
324    external_deps += [ "window_manager:libwm_lite" ]
325  } else {
326    external_deps += [ "window_manager:libwm" ]
327  }
328}
329
330ohos_unittest("InputMethodSwitchTest") {
331  branch_protector_ret = "pac_ret"
332  sanitize = {
333    cfi = true
334    cfi_cross_dso = true
335    debug = false
336  }
337  module_out_path = module_output_path
338
339  sources = [ "src/input_method_switch_test.cpp" ]
340
341  configs = [ ":module_private_config" ]
342
343  deps = [
344    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
345    "${inputmethod_path}/services:inputmethod_service",
346    "${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
347    "${inputmethod_path}/test/common:inputmethod_test_common",
348    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
349    "//third_party/cJSON:cjson",
350    "//third_party/googletest:gtest_main",
351  ]
352
353  external_deps = [
354    "access_token:libaccesstoken_sdk",
355    "bundle_framework:appexecfwk_core",
356    "c_utils:utils",
357    "data_share:datashare_common",
358    "data_share:datashare_consumer",
359    "hilog:libhilog",
360    "input:libmmi-client",
361  ]
362
363  if (window_manager_use_sceneboard) {
364    external_deps += [ "window_manager:libwm_lite" ]
365  } else {
366    external_deps += [ "window_manager:libwm" ]
367  }
368}
369
370ohos_unittest("ITypesUtilTest") {
371  branch_protector_ret = "pac_ret"
372  sanitize = {
373    cfi = true
374    cfi_cross_dso = true
375    debug = false
376  }
377  module_out_path = module_output_path
378
379  sources = [
380    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_agent_stub.cpp",
381    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/task_manager.cpp",
382    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/tasks/task.cpp",
383    "${inputmethod_path}/services/src/input_control_channel_proxy.cpp",
384    "src/input_method_ability_exception_test.cpp",
385    "src/itypes_util_test.cpp",
386  ]
387
388  configs = [ ":module_private_config" ]
389
390  deps = [
391    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
392    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
393    "${inputmethod_path}/test/common:inputmethod_test_common",
394    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
395    "//third_party/googletest:gtest_main",
396  ]
397
398  external_deps = [
399    "ability_base:want",
400    "ability_runtime:ability_context_native",
401    "ability_runtime:ability_manager",
402    "c_utils:utils",
403    "hilog:libhilog",
404    "input:libmmi-client",
405    "ipc:ipc_single",
406    "napi:ace_napi",
407  ]
408}
409
410ohos_unittest("InputMethodPrivateMemberTest") {
411  branch_protector_ret = "pac_ret"
412  sanitize = {
413    cfi = true
414    cfi_cross_dso = true
415    debug = false
416  }
417  module_out_path = module_output_path
418
419  sources = [
420    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_agent_stub.cpp",
421    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_stub.cpp",
422    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/task_manager.cpp",
423    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/tasks/task.cpp",
424    "${inputmethod_path}/services/adapter/ime_connection_manager/src/ime_connection.cpp",
425    "${inputmethod_path}/services/src/input_control_channel_proxy.cpp",
426    "src/input_method_private_member_test.cpp",
427  ]
428
429  configs = [ ":module_private_config" ]
430
431  deps = [
432    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
433    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
434    "${inputmethod_path}/services:inputmethod_service_static",
435    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
436    "//third_party/googletest:gtest_main",
437  ]
438
439  external_deps = [
440    "ability_runtime:ability_manager",
441    "access_token:libaccesstoken_sdk",
442    "bundle_framework:appexecfwk_base",
443    "bundle_framework:appexecfwk_core",
444    "c_utils:utils",
445    "data_share:datashare_common",
446    "data_share:datashare_consumer",
447    "hilog:libhilog",
448    "input:libmmi-client",
449    "ipc:ipc_core",
450    "ipc:ipc_single",
451    "napi:ace_napi",
452    "os_account:os_account_innerkits",
453    "window_manager:libdm",
454  ]
455
456  if (window_manager_use_sceneboard) {
457    external_deps += [ "window_manager:libwm_lite" ]
458  } else {
459    external_deps += [ "window_manager:libwm" ]
460  }
461}
462
463ohos_unittest("InputMethodEditorTest") {
464  branch_protector_ret = "pac_ret"
465  sanitize = {
466    cfi = true
467    cfi_cross_dso = true
468    debug = false
469  }
470  module_out_path = module_output_path
471
472  sources = [ "src/input_method_editor_test.cpp" ]
473
474  configs = [ ":module_private_config" ]
475
476  deps = [
477    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
478    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
479    "${inputmethod_path}/services:inputmethod_service_static",
480    "${inputmethod_path}/services/json:imf_json_static",
481    "${inputmethod_path}/test/common:inputmethod_test_common",
482    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
483    "//third_party/googletest:gtest_main",
484  ]
485
486  external_deps = [
487    "ability_base:want",
488    "ability_runtime:ability_context_native",
489    "ability_runtime:ability_manager",
490    "access_token:libaccesstoken_sdk",
491    "bundle_framework:appexecfwk_core",
492    "c_utils:utils",
493    "data_share:datashare_common",
494    "data_share:datashare_consumer",
495    "eventhandler:libeventhandler",
496    "hilog:libhilog",
497    "input:libmmi-client",
498    "ipc:ipc_single",
499    "napi:ace_napi",
500    "window_manager:libdm",
501  ]
502
503  if (window_manager_use_sceneboard) {
504    external_deps += [ "window_manager:libwm_lite" ]
505  } else {
506    external_deps += [ "window_manager:libwm" ]
507  }
508}
509
510ohos_unittest("NewImeSwitchTest") {
511  branch_protector_ret = "pac_ret"
512  sanitize = {
513    cfi = true
514    cfi_cross_dso = true
515    debug = false
516  }
517  module_out_path = module_output_path
518
519  sources = [ "src/newIme_switch_test.cpp" ]
520
521  configs = [ ":module_private_config" ]
522
523  deps = [
524    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
525    "${inputmethod_path}/services:inputmethod_service",
526    "${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
527    "${inputmethod_path}/test/common:inputmethod_test_common",
528    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
529    "//third_party/cJSON:cjson",
530    "//third_party/googletest:gtest_main",
531  ]
532
533  external_deps = [
534    "access_token:libaccesstoken_sdk",
535    "bundle_framework:appexecfwk_core",
536    "c_utils:utils",
537    "data_share:datashare_common",
538    "data_share:datashare_consumer",
539    "hilog:libhilog",
540    "input:libmmi-client",
541  ]
542
543  if (window_manager_use_sceneboard) {
544    external_deps += [ "window_manager:libwm_lite" ]
545  } else {
546    external_deps += [ "window_manager:libwm" ]
547  }
548}
549
550ohos_unittest("IdentityCheckerTest") {
551  branch_protector_ret = "pac_ret"
552  sanitize = {
553    cfi = true
554    cfi_cross_dso = true
555    debug = false
556    blocklist = "./inputmethod_blocklist.txt"
557  }
558  module_out_path = module_output_path
559
560  sources = [
561    "${inputmethod_path}/services/adapter/ime_connection_manager/src/ime_connection.cpp",
562    "src/identity_checker_test.cpp",
563  ]
564
565  configs = [ ":module_private_config" ]
566
567  deps = [
568    "${inputmethod_path}/services:inputmethod_service_static",
569    "${inputmethod_path}/test/common:inputmethod_test_common",
570    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
571    "//third_party/googletest:gtest_main",
572  ]
573
574  external_deps = [
575    "ability_base:want",
576    "ability_runtime:ability_context_native",
577    "ability_runtime:ability_manager",
578    "access_token:libaccesstoken_sdk",
579    "bundle_framework:appexecfwk_core",
580    "c_utils:utils",
581    "data_share:datashare_common",
582    "data_share:datashare_consumer",
583    "hilog:libhilog",
584    "input:libmmi-client",
585    "ipc:ipc_single",
586    "napi:ace_napi",
587    "window_manager:libdm",
588  ]
589
590  if (window_manager_use_sceneboard) {
591    external_deps += [ "window_manager:libwm_lite" ]
592  } else {
593    external_deps += [ "window_manager:libwm" ]
594  }
595}
596
597ohos_unittest("TextListenerInnerApiTest") {
598  branch_protector_ret = "pac_ret"
599  sanitize = {
600    cfi = true
601    cfi_cross_dso = true
602    debug = false
603  }
604  module_out_path = module_output_path
605
606  sources = [ "src/text_listener_inner_api_test.cpp" ]
607
608  configs = [ ":module_private_config" ]
609
610  deps = [
611    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
612    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
613    "${inputmethod_path}/services:inputmethod_service",
614    "${inputmethod_path}/test/common:inputmethod_test_common",
615    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
616    "//third_party/googletest:gmock",
617    "//third_party/googletest:gtest_main",
618  ]
619
620  external_deps = [
621    "ability_base:want",
622    "ability_runtime:ability_context_native",
623    "ability_runtime:ability_manager",
624    "access_token:libaccesstoken_sdk",
625    "bundle_framework:appexecfwk_core",
626    "c_utils:utils",
627    "eventhandler:libeventhandler",
628    "hilog:libhilog",
629    "input:libmmi-client",
630    "ipc:ipc_single",
631    "napi:ace_napi",
632    "safwk:system_ability_fwk",
633    "samgr:samgr_proxy",
634  ]
635
636  if (window_manager_use_sceneboard) {
637    external_deps += [ "window_manager:libwm_lite" ]
638  } else {
639    external_deps += [ "window_manager:libwm" ]
640  }
641}
642
643ohos_unittest("ImeProxyTest") {
644  branch_protector_ret = "pac_ret"
645  sanitize = {
646    cfi = true
647    cfi_cross_dso = true
648    debug = false
649  }
650  module_out_path = module_output_path
651
652  sources = [ "src/ime_proxy_test.cpp" ]
653
654  configs = [ ":module_private_config" ]
655
656  deps = [
657    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
658    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
659    "${inputmethod_path}/services:inputmethod_service",
660    "${inputmethod_path}/test/common:inputmethod_test_common",
661    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
662    "${inputmethod_path}/test/unittest/resource/bundle_dependencies/editorBox:editorBox",
663    "${inputmethod_path}/test/unittest/resource/bundle_dependencies/extImfBundle:extImf",
664    "${inputmethod_path}/test/unittest/resource/ohos_test:copy_ohos_test",
665    "//third_party/googletest:gtest_main",
666  ]
667
668  external_deps = [
669    "ability_base:want",
670    "ability_runtime:ability_context_native",
671    "ability_runtime:ability_manager",
672    "access_token:libaccesstoken_sdk",
673    "bundle_framework:appexecfwk_core",
674    "c_utils:utils",
675    "graphic_2d:librender_service_client",
676    "graphic_2d:window_animation",
677    "hilog:libhilog",
678    "input:libmmi-client",
679    "ipc:ipc_single",
680    "napi:ace_napi",
681    "window_manager:libdm",
682  ]
683
684  if (window_manager_use_sceneboard) {
685    external_deps += [ "window_manager:libwm_lite" ]
686  } else {
687    external_deps += [ "window_manager:libwm" ]
688  }
689}
690
691ohos_unittest("EnableImeDataParseTest") {
692  branch_protector_ret = "pac_ret"
693  sanitize = {
694    cfi = true
695    cfi_cross_dso = true
696    debug = false
697  }
698  module_out_path = module_output_path
699
700  include_dirs = [
701    "${inputmethod_path}/test/unittest/cpp_test/mock",
702    "${inputmethod_path}/services/adapter/settings_data_provider/include",
703    "${inputmethod_path}/services/adapter/settings_data_provider/common/include",
704    "${inputmethod_path}/frameworks/native/inputmethod_controller/include",
705  ]
706
707  sources = [
708    "${inputmethod_path}/services/adapter/settings_data_provider/common/src/settings_data_observer.cpp",
709    "${inputmethod_path}/services/adapter/settings_data_provider/common/src/settings_data_utils.cpp",
710    "${inputmethod_path}/services/adapter/settings_data_provider/src/enable_ime_data_parser.cpp",
711    "mock/datashare_helper.cpp",
712    "mock/global.cpp",
713    "mock/ime_info_inquirer.cpp",
714    "src/enable_ime_data_parse_test.cpp",
715  ]
716
717  deps = [
718    "${inputmethod_path}/services/json:imf_json_static",
719    "//third_party/cJSON:cjson",
720    "//third_party/googletest:gmock",
721    "//third_party/googletest:gtest_main",
722  ]
723
724  external_deps = [
725    "ability_base:zuri",
726    "ability_runtime:dataobs_manager",
727    "bundle_framework:appexecfwk_core",
728    "c_utils:utils",
729    "data_share:datashare_common",
730    "data_share:datashare_consumer",
731    "hilog:libhilog",
732    "samgr:samgr_proxy",
733  ]
734}
735
736ohos_unittest("SecurityModeParseTest") {
737  branch_protector_ret = "pac_ret"
738  sanitize = {
739    cfi = true
740    cfi_cross_dso = true
741    debug = false
742  }
743  module_out_path = module_output_path
744
745  include_dirs = [
746    "${inputmethod_path}/test/unittest/cpp_test/mock",
747    "${inputmethod_path}/services/include",
748    "${inputmethod_path}/services/identity_checker/include",
749    "${inputmethod_path}/services/adapter/ime_connection_manager/include",
750    "${inputmethod_path}/services/adapter/settings_data_provider/include",
751    "${inputmethod_path}/services/adapter/settings_data_provider/common/include",
752    "${inputmethod_path}/frameworks/native/inputmethod_controller/include",
753    "${inputmethod_path}/frameworks/native/inputmethod_ability/include",
754  ]
755
756  sources = [
757    "${inputmethod_path}/services/adapter/ime_connection_manager/src/ime_connection.cpp",
758    "${inputmethod_path}/services/adapter/settings_data_provider/common/src/settings_data_observer.cpp",
759    "${inputmethod_path}/services/adapter/settings_data_provider/common/src/settings_data_utils.cpp",
760    "${inputmethod_path}/services/adapter/settings_data_provider/src/security_mode_parser.cpp",
761    "mock/datashare_helper.cpp",
762    "src/security_mode_parser_test.cpp",
763  ]
764
765  deps = [
766    "${inputmethod_path}/services:inputmethod_service_static",
767    "//third_party/googletest:gmock",
768    "//third_party/googletest:gtest_main",
769  ]
770
771  external_deps = [
772    "ability_base:zuri",
773    "ability_runtime:ability_manager",
774    "ability_runtime:dataobs_manager",
775    "access_token:libaccesstoken_sdk",
776    "bundle_framework:appexecfwk_core",
777    "c_utils:utils",
778    "data_share:datashare_common",
779    "data_share:datashare_consumer",
780    "hilog:libhilog",
781    "input:libmmi-client",
782    "ipc:ipc_core",
783    "samgr:samgr_proxy",
784  ]
785}
786
787ohos_unittest("TaskManagerTest") {
788  branch_protector_ret = "pac_ret"
789  sanitize = {
790    cfi = true
791    cfi_cross_dso = true
792    debug = false
793  }
794  module_out_path = module_output_path
795
796  sources = [
797    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/task_manager.cpp",
798    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/tasks/task.cpp",
799    "src/task_manager_test.cpp",
800  ]
801
802  configs = [ ":module_private_config" ]
803
804  deps = [
805    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
806    "${inputmethod_path}/test/common:inputmethod_test_common",
807    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
808    "//third_party/googletest:gtest_main",
809  ]
810
811  external_deps = [
812    "bundle_framework:appexecfwk_core",
813    "c_utils:utils",
814    "eventhandler:libeventhandler",
815    "hilog:libhilog",
816  ]
817}
818
819ohos_unittest("ImeFreezeManagerTest") {
820  branch_protector_ret = "pac_ret"
821  sanitize = {
822    cfi = true
823    cfi_cross_dso = true
824    debug = false
825  }
826  module_out_path = module_output_path
827
828  sources = [ "src/ime_freeze_manager_test.cpp" ]
829
830  configs = [ ":module_private_config" ]
831
832  deps = [
833    "${inputmethod_path}/services:inputmethod_service_static",
834    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
835    "//third_party/googletest:gtest_main",
836  ]
837
838  external_deps = [
839    "ability_runtime:ability_manager",
840    "access_token:libaccesstoken_sdk",
841    "bundle_framework:appexecfwk_base",
842    "bundle_framework:appexecfwk_core",
843    "c_utils:utils",
844    "data_share:datashare_common",
845    "data_share:datashare_consumer",
846    "eventhandler:libeventhandler",
847    "hilog:libhilog",
848    "input:libmmi-client",
849    "ipc:ipc_core",
850    "ipc:ipc_single",
851    "os_account:os_account_innerkits",
852  ]
853
854  if (window_manager_use_sceneboard) {
855    external_deps += [ "window_manager:libwm_lite" ]
856  } else {
857    external_deps += [ "window_manager:libwm" ]
858  }
859}
860
861ohos_unittest("JsonOperateTest") {
862  branch_protector_ret = "pac_ret"
863  sanitize = {
864    cfi = true
865    cfi_cross_dso = true
866    debug = false
867  }
868  module_out_path = module_output_path
869
870  sources = [ "src/json_operate_test.cpp" ]
871
872  deps = [
873    "${inputmethod_path}/services:inputmethod_service_static",
874    "${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
875    "${inputmethod_path}/services/json:imf_json_static",
876    "//third_party/cJSON:cjson",
877    "//third_party/googletest:gtest_main",
878  ]
879
880  external_deps = [
881    "bundle_framework:appexecfwk_base",
882    "bundle_framework:appexecfwk_core",
883    "data_share:datashare_common",
884    "data_share:datashare_consumer",
885    "hilog:libhilog",
886    "ipc:ipc_single",
887    "resource_management:global_resmgr",
888  ]
889}
890
891ohos_unittest("VirtualListenerTest") {
892  branch_protector_ret = "pac_ret"
893  sanitize = {
894    cfi = true
895    cfi_cross_dso = true
896    debug = false
897  }
898  module_out_path = module_output_path
899
900  sources = [ "src/virtual_listener_test.cpp" ]
901
902  configs = [ ":module_private_config" ]
903
904  deps = [
905    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
906    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
907    "${inputmethod_path}/services:inputmethod_service",
908    "${inputmethod_path}/test/common:inputmethod_test_common",
909    "//third_party/googletest:gmock",
910    "//third_party/googletest:gtest_main",
911  ]
912
913  external_deps = [
914    "ability_base:want",
915    "ability_runtime:ability_context_native",
916    "ability_runtime:ability_manager",
917    "access_token:libaccesstoken_sdk",
918    "bundle_framework:appexecfwk_core",
919    "c_utils:utils",
920    "eventhandler:libeventhandler",
921    "hilog:libhilog",
922    "input:libmmi-client",
923    "ipc:ipc_single",
924    "napi:ace_napi",
925    "safwk:system_ability_fwk",
926    "samgr:samgr_proxy",
927  ]
928
929  if (window_manager_use_sceneboard) {
930    external_deps += [ "window_manager:libwm_lite" ]
931  } else {
932    external_deps += [ "window_manager:libwm" ]
933  }
934}
935ohos_unittest("ImeSystemChannelTest") {
936  branch_protector_ret = "pac_ret"
937  sanitize = {
938    cfi = true
939    cfi_cross_dso = true
940    debug = false
941    blocklist = "./inputmethod_blocklist.txt"
942  }
943  module_out_path = module_output_path
944
945  sources = [ "src/ime_system_channel_test.cpp" ]
946
947  configs = [ ":module_private_config" ]
948
949  deps = [
950    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
951    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
952    "${inputmethod_path}/services:inputmethod_service",
953    "${inputmethod_path}/test/common:inputmethod_test_common",
954    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
955    "//third_party/googletest:gtest_main",
956  ]
957
958  external_deps = [
959    "ability_base:want",
960    "ability_runtime:ability_context_native",
961    "ability_runtime:ability_manager",
962    "access_token:libaccesstoken_sdk",
963    "bundle_framework:appexecfwk_core",
964    "c_utils:utils",
965    "eventhandler:libeventhandler",
966    "hilog:libhilog",
967    "input:libmmi-client",
968    "ipc:ipc_single",
969    "napi:ace_napi",
970    "safwk:system_ability_fwk",
971    "samgr:samgr_proxy",
972  ]
973
974  if (window_manager_use_sceneboard) {
975    external_deps += [ "window_manager:libwm_lite" ]
976  } else {
977    external_deps += [ "window_manager:libwm" ]
978  }
979}
980
981if (defined(build_seccomp) && build_seccomp) {
982  ohos_unittest("InputMethodSeccompTest") {
983    module_out_path = module_output_path
984    sanitize = {
985      cfi = true
986      cfi_cross_dso = true
987      debug = false
988      blocklist = "./inputmethod_blocklist.txt"
989    }
990    sources = [ "src/input_method_ext_seccomp_test.cpp" ]
991    external_deps = [ "init:seccomp" ]
992  }
993} else {
994  group("InputMethodSeccompTest") {
995  }
996}
997
998ohos_unittest("ImeControllerCpaiTest") {
999  sanitize = {
1000    cfi = true
1001    cfi_cross_dso = true
1002    debug = false
1003    blocklist = "./inputmethod_blocklist.txt"
1004  }
1005  module_out_path = module_output_path
1006
1007  sources = [
1008    "src/inputmethod_controller_capi_test.cpp",
1009    "src/native_text_changed_listener_test.cpp",
1010  ]
1011  include_dirs = [
1012    "${inputmethod_path}/interfaces/kits/c",
1013    "${inputmethod_path}/frameworks/ndk/include",
1014  ]
1015
1016  deps = [
1017    "${inputmethod_path}/frameworks/ndk:ohinputmethod",
1018    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
1019  ]
1020
1021  external_deps = [
1022    "googletest:gtest_main",
1023    "input:libmmi-client",
1024  ]
1025}
1026
1027ohos_unittest("FullImeInfoManagerTest") {
1028  sanitize = {
1029    cfi = true
1030    cfi_cross_dso = true
1031    debug = false
1032    blocklist = "./inputmethod_blocklist.txt"
1033  }
1034  module_out_path = module_output_path
1035
1036  sources = [
1037    "${inputmethod_path}/services/src/full_ime_info_manager.cpp",
1038    "mock/ime_info_inquirer.cpp",
1039    "src/full_ime_info_manager_test.cpp",
1040  ]
1041  include_dirs = [
1042    "${inputmethod_path}/frameworks/native/inputmethod_controller/include",
1043    "${inputmethod_path}/test/unittest/cpp_test/mock",
1044  ]
1045
1046  external_deps = [
1047    "c_utils:utils",
1048    "googletest:gtest_main",
1049    "hilog:libhilog",
1050    "input:libmmi-client",
1051  ]
1052}
1053