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