• 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/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}/services/src/input_type_manager.cpp",
43    "src/ime_event_monitor_manager_test.cpp",
44    "src/input_method_controller_test.cpp",
45  ]
46
47  configs = [ ":module_private_config" ]
48
49  deps = [
50    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
51    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
52    "${inputmethod_path}/services:inputmethod_service_static",
53    "${inputmethod_path}/test/common:inputmethod_test_common",
54    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
55    "//third_party/googletest:gtest_main",
56  ]
57
58  external_deps = [
59    "ability_base:want",
60    "ability_runtime:ability_context_native",
61    "ability_runtime:ability_manager",
62    "access_token:libaccesstoken_sdk",
63    "bundle_framework:appexecfwk_core",
64    "c_utils:utils",
65    "config_policy:configpolicy_util",
66    "data_share:datashare_common",
67    "data_share:datashare_consumer",
68    "eventhandler:libeventhandler",
69    "hilog:libhilog",
70    "input:libmmi-client",
71    "ipc:ipc_single",
72    "napi:ace_napi",
73    "safwk:system_ability_fwk",
74    "samgr:samgr_proxy",
75    "window_manager:libdm",
76  ]
77
78  if (window_manager_use_sceneboard) {
79    external_deps += [ "window_manager:libwm_lite" ]
80  } else {
81    external_deps += [ "window_manager:libwm" ]
82  }
83}
84
85ohos_unittest("InputMethodAttachTest") {
86  branch_protector_ret = "pac_ret"
87  sanitize = {
88    cfi = true
89    cfi_cross_dso = true
90    debug = false
91  }
92  module_out_path = module_output_path
93
94  sources = [ "src/input_method_attach_test.cpp" ]
95
96  configs = [ ":module_private_config" ]
97
98  deps = [
99    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
100    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
101    "${inputmethod_path}/services:inputmethod_service_static",
102    "${inputmethod_path}/services/json:imf_json_static",
103    "${inputmethod_path}/test/common:inputmethod_test_common",
104    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
105    "//third_party/googletest:gmock",
106    "//third_party/googletest:gtest_main",
107  ]
108
109  external_deps = [
110    "ability_base:want",
111    "ability_runtime:ability_context_native",
112    "ability_runtime:ability_manager",
113    "access_token:libaccesstoken_sdk",
114    "bundle_framework:appexecfwk_core",
115    "c_utils:utils",
116    "data_share:datashare_common",
117    "data_share:datashare_consumer",
118    "hilog:libhilog",
119    "input:libmmi-client",
120    "napi:ace_napi",
121    "window_manager:libdm",
122  ]
123
124  if (window_manager_use_sceneboard) {
125    external_deps += [ "window_manager:libwm_lite" ]
126  } else {
127    external_deps += [ "window_manager:libwm" ]
128  }
129}
130ohos_unittest("InputMethodAbilityTest") {
131  branch_protector_ret = "pac_ret"
132  sanitize = {
133    cfi = true
134    cfi_cross_dso = true
135    debug = false
136  }
137  module_out_path = module_output_path
138
139  sources = [
140    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_agent_stub.cpp",
141    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_proxy.cpp",
142    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_stub.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("InputMethodPanelAdjustTest") {
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_panel_adjust_test.cpp" ]
340
341  configs = [ ":module_private_config" ]
342
343  deps = [
344    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
345    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
346    "${inputmethod_path}/services:inputmethod_service_static",
347    "${inputmethod_path}/test/common:inputmethod_test_common",
348    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
349  ]
350
351  external_deps = [
352    "ability_base:want",
353    "ability_runtime:ability_context_native",
354    "ability_runtime:ability_manager",
355    "access_token:libaccesstoken_sdk",
356    "c_utils:utils",
357    "data_share:datashare_common",
358    "data_share:datashare_consumer",
359    "googletest:gtest_main",
360    "graphic_2d:librender_service_client",
361    "graphic_2d:window_animation",
362    "hilog:libhilog",
363    "input:libmmi-client",
364    "napi:ace_napi",
365    "window_manager:libdm",
366    "window_manager:libwsutils",
367  ]
368
369  if (window_manager_use_sceneboard) {
370    external_deps += [ "window_manager:libwm_lite" ]
371  } else {
372    external_deps += [ "window_manager:libwm" ]
373  }
374}
375
376ohos_unittest("InputMethodSwitchTest") {
377  branch_protector_ret = "pac_ret"
378  sanitize = {
379    cfi = true
380    cfi_cross_dso = true
381    debug = false
382  }
383  module_out_path = module_output_path
384
385  sources = [ "src/input_method_switch_test.cpp" ]
386
387  configs = [ ":module_private_config" ]
388
389  deps = [
390    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
391    "${inputmethod_path}/services:inputmethod_service",
392    "${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
393    "${inputmethod_path}/test/common:inputmethod_test_common",
394    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
395    "//third_party/cJSON:cjson",
396    "//third_party/googletest:gtest_main",
397  ]
398
399  external_deps = [
400    "access_token:libaccesstoken_sdk",
401    "bundle_framework:appexecfwk_core",
402    "c_utils:utils",
403    "data_share:datashare_common",
404    "data_share:datashare_consumer",
405    "hilog:libhilog",
406    "input:libmmi-client",
407  ]
408
409  if (window_manager_use_sceneboard) {
410    external_deps += [ "window_manager:libwm_lite" ]
411  } else {
412    external_deps += [ "window_manager:libwm" ]
413  }
414}
415
416ohos_unittest("InputMethodPrivateMemberTest") {
417  branch_protector_ret = "pac_ret"
418  sanitize = {
419    cfi = true
420    cfi_cross_dso = true
421    debug = false
422  }
423  module_out_path = module_output_path
424
425  sources = [
426    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_agent_stub.cpp",
427    "${inputmethod_path}/frameworks/native/inputmethod_ability/src/input_method_core_stub.cpp",
428    "${inputmethod_path}/services/adapter/ime_connection_manager/src/ime_connection.cpp",
429    "${inputmethod_path}/services/src/input_control_channel_proxy.cpp",
430    "src/input_method_private_member_test.cpp",
431  ]
432
433  configs = [ ":module_private_config" ]
434
435  deps = [
436    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
437    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
438    "${inputmethod_path}/services:inputmethod_service_static",
439    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
440    "//third_party/googletest:gtest_main",
441  ]
442
443  external_deps = [
444    "ability_runtime:ability_manager",
445    "access_token:libaccesstoken_sdk",
446    "bundle_framework:appexecfwk_base",
447    "bundle_framework:appexecfwk_core",
448    "c_utils:utils",
449    "data_share:datashare_common",
450    "data_share:datashare_consumer",
451    "hilog:libhilog",
452    "input:libmmi-client",
453    "ipc:ipc_core",
454    "ipc:ipc_single",
455    "napi:ace_napi",
456    "os_account:os_account_innerkits",
457    "window_manager:libdm",
458  ]
459
460  if (window_manager_use_sceneboard) {
461    external_deps += [ "window_manager:libwm_lite" ]
462  } else {
463    external_deps += [ "window_manager:libwm" ]
464  }
465}
466
467ohos_unittest("InputMethodEditorTest") {
468  branch_protector_ret = "pac_ret"
469  sanitize = {
470    cfi = true
471    cfi_cross_dso = true
472    debug = false
473  }
474  module_out_path = module_output_path
475
476  sources = [ "src/input_method_editor_test.cpp" ]
477
478  configs = [ ":module_private_config" ]
479
480  deps = [
481    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
482    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
483    "${inputmethod_path}/services:inputmethod_service_static",
484    "${inputmethod_path}/services/json:imf_json_static",
485    "${inputmethod_path}/test/common:inputmethod_test_common",
486    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
487    "//third_party/googletest:gtest_main",
488  ]
489
490  external_deps = [
491    "ability_base:want",
492    "ability_runtime:ability_context_native",
493    "ability_runtime:ability_manager",
494    "access_token:libaccesstoken_sdk",
495    "bundle_framework:appexecfwk_core",
496    "c_utils:utils",
497    "data_share:datashare_common",
498    "data_share:datashare_consumer",
499    "eventhandler:libeventhandler",
500    "hilog:libhilog",
501    "input:libmmi-client",
502    "ipc:ipc_single",
503    "napi:ace_napi",
504    "window_manager:libdm",
505  ]
506
507  if (window_manager_use_sceneboard) {
508    external_deps += [ "window_manager:libwm_lite" ]
509  } else {
510    external_deps += [ "window_manager:libwm" ]
511  }
512}
513
514ohos_unittest("NewImeSwitchTest") {
515  branch_protector_ret = "pac_ret"
516  sanitize = {
517    cfi = true
518    cfi_cross_dso = true
519    debug = false
520  }
521  module_out_path = module_output_path
522
523  sources = [ "src/newIme_switch_test.cpp" ]
524
525  configs = [ ":module_private_config" ]
526
527  deps = [
528    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
529    "${inputmethod_path}/services:inputmethod_service",
530    "${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
531    "${inputmethod_path}/test/common:inputmethod_test_common",
532    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
533    "//third_party/cJSON:cjson",
534    "//third_party/googletest:gtest_main",
535  ]
536
537  external_deps = [
538    "access_token:libaccesstoken_sdk",
539    "bundle_framework:appexecfwk_core",
540    "c_utils:utils",
541    "data_share:datashare_common",
542    "data_share:datashare_consumer",
543    "hilog:libhilog",
544    "input:libmmi-client",
545  ]
546
547  if (window_manager_use_sceneboard) {
548    external_deps += [ "window_manager:libwm_lite" ]
549  } else {
550    external_deps += [ "window_manager:libwm" ]
551  }
552}
553
554ohos_unittest("IdentityCheckerTest") {
555  branch_protector_ret = "pac_ret"
556  sanitize = {
557    cfi = true
558    cfi_cross_dso = true
559    debug = false
560    blocklist = "./inputmethod_blocklist.txt"
561  }
562  module_out_path = module_output_path
563
564  sources = [
565    "${inputmethod_path}/services/adapter/ime_connection_manager/src/ime_connection.cpp",
566    "src/identity_checker_test.cpp",
567  ]
568
569  configs = [ ":module_private_config" ]
570
571  deps = [
572    "${inputmethod_path}/services:inputmethod_service_static",
573    "${inputmethod_path}/test/common:inputmethod_test_common",
574    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
575    "//third_party/googletest:gtest_main",
576  ]
577
578  external_deps = [
579    "ability_base:want",
580    "ability_runtime:ability_context_native",
581    "ability_runtime:ability_manager",
582    "access_token:libaccesstoken_sdk",
583    "bundle_framework:appexecfwk_core",
584    "c_utils:utils",
585    "data_share:datashare_common",
586    "data_share:datashare_consumer",
587    "hilog:libhilog",
588    "input:libmmi-client",
589    "ipc:ipc_single",
590    "napi:ace_napi",
591    "window_manager:libdm",
592  ]
593
594  if (window_manager_use_sceneboard) {
595    external_deps += [ "window_manager:libwm_lite" ]
596  } else {
597    external_deps += [ "window_manager:libwm" ]
598  }
599}
600
601ohos_unittest("TextListenerInnerApiTest") {
602  branch_protector_ret = "pac_ret"
603  sanitize = {
604    cfi = true
605    cfi_cross_dso = true
606    debug = false
607  }
608  module_out_path = module_output_path
609
610  sources = [ "src/text_listener_inner_api_test.cpp" ]
611
612  configs = [ ":module_private_config" ]
613
614  deps = [
615    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
616    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
617    "${inputmethod_path}/services:inputmethod_service",
618    "${inputmethod_path}/test/common:inputmethod_test_common",
619    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
620    "//third_party/googletest:gmock",
621    "//third_party/googletest:gtest_main",
622  ]
623
624  external_deps = [
625    "ability_base:want",
626    "ability_runtime:ability_context_native",
627    "ability_runtime:ability_manager",
628    "access_token:libaccesstoken_sdk",
629    "bundle_framework:appexecfwk_core",
630    "c_utils:utils",
631    "eventhandler:libeventhandler",
632    "hilog:libhilog",
633    "input:libmmi-client",
634    "ipc:ipc_single",
635    "napi:ace_napi",
636    "safwk:system_ability_fwk",
637    "samgr:samgr_proxy",
638  ]
639
640  if (window_manager_use_sceneboard) {
641    external_deps += [ "window_manager:libwm_lite" ]
642  } else {
643    external_deps += [ "window_manager:libwm" ]
644  }
645}
646
647ohos_unittest("ImeProxyTest") {
648  branch_protector_ret = "pac_ret"
649  sanitize = {
650    cfi = true
651    cfi_cross_dso = true
652    debug = false
653  }
654  module_out_path = module_output_path
655
656  sources = [ "src/ime_proxy_test.cpp" ]
657
658  configs = [ ":module_private_config" ]
659
660  deps = [
661    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
662    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
663    "${inputmethod_path}/services:inputmethod_service",
664    "${inputmethod_path}/test/common:inputmethod_test_common",
665    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
666    "${inputmethod_path}/test/unittest/resource/bundle_dependencies/editorBox:editorBox",
667    "${inputmethod_path}/test/unittest/resource/bundle_dependencies/extImfBundle:extImf",
668    "${inputmethod_path}/test/unittest/resource/ohos_test:copy_ohos_test",
669    "//third_party/googletest:gtest_main",
670  ]
671
672  external_deps = [
673    "ability_base:want",
674    "ability_runtime:ability_context_native",
675    "ability_runtime:ability_manager",
676    "access_token:libaccesstoken_sdk",
677    "bundle_framework:appexecfwk_core",
678    "c_utils:utils",
679    "graphic_2d:librender_service_client",
680    "graphic_2d:window_animation",
681    "hilog:libhilog",
682    "input:libmmi-client",
683    "ipc:ipc_single",
684    "napi:ace_napi",
685    "window_manager:libdm",
686  ]
687
688  if (window_manager_use_sceneboard) {
689    external_deps += [ "window_manager:libwm_lite" ]
690  } else {
691    external_deps += [ "window_manager:libwm" ]
692  }
693}
694
695ohos_unittest("EnableImeDataParseTest") {
696  branch_protector_ret = "pac_ret"
697  sanitize = {
698    cfi = true
699    cfi_cross_dso = true
700    debug = false
701  }
702  module_out_path = module_output_path
703
704  include_dirs = [
705    "${inputmethod_path}/test/unittest/cpp_test/mock",
706    "${inputmethod_path}/services/adapter/settings_data_provider/include",
707    "${inputmethod_path}/services/adapter/settings_data_provider/common/include",
708    "${inputmethod_path}/frameworks/native/inputmethod_controller/include",
709  ]
710
711  sources = [
712    "${inputmethod_path}/services/adapter/settings_data_provider/common/src/settings_data_observer.cpp",
713    "${inputmethod_path}/services/adapter/settings_data_provider/common/src/settings_data_utils.cpp",
714    "${inputmethod_path}/services/adapter/settings_data_provider/src/enable_ime_data_parser.cpp",
715    "mock/datashare_helper.cpp",
716    "mock/global.cpp",
717    "mock/ime_info_inquirer.cpp",
718    "src/enable_ime_data_parse_test.cpp",
719  ]
720
721  deps = [
722    "${inputmethod_path}/services/json:imf_json_static",
723    "//third_party/cJSON:cjson",
724    "//third_party/googletest:gmock",
725    "//third_party/googletest:gtest_main",
726  ]
727
728  external_deps = [
729    "ability_base:zuri",
730    "ability_runtime:dataobs_manager",
731    "bundle_framework:appexecfwk_core",
732    "c_utils:utils",
733    "data_share:datashare_common",
734    "data_share:datashare_consumer",
735    "hilog:libhilog",
736    "samgr:samgr_proxy",
737  ]
738}
739
740ohos_unittest("SecurityModeParseTest") {
741  branch_protector_ret = "pac_ret"
742  sanitize = {
743    cfi = true
744    cfi_cross_dso = true
745    debug = false
746  }
747  module_out_path = module_output_path
748
749  include_dirs = [
750    "${inputmethod_path}/test/unittest/cpp_test/mock",
751    "${inputmethod_path}/services/include",
752    "${inputmethod_path}/services/identity_checker/include",
753    "${inputmethod_path}/services/adapter/ime_connection_manager/include",
754    "${inputmethod_path}/services/adapter/settings_data_provider/include",
755    "${inputmethod_path}/services/adapter/settings_data_provider/common/include",
756    "${inputmethod_path}/frameworks/native/inputmethod_controller/include",
757    "${inputmethod_path}/frameworks/native/inputmethod_ability/include",
758  ]
759
760  sources = [
761    "${inputmethod_path}/services/adapter/ime_connection_manager/src/ime_connection.cpp",
762    "${inputmethod_path}/services/adapter/settings_data_provider/common/src/settings_data_observer.cpp",
763    "${inputmethod_path}/services/adapter/settings_data_provider/common/src/settings_data_utils.cpp",
764    "${inputmethod_path}/services/adapter/settings_data_provider/src/security_mode_parser.cpp",
765    "mock/datashare_helper.cpp",
766    "src/security_mode_parser_test.cpp",
767  ]
768
769  deps = [
770    "${inputmethod_path}/services:inputmethod_service_static",
771    "//third_party/googletest:gmock",
772    "//third_party/googletest:gtest_main",
773  ]
774
775  external_deps = [
776    "ability_base:zuri",
777    "ability_runtime:ability_manager",
778    "ability_runtime:dataobs_manager",
779    "access_token:libaccesstoken_sdk",
780    "bundle_framework:appexecfwk_core",
781    "c_utils:utils",
782    "data_share:datashare_common",
783    "data_share:datashare_consumer",
784    "hilog:libhilog",
785    "input:libmmi-client",
786    "ipc:ipc_core",
787    "samgr:samgr_proxy",
788  ]
789}
790
791ohos_unittest("ImeFreezeManagerTest") {
792  branch_protector_ret = "pac_ret"
793  sanitize = {
794    cfi = true
795    cfi_cross_dso = true
796    debug = false
797  }
798  module_out_path = module_output_path
799
800  sources = [ "src/ime_freeze_manager_test.cpp" ]
801
802  configs = [ ":module_private_config" ]
803
804  deps = [
805    "${inputmethod_path}/services:inputmethod_service_static",
806    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
807    "//third_party/googletest:gtest_main",
808  ]
809
810  external_deps = [
811    "ability_runtime:ability_manager",
812    "access_token:libaccesstoken_sdk",
813    "bundle_framework:appexecfwk_base",
814    "bundle_framework:appexecfwk_core",
815    "c_utils:utils",
816    "data_share:datashare_common",
817    "data_share:datashare_consumer",
818    "eventhandler:libeventhandler",
819    "hilog:libhilog",
820    "input:libmmi-client",
821    "ipc:ipc_core",
822    "ipc:ipc_single",
823    "os_account:os_account_innerkits",
824  ]
825
826  if (window_manager_use_sceneboard) {
827    external_deps += [ "window_manager:libwm_lite" ]
828  } else {
829    external_deps += [ "window_manager:libwm" ]
830  }
831}
832
833ohos_unittest("JsonOperateTest") {
834  branch_protector_ret = "pac_ret"
835  sanitize = {
836    cfi = true
837    cfi_cross_dso = true
838    debug = false
839  }
840  module_out_path = module_output_path
841
842  sources = [ "src/json_operate_test.cpp" ]
843
844  deps = [
845    "${inputmethod_path}/services:inputmethod_service_static",
846    "${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
847    "${inputmethod_path}/services/json:imf_json_static",
848    "//third_party/cJSON:cjson",
849    "//third_party/googletest:gtest_main",
850  ]
851
852  external_deps = [
853    "bundle_framework:appexecfwk_base",
854    "bundle_framework:appexecfwk_core",
855    "data_share:datashare_common",
856    "data_share:datashare_consumer",
857    "hilog:libhilog",
858    "ipc:ipc_single",
859  ]
860}
861
862ohos_unittest("VirtualListenerTest") {
863  branch_protector_ret = "pac_ret"
864  sanitize = {
865    cfi = true
866    cfi_cross_dso = true
867    debug = false
868  }
869  module_out_path = module_output_path
870
871  sources = [ "src/virtual_listener_test.cpp" ]
872
873  configs = [ ":module_private_config" ]
874
875  deps = [
876    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
877    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
878    "${inputmethod_path}/services:inputmethod_service",
879    "${inputmethod_path}/test/common:inputmethod_test_common",
880    "//third_party/googletest:gmock",
881    "//third_party/googletest:gtest_main",
882  ]
883
884  external_deps = [
885    "ability_base:want",
886    "ability_runtime:ability_context_native",
887    "ability_runtime:ability_manager",
888    "access_token:libaccesstoken_sdk",
889    "bundle_framework:appexecfwk_core",
890    "c_utils:utils",
891    "eventhandler:libeventhandler",
892    "hilog:libhilog",
893    "input:libmmi-client",
894    "ipc:ipc_single",
895    "napi:ace_napi",
896    "safwk:system_ability_fwk",
897    "samgr:samgr_proxy",
898  ]
899
900  if (window_manager_use_sceneboard) {
901    external_deps += [ "window_manager:libwm_lite" ]
902  } else {
903    external_deps += [ "window_manager:libwm" ]
904  }
905}
906ohos_unittest("ImeSystemChannelTest") {
907  branch_protector_ret = "pac_ret"
908  sanitize = {
909    cfi = true
910    cfi_cross_dso = true
911    debug = false
912    blocklist = "./inputmethod_blocklist.txt"
913  }
914  module_out_path = module_output_path
915
916  sources = [ "src/ime_system_channel_test.cpp" ]
917
918  configs = [ ":module_private_config" ]
919
920  deps = [
921    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability",
922    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
923    "${inputmethod_path}/services:inputmethod_service",
924    "${inputmethod_path}/test/common:inputmethod_test_common",
925    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
926    "//third_party/googletest:gtest_main",
927  ]
928
929  external_deps = [
930    "ability_base:want",
931    "ability_runtime:ability_context_native",
932    "ability_runtime:ability_manager",
933    "access_token:libaccesstoken_sdk",
934    "bundle_framework:appexecfwk_core",
935    "c_utils:utils",
936    "eventhandler:libeventhandler",
937    "hilog:libhilog",
938    "input:libmmi-client",
939    "ipc:ipc_single",
940    "napi:ace_napi",
941    "safwk:system_ability_fwk",
942    "samgr:samgr_proxy",
943  ]
944
945  if (window_manager_use_sceneboard) {
946    external_deps += [ "window_manager:libwm_lite" ]
947  } else {
948    external_deps += [ "window_manager:libwm" ]
949  }
950}
951
952if (defined(build_seccomp) && build_seccomp) {
953  ohos_unittest("InputMethodSeccompTest") {
954    module_out_path = module_output_path
955    sanitize = {
956      cfi = true
957      cfi_cross_dso = true
958      debug = false
959      blocklist = "./inputmethod_blocklist.txt"
960    }
961    sources = [ "src/input_method_ext_seccomp_test.cpp" ]
962    external_deps = [ "init:seccomp" ]
963  }
964} else {
965  group("InputMethodSeccompTest") {
966  }
967}
968
969ohos_unittest("ImeControllerCpaiTest") {
970  sanitize = {
971    cfi = true
972    cfi_cross_dso = true
973    debug = false
974    blocklist = "./inputmethod_blocklist.txt"
975  }
976  module_out_path = module_output_path
977
978  sources = [
979    "src/inputmethod_controller_capi_test.cpp",
980    "src/native_text_changed_listener_test.cpp",
981  ]
982  include_dirs = [
983    "${inputmethod_path}/interfaces/kits/c",
984    "${inputmethod_path}/frameworks/ndk/include",
985  ]
986
987  deps = [
988    "${inputmethod_path}/frameworks/ndk:ohinputmethod",
989    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
990  ]
991
992  external_deps = [
993    "googletest:gtest_main",
994    "input:libmmi-client",
995  ]
996}
997
998ohos_unittest("InputMethodMessageHandlerTest") {
999  branch_protector_ret = "pac_ret"
1000  sanitize = {
1001    cfi = true
1002    cfi_cross_dso = true
1003    debug = false
1004    blocklist = "./inputmethod_blocklist.txt"
1005  }
1006  module_out_path = module_output_path
1007
1008  sources = [
1009    "${inputmethod_path}/services/src/input_type_manager.cpp",
1010    "src/input_method_message_handler_test.cpp",
1011  ]
1012
1013  configs = [ ":module_private_config" ]
1014
1015  deps = [
1016    "${inputmethod_path}/frameworks/ndk:ohinputmethod_static",
1017    "${inputmethod_path}/interfaces/inner_api/inputmethod_ability:inputmethod_ability_static",
1018    "${inputmethod_path}/interfaces/inner_api/inputmethod_controller:inputmethod_client_static",
1019    "${inputmethod_path}/services:inputmethod_service_static",
1020    "${inputmethod_path}/test/common:inputmethod_test_common",
1021    "${inputmethod_path}/test/unittest/cpp_test/common:inputmethod_tdd_util",
1022  ]
1023
1024  external_deps = [
1025    "ability_base:want",
1026    "ability_runtime:ability_context_native",
1027    "ability_runtime:ability_manager",
1028    "access_token:libaccesstoken_sdk",
1029    "bundle_framework:appexecfwk_core",
1030    "c_utils:utils",
1031    "config_policy:configpolicy_util",
1032    "data_share:datashare_common",
1033    "data_share:datashare_consumer",
1034    "eventhandler:libeventhandler",
1035    "googletest:gtest_main",
1036    "hilog:libhilog",
1037    "input:libmmi-client",
1038    "ipc:ipc_single",
1039    "napi:ace_napi",
1040    "safwk:system_ability_fwk",
1041    "samgr:samgr_proxy",
1042    "window_manager:libdm",
1043  ]
1044
1045  if (window_manager_use_sceneboard) {
1046    external_deps += [ "window_manager:libwm_lite" ]
1047  } else {
1048    external_deps += [ "window_manager:libwm" ]
1049  }
1050}
1051