• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2025 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/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  ]
47
48  external_deps = [
49    "ability_base:want",
50    "access_token:libaccesstoken_sdk",
51    "access_token:libtokenid_sdk",
52    "bundle_framework:appexecfwk_base",
53    "bundle_framework:appexecfwk_core",
54    "c_utils:utils",
55    "eventhandler:libeventhandler",
56    "googletest:gtest_main",
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  ]
79
80  external_deps = [
81    "ability_base:want",
82    "access_token:libaccesstoken_sdk",
83    "access_token:libtokenid_sdk",
84    "bundle_framework:appexecfwk_base",
85    "bundle_framework:appexecfwk_core",
86    "c_utils:utils",
87    "eventhandler:libeventhandler",
88    "googletest:gtest_main",
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  ]
111
112  external_deps = [
113    "ability_base:want",
114    "access_token:libaccesstoken_sdk",
115    "access_token:libtokenid_sdk",
116    "bundle_framework:appexecfwk_base",
117    "bundle_framework:appexecfwk_core",
118    "c_utils:utils",
119    "eventhandler:libeventhandler",
120    "googletest:gtest_main",
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  ]
143
144  external_deps = [
145    "ability_base:want",
146    "access_token:libaccesstoken_sdk",
147    "access_token:libtokenid_sdk",
148    "bundle_framework:appexecfwk_base",
149    "bundle_framework:appexecfwk_core",
150    "c_utils:utils",
151    "eventhandler:libeventhandler",
152    "googletest:gtest_main",
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  ]
179
180  external_deps = [
181    "ability_runtime:ability_manager",
182    "c_utils:utils",
183    "eventhandler:libeventhandler",
184    "ffrt:libffrt",
185    "googletest:gtest_main",
186    "hilog:libhilog",
187    "init:libbegetutil",
188    "ipc:ipc_core",
189  ]
190}
191
192ohos_unittest("bundle_manager_death_recipient_unit_test") {
193  module_out_path = module_output_path
194
195  include_dirs = [
196    "${ces_innerkits_path}",
197    "${services_path}/include",
198  ]
199
200  sources = [
201    "${services_path}/src/bms_death_recipient.cpp",
202    "bundle_manager_death_recipient_unit_test/bundle_manager_death_recipient_unit_test.cpp",
203    "mock/mock_bundle_manager_helper.cpp",
204  ]
205
206  deps = [ "${ces_native_path}:cesfwk_innerkits" ]
207
208  external_deps = [
209    "bundle_framework:appexecfwk_base",
210    "bundle_framework:appexecfwk_core",
211    "c_utils:utils",
212    "ffrt:libffrt",
213    "googletest:gtest_main",
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  ]
227
228  sources = [
229    "${services_path}/src/event_report.cpp",
230    "${services_path}/src/static_subscriber_data_manager.cpp",
231    "${services_path}/src/static_subscriber_manager.cpp",
232    "mock/mock_ability_manager_helper.cpp",
233    "mock/mock_bundle_manager_helper.cpp",
234    "static_subscriber_connection_unit_test/mock_static_subscriber_proxy.cpp",
235    "static_subscriber_manager_unit_test/mock_access_token_helper.cpp",
236    "static_subscriber_manager_unit_test/mock_os_account_manager_helper.cpp",
237    "static_subscriber_manager_unit_test/static_subscriber_manager_unit_test.cpp",
238  ]
239
240  deps = [
241    "${ces_extension_path}:static_subscriber_ipc",
242    "${ces_native_path}:cesfwk_innerkits",
243    "${services_path}:cesfwk_services_static",
244  ]
245
246  external_deps = [
247    "ability_base:want",
248    "ability_runtime:ability_manager",
249    "access_token:libaccesstoken_sdk",
250    "access_token:libtokenid_sdk",
251    "bundle_framework:appexecfwk_base",
252    "bundle_framework:appexecfwk_core",
253    "c_utils:utils",
254    "eventhandler:libeventhandler",
255    "ffrt:libffrt",
256    "googletest:gtest_main",
257    "hicollie:libhicollie",
258    "hilog:libhilog",
259    "hitrace:hitrace_meter",
260    "init:libbegetutil",
261    "ipc:ipc_core",
262    "json:nlohmann_json_static",
263    "kv_store:distributeddata_inner",
264  ]
265}
266
267ohos_unittest("static_subscriber_data_manager_unit_test") {
268  module_out_path = module_output_path
269
270  include_dirs = [
271    "${ces_innerkits_path}",
272    "${services_path}/include",
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 = [ "${ces_native_path}:cesfwk_innerkits" ]
281
282  external_deps = [
283    "ffrt:libffrt",
284    "googletest:gtest_main",
285    "hilog:libhilog",
286    "json:nlohmann_json_static",
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  ]
311
312  external_deps = [
313    "ability_base:want",
314    "ability_runtime:ability_manager",
315    "c_utils:utils",
316    "eventhandler:libeventhandler",
317    "ffrt:libffrt",
318    "googletest:gtest_main",
319    "hilog:libhilog",
320    "init:libbegetutil",
321    "ipc:ipc_core",
322  ]
323}
324
325ohos_unittest("common_event_sticky_test") {
326  module_out_path = module_output_path
327
328  sources = [
329    "${common_event_service_path}/test/mock/mock_bundle_manager.cpp",
330    "./mock/mock_access_token_kit.cpp",
331    "common_event_sticky_test.cpp",
332  ]
333
334  configs = [ ":cesfwk_services_config" ]
335
336  deps = [
337    "${ces_core_path}:cesfwk_core",
338    "${ces_native_path}:cesfwk_innerkits",
339    "${services_path}:cesfwk_services_static",
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    "googletest:gtest_main",
351    "hilog:libhilog",
352    "init:libbegetutil",
353    "ipc:ipc_core",
354  ]
355}
356
357ohos_unittest("common_event_subscribe_unit_test") {
358  module_out_path = module_output_path
359
360  sources = [
361    "${common_event_service_path}/test/mock/mock_access_token_helper.cpp",
362    "${common_event_service_path}/test/mock/mock_bundle_manager.cpp",
363    "${common_event_service_path}/test/mock/mock_ipc_object_stub.cpp",
364    "common_event_subscribe_unit_test.cpp",
365  ]
366
367  configs = [ ":cesfwk_services_config" ]
368
369  deps = [
370    "${ces_core_path}:cesfwk_core",
371    "${ces_extension_path}:static_subscriber_ipc",
372    "${ces_native_path}:cesfwk_innerkits",
373    "${services_path}:cesfwk_services_static",
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    "googletest:gtest_main",
386    "hilog:libhilog",
387    "init:libbegetutil",
388    "ipc:ipc_core",
389  ]
390}
391
392ohos_unittest("common_event_unsubscribe_unit_test") {
393  module_out_path = module_output_path
394
395  sources = [
396    "${common_event_service_path}/test/mock/mock_access_token_helper.cpp",
397    "${common_event_service_path}/test/mock/mock_bundle_manager.cpp",
398    "common_event_unsubscribe_unit_test.cpp",
399  ]
400
401  configs = [ ":cesfwk_services_config" ]
402
403  deps = [
404    "${ces_core_path}:cesfwk_core",
405    "${ces_native_path}:cesfwk_innerkits",
406    "${services_path}:cesfwk_services_static",
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    "googletest:gtest_main",
418    "hilog:libhilog",
419    "init:libbegetutil",
420    "ipc:ipc_core",
421  ]
422}
423
424ohos_unittest("common_event_publish_ordered_event_unit_test") {
425  module_out_path = module_output_path
426
427  sources = [
428    "${common_event_service_path}/test/mock/mock_access_token_helper.cpp",
429    "${common_event_service_path}/test/mock/mock_bundle_manager.cpp",
430    "common_event_publish_ordered_event_unit_test.cpp",
431  ]
432
433  configs = [ ":cesfwk_services_config" ]
434
435  deps = [
436    "${ces_core_path}:cesfwk_core",
437    "${ces_native_path}:cesfwk_innerkits",
438    "${services_path}:cesfwk_services_static",
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    "googletest:gtest_main",
450    "hilog:libhilog",
451    "init:libbegetutil",
452    "ipc:ipc_core",
453  ]
454}
455
456ohos_unittest("common_event_publish_permission_event_unit_test") {
457  module_out_path = module_output_path
458
459  sources = [
460    "${common_event_service_path}/test/mock/mock_bundle_manager.cpp",
461    "./mock/mock_access_token_kit.cpp",
462    "common_event_publish_permission_event_unit_test.cpp",
463  ]
464
465  configs = [ ":cesfwk_services_config" ]
466
467  deps = [
468    "${ces_core_path}:cesfwk_core",
469    "${ces_native_path}:cesfwk_innerkits",
470    "${services_path}:cesfwk_services_static",
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    "googletest:gtest_main",
482    "hilog:libhilog",
483    "init:libbegetutil",
484    "ipc:ipc_core",
485  ]
486}
487
488ohos_unittest("common_event_publish_manager_event_unit_test") {
489  module_out_path = module_output_path
490
491  sources = [ "common_event_publish_manager_event_unit_test.cpp" ]
492
493  configs = [ ":cesfwk_services_config" ]
494
495  deps = [ "${services_path}:cesfwk_services_static" ]
496
497  external_deps = [
498    "c_utils:utils",
499    "googletest:gtest_main",
500    "hilog:libhilog",
501  ]
502}
503
504ohos_unittest("common_event_hisysevent_test") {
505  module_out_path = module_output_path
506
507  sources = [ "common_event_hisysevent_test.cpp" ]
508
509  configs = [ ":cesfwk_services_config" ]
510
511  deps = [ "${services_path}:cesfwk_services_static" ]
512
513  external_deps = [
514    "c_utils:utils",
515    "googletest:gtest_main",
516    "hilog:libhilog",
517  ]
518}
519
520ohos_unittest("common_event_access_token_helper_test") {
521  module_out_path = module_output_path
522
523  sources = [
524    "${common_event_service_path}/test/mock/mock_accesstoken_kit.cpp",
525    "common_event_access_token_helper_test.cpp",
526  ]
527
528  configs = [ ":cesfwk_services_config" ]
529
530  deps = [ "${services_path}:cesfwk_services_static" ]
531
532  external_deps = [
533    "ability_runtime:abilitykit_native",
534    "access_token:libaccesstoken_sdk",
535    "access_token:libtokenid_sdk",
536    "c_utils:utils",
537    "googletest:gtest_main",
538    "hilog:libhilog",
539    "init:libbegetutil",
540  ]
541}
542
543ohos_unittest("common_event_manager_service_test") {
544  module_out_path = module_output_path
545
546  sources = [
547    "${common_event_service_path}/test/mock/mock_bundle_manager.cpp",
548    "common_event_manager_service_test.cpp",
549    "mock_common_event_subscriber.cpp",
550  ]
551
552  configs = [ ":cesfwk_services_config" ]
553
554  deps = [
555    "${ces_core_path}:cesfwk_core",
556    "${ces_native_path}:cesfwk_innerkits",
557    "${services_path}:cesfwk_services_static",
558  ]
559
560  external_deps = [
561    "ability_base:want",
562    "access_token:libaccesstoken_sdk",
563    "access_token:libtokenid_sdk",
564    "bundle_framework:appexecfwk_base",
565    "bundle_framework:appexecfwk_core",
566    "c_utils:utils",
567    "eventhandler:libeventhandler",
568    "googletest:gtest_main",
569    "hilog:libhilog",
570    "init:libbegetutil",
571    "ipc:ipc_core",
572  ]
573}
574
575ohos_unittest("common_event_manager_service_ability_test") {
576  sanitize = {
577    integer_overflow = true
578    ubsan = true
579    boundary_sanitize = true
580    cfi = true
581    cfi_cross_dso = true
582    debug = false
583  }
584
585  module_out_path = module_output_path
586
587  sources = [
588    "common_event_manager_service_ability_test/common_event_manager_service_ability_test.cpp",
589    "common_event_manager_service_ability_test/mock_common_event_manager_service.cpp",
590  ]
591
592  configs = [ ":cesfwk_services_config" ]
593
594  deps = [
595    "${ces_core_path}:cesfwk_core",
596    "${ces_native_path}:cesfwk_innerkits",
597    "${services_path}:cesfwk_services_static",
598  ]
599
600  external_deps = [
601    "ability_base:want",
602    "access_token:libaccesstoken_sdk",
603    "bundle_framework:appexecfwk_base",
604    "bundle_framework:appexecfwk_core",
605    "c_utils:utils",
606    "eventhandler:libeventhandler",
607    "googletest:gtest_main",
608    "hilog:libhilog",
609    "init:libbegetutil",
610    "ipc:ipc_core",
611    "safwk:system_ability_fwk",
612  ]
613}
614
615ohos_unittest("bundle_manager_helper_test") {
616  module_out_path = module_output_path
617
618  include_dirs = [ "${tools_path}/test/mock" ]
619
620  sources = [
621    "${tools_path}/test/mock/mock_common_event_stub.cpp",
622    "bundle_manager_helper_test.cpp",
623    "mock/mock_os_account_manager_helper.cpp",
624    "mock/mock_service_registry.cpp",
625  ]
626
627  configs = [ ":cesfwk_services_config" ]
628
629  deps = [
630    "${ces_core_path}:cesfwk_core",
631    "${ces_extension_path}:static_subscriber_ipc",
632    "${ces_native_path}:cesfwk_innerkits",
633    "${services_path}:cesfwk_services_static",
634  ]
635
636  external_deps = [
637    "ability_base:want",
638    "ability_runtime:ability_manager",
639    "access_token:libaccesstoken_sdk",
640    "bundle_framework:appexecfwk_base",
641    "bundle_framework:appexecfwk_core",
642    "c_utils:utils",
643    "eventhandler:libeventhandler",
644    "googletest:gmock_main",
645    "googletest:gtest_main",
646    "hilog:libhilog",
647    "init:libbegetutil",
648    "ipc:ipc_core",
649  ]
650}
651
652ohos_unittest("common_event_manager_service_branch_test") {
653  module_out_path = module_output_path
654
655  sources = [
656    "././mock/mock_access_token_kit.cpp",
657    "././mock/mock_token_id_kit.cpp",
658    "common_event_manager_service_branch_test/common_event_manager_service_branch_test.cpp",
659  ]
660
661  configs = [ ":cesfwk_services_config" ]
662
663  deps = [
664    "${ces_core_path}:cesfwk_core",
665    "${ces_extension_path}:static_subscriber_ipc",
666    "${ces_native_path}:cesfwk_innerkits",
667    "${services_path}:cesfwk_services_static",
668  ]
669
670  external_deps = [
671    "ability_base:want",
672    "ability_runtime:ability_manager",
673    "access_token:libaccesstoken_sdk",
674    "access_token:libnativetoken",
675    "access_token:libtoken_setproc",
676    "access_token:libtokenid_sdk",
677    "bundle_framework:appexecfwk_base",
678    "bundle_framework:appexecfwk_core",
679    "c_utils:utils",
680    "eventhandler:libeventhandler",
681    "ffrt:libffrt",
682    "googletest:gtest_main",
683    "hilog:libhilog",
684    "init:libbegetutil",
685    "ipc:ipc_core",
686  ]
687}
688
689ohos_unittest("common_event_manager_service_new_branch_test") {
690  module_out_path = module_output_path
691
692  sources = [
693    "./mock/mock_access_token_kit.cpp",
694    "./mock/mock_token_id_kit.cpp",
695    "common_event_manager_service_new_branch_test.cpp",
696  ]
697
698  configs = [ ":cesfwk_services_config" ]
699
700  deps = [
701    "${ces_core_path}:cesfwk_core",
702    "${ces_extension_path}:static_subscriber_ipc",
703    "${ces_native_path}:cesfwk_innerkits",
704    "${services_path}:cesfwk_services_static",
705  ]
706
707  external_deps = [
708    "ability_base:want",
709    "ability_runtime:ability_manager",
710    "access_token:libaccesstoken_sdk",
711    "access_token:libnativetoken",
712    "access_token:libtoken_setproc",
713    "access_token:libtokenid_sdk",
714    "bundle_framework:appexecfwk_base",
715    "bundle_framework:appexecfwk_core",
716    "c_utils:utils",
717    "eventhandler:libeventhandler",
718    "ffrt:libffrt",
719    "googletest:gtest_main",
720    "hilog:libhilog",
721    "init:libbegetutil",
722    "ipc:ipc_core",
723  ]
724}
725
726ohos_unittest("common_event_control_manager_branch_test") {
727  module_out_path = module_output_path
728
729  include_dirs = [ "${tools_path}/test/mock" ]
730
731  sources = [
732    "${tools_path}/test/mock/mock_common_event_stub.cpp",
733    "common_event_control_manager_branch_test/common_event_control_manager_branch_test.cpp",
734    "common_event_control_manager_branch_test/mock_want.cpp",
735  ]
736
737  configs = [ ":cesfwk_services_config" ]
738
739  deps = [
740    "${ces_core_path}:cesfwk_core",
741    "${ces_extension_path}:static_subscriber_ipc",
742    "${ces_native_path}:cesfwk_innerkits",
743    "${services_path}:cesfwk_services_static",
744  ]
745
746  external_deps = [
747    "ability_base:want",
748    "ability_runtime:ability_manager",
749    "access_token:libaccesstoken_sdk",
750    "access_token:libnativetoken",
751    "access_token:libtoken_setproc",
752    "access_token:libtokenid_sdk",
753    "bundle_framework:appexecfwk_base",
754    "bundle_framework:appexecfwk_core",
755    "c_utils:utils",
756    "eventhandler:libeventhandler",
757    "googletest:gmock_main",
758    "googletest:gtest_main",
759    "hilog:libhilog",
760    "init:libbegetutil",
761    "ipc:ipc_core",
762  ]
763}
764
765ohos_unittest("common_event_control_manager_test") {
766  module_out_path = module_output_path
767
768  sources = [ "common_event_control_manager_test.cpp" ]
769
770  configs = [ ":cesfwk_services_config" ]
771
772  deps = [
773    "${ces_core_path}:cesfwk_core",
774    "${ces_extension_path}:static_subscriber_ipc",
775    "${ces_native_path}:cesfwk_innerkits",
776    "${services_path}:cesfwk_services_static",
777  ]
778
779  external_deps = [
780    "ability_base:want",
781    "ability_runtime:ability_manager",
782    "access_token:libaccesstoken_sdk",
783    "access_token:libtokenid_sdk",
784    "bundle_framework:appexecfwk_base",
785    "bundle_framework:appexecfwk_core",
786    "c_utils:utils",
787    "eventhandler:libeventhandler",
788    "ffrt:libffrt",
789    "googletest:gtest_main",
790    "hilog:libhilog",
791    "init:libbegetutil",
792    "ipc:ipc_core",
793  ]
794}
795
796ohos_unittest("common_event_subscriber_manager_test") {
797  module_out_path = module_output_path
798
799  sources = [
800    "common_event_subscriber_manager_test.cpp",
801    "mock/mock_access_token_kit.cpp",
802    "mock/mock_common_event_permission_manager.cpp",
803    "mock/mock_token_id_kit.cpp",
804  ]
805
806  configs = [ ":cesfwk_services_config" ]
807
808  deps = [
809    "${ces_core_path}:cesfwk_core",
810    "${ces_extension_path}:static_subscriber_ipc",
811    "${ces_native_path}:cesfwk_innerkits",
812    "${services_path}:cesfwk_services_static",
813  ]
814
815  external_deps = [
816    "ability_base:want",
817    "ability_runtime:ability_manager",
818    "access_token:libaccesstoken_sdk",
819    "bundle_framework:appexecfwk_base",
820    "bundle_framework:appexecfwk_core",
821    "c_utils:utils",
822    "eventhandler:libeventhandler",
823    "googletest:gtest_main",
824    "hilog:libhilog",
825    "hisysevent:libhisysevent",
826    "init:libbegetutil",
827    "ipc:ipc_core",
828  ]
829}
830
831ohos_unittest("inner_common_event_manager_test") {
832  module_out_path = module_output_path
833
834  sources = [ "inner_common_event_manager_test.cpp" ]
835
836  configs = [ ":cesfwk_services_config" ]
837
838  deps = [
839    "${ces_core_path}:cesfwk_core",
840    "${ces_extension_path}:static_subscriber_ipc",
841    "${ces_native_path}:cesfwk_innerkits",
842    "${services_path}:cesfwk_services_static",
843  ]
844
845  external_deps = [
846    "ability_base:want",
847    "ability_runtime:ability_manager",
848    "access_token:libaccesstoken_sdk",
849    "bundle_framework:appexecfwk_base",
850    "bundle_framework:appexecfwk_core",
851    "c_utils:utils",
852    "eventhandler:libeventhandler",
853    "googletest:gtest_main",
854    "hilog:libhilog",
855    "init:libbegetutil",
856    "ipc:ipc_core",
857  ]
858}
859
860ohos_unittest("ability_manager_helper_test") {
861  module_out_path = module_output_path
862
863  include_dirs = [
864    "${tools_path}/test/mock",
865    "${common_event_service_path}/services/test/unittest/mock",
866  ]
867
868  sources = [
869    "${tools_path}/test/mock/mock_common_event_stub.cpp",
870    "ability_manager_helper_test.cpp",
871    "mock/mock_service_registry.cpp",
872  ]
873
874  configs = [ ":cesfwk_services_config" ]
875
876  deps = [
877    "${ces_core_path}:cesfwk_core",
878    "${ces_extension_path}:static_subscriber_ipc",
879    "${ces_native_path}:cesfwk_innerkits",
880    "${services_path}:cesfwk_services_static",
881  ]
882
883  external_deps = [
884    "ability_base:want",
885    "ability_runtime:ability_manager",
886    "access_token:libaccesstoken_sdk",
887    "bundle_framework:appexecfwk_base",
888    "bundle_framework:appexecfwk_core",
889    "c_utils:utils",
890    "eventhandler:libeventhandler",
891    "googletest:gmock_main",
892    "googletest:gtest_main",
893    "hilog:libhilog",
894    "init:libbegetutil",
895    "ipc:ipc_core",
896    "samgr:samgr_proxy",
897  ]
898}
899
900ohos_unittest("ordered_event_handler_test") {
901  module_out_path = module_output_path
902
903  sources = [ "ordered_event_handler_test.cpp" ]
904
905  configs = [ ":cesfwk_services_config" ]
906
907  deps = [
908    "${ces_core_path}:cesfwk_core",
909    "${ces_extension_path}:static_subscriber_ipc",
910    "${ces_native_path}:cesfwk_innerkits",
911    "${services_path}:cesfwk_services_static",
912  ]
913
914  external_deps = [
915    "ability_base:want",
916    "ability_runtime:ability_manager",
917    "access_token:libaccesstoken_sdk",
918    "bundle_framework:appexecfwk_base",
919    "bundle_framework:appexecfwk_core",
920    "c_utils:utils",
921    "eventhandler:libeventhandler",
922    "googletest:gtest_main",
923    "hilog:libhilog",
924    "init:libbegetutil",
925    "ipc:ipc_core",
926  ]
927}
928
929ohos_unittest("subscriber_deach_recipient_test") {
930  module_out_path = module_output_path
931
932  sources = [ "subscriber_deach_recipient_test.cpp" ]
933
934  configs = [ ":cesfwk_services_config" ]
935
936  deps = [
937    "${ces_core_path}:cesfwk_core",
938    "${ces_extension_path}:static_subscriber_ipc",
939    "${ces_native_path}:cesfwk_innerkits",
940    "${services_path}:cesfwk_services_static",
941  ]
942
943  external_deps = [
944    "ability_base:want",
945    "ability_runtime:ability_manager",
946    "access_token:libaccesstoken_sdk",
947    "bundle_framework:appexecfwk_base",
948    "bundle_framework:appexecfwk_core",
949    "c_utils:utils",
950    "eventhandler:libeventhandler",
951    "googletest:gtest_main",
952    "hilog:libhilog",
953    "init:libbegetutil",
954    "ipc:ipc_core",
955  ]
956}
957
958ohos_unittest("capi_common_event_test") {
959  module_out_path = module_output_path
960
961  include_dirs = [
962    "${ces_innerkits_path}",
963    "${ces_ndk_path}/include",
964  ]
965
966  sources = [
967    "${ces_ndk_path}/src/oh_commonevent.cpp",
968    "${ces_ndk_path}/src/oh_commonevent_parameters_parse.cpp",
969    "${ces_ndk_path}/src/oh_commonevent_wrapper.cpp",
970    "capi_common_event_test/capi_common_event_test.cpp",
971  ]
972
973  deps = [
974    "${ces_core_path}:cesfwk_core",
975    "${ces_native_path}:cesfwk_innerkits",
976  ]
977
978  external_deps = [
979    "ability_base:base",
980    "ability_base:want",
981    "ability_runtime:ability_manager",
982    "ability_runtime:abilitykit_native",
983    "ability_runtime:napi_base_context",
984    "c_utils:utils",
985    "ffrt:libffrt",
986    "googletest:gmock_main",
987    "googletest:gtest_main",
988    "hilog:libhilog",
989    "ipc:ipc_single",
990  ]
991}
992
993group("unittest") {
994  testonly = true
995  deps = []
996
997  deps += [
998    ":ability_manager_death_recipient_unit_test",
999    ":ability_manager_helper_test",
1000    ":bundle_manager_death_recipient_unit_test",
1001    ":bundle_manager_helper_test",
1002    ":capi_common_event_test",
1003    ":common_event_access_token_helper_test",
1004    ":common_event_control_manager_branch_test",
1005    ":common_event_control_manager_test",
1006    ":common_event_dump_test",
1007    ":common_event_freeze_test",
1008    ":common_event_freeze_unit_test",
1009    ":common_event_hisysevent_test",
1010    ":common_event_manager_service_ability_test",
1011    ":common_event_manager_service_branch_test",
1012    ":common_event_manager_service_new_branch_test",
1013    ":common_event_manager_service_test",
1014    ":common_event_publish_manager_event_unit_test",
1015    ":common_event_publish_ordered_event_unit_test",
1016    ":common_event_publish_permission_event_unit_test",
1017    ":common_event_publish_system_event_test",
1018    ":common_event_sticky_test",
1019    ":common_event_subscribe_unit_test",
1020    ":common_event_subscriber_manager_test",
1021    ":common_event_unsubscribe_unit_test",
1022    ":inner_common_event_manager_test",
1023    ":ordered_event_handler_test",
1024    ":static_subscriber_connection_unit_test",
1025    ":static_subscriber_data_manager_unit_test",
1026    ":static_subscriber_manager_unit_test",
1027    ":subscriber_deach_recipient_test",
1028  ]
1029}
1030