• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-2023 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/distributed_notification_service/notification.gni")
15import("//build/ohos.gni")
16import("//build/test.gni")
17
18module_output_path =
19    "${component_name}/distributed_notification_service/unittest"
20
21ohos_unittest("ans_unit_test") {
22  module_out_path = module_output_path
23  include_dirs = [
24    ".",
25    "include",
26    "/${services_path}/ans/include",
27    "${services_path}/ans/test/unittest/mock/include",
28    "${services_path}/../framworks/core/include",
29  ]
30
31  defines = []
32
33  sources = [
34    "${test_path}/mock/mock_tokenid_kit.cpp",
35    "mock/blob.cpp",
36    "mock/distributed_kv_data_manager.cpp",
37    "mock/mock_access_token_helper.cpp",
38    "mock/mock_accesstoken_kit.cpp",
39    "mock/mock_bundle_manager_helper.cpp",
40    "mock/mock_event_handler.cpp",
41    "mock/mock_ipc.cpp",
42    "mock/mock_push_callback_stub.cpp",
43    "mock/mock_single_kv_store.cpp",
44    "mock/mock_swing_callback_stub.cpp",
45    "notification_dialog_test/mock_os_account_manager_annex.cpp",
46    "notification_hisysevent_test.cpp",
47    "notification_local_live_view_subscriber_manager_test.cpp",
48    "notification_slot_filter_test.cpp",
49    "permission_filter_test.cpp",
50    "reminder_affected_test.cpp",
51    "smart_reminder_center_test.cpp",
52  ]
53
54  if (distributed_notification_service_feature_all_scenario_collaboration) {
55    defines += [ "ALL_SCENARIO_COLLABORATION" ]
56  }
57
58  deps = [
59    "${frameworks_module_ans_path}:ans_innerkits",
60    "${services_path}/ans:libans",
61  ]
62
63  if (distributed_notification_supported) {
64    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
65    deps += [ "${services_path}/distributed:libans_distributed" ]
66    include_dirs += [ "${services_path}/distributed/include" ]
67  }
68
69  if (notification_smart_reminder_supported) {
70    sources += [ "reminder_swing_decision_center_test.cpp" ]
71    defines += [ "NOTIFICATION_SMART_REMINDER_SUPPORTED" ]
72  }
73
74  external_deps = [
75    "ability_base:want",
76    "ability_base:zuri",
77    "ability_runtime:abilitykit_native",
78    "ability_runtime:app_manager",
79    "ability_runtime:wantagent_innerkits",
80    "access_token:libaccesstoken_sdk",
81    "bundle_framework:appexecfwk_base",
82    "bundle_framework:appexecfwk_core",
83    "c_utils:utils",
84    "common_event_service:cesfwk_innerkits",
85    "device_manager:devicemanagersdk",
86    "eventhandler:libeventhandler",
87    "ffrt:libffrt",
88    "googletest:gmock_main",
89    "googletest:gtest_main",
90    "hilog:libhilog",
91    "hitrace:hitrace_meter",
92    "hitrace:libhitracechain",
93    "image_framework:image_native",
94    "ipc:ipc_core",
95    "kv_store:distributeddata_inner",
96    "os_account:os_account_innerkits",
97    "relational_store:native_rdb",
98    "safwk:system_ability_fwk",
99    "samgr:samgr_proxy",
100    "time_service:time_client",
101  ]
102
103  if (device_usage) {
104    external_deps += [ "device_usage_statistics:usagestatsinner" ]
105    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
106  }
107
108  if (player_framework) {
109    external_deps += [ "player_framework:media_client" ]
110    defines += [ "PLAYER_FRAMEWORK_ENABLE" ]
111  }
112
113  cflags = []
114  if (hisysevent_usage) {
115    external_deps += [ "hisysevent:libhisysevent" ]
116    cflags += [ "-DHAS_HISYSEVENT_PART" ]
117  }
118
119  subsystem_name = "${subsystem_name}"
120  part_name = "${component_name}"
121}
122
123ohos_unittest("notification_preferences_database_test") {
124  module_out_path = module_output_path
125  include_dirs = [
126    ".",
127    "include",
128    "/${services_path}/ans/include",
129    "${services_path}/ans/test/unittest/mock/include",
130    "${services_path}/../framworks/core/include",
131  ]
132
133  defines = []
134
135  sources = [
136    "${test_path}/mock/mock_tokenid_kit.cpp",
137    "mock/blob.cpp",
138    "mock/distributed_kv_data_manager.cpp",
139    "mock/mock_access_token_helper.cpp",
140    "mock/mock_accesstoken_kit.cpp",
141    "mock/mock_bundle_manager_helper.cpp",
142    "mock/mock_event_handler.cpp",
143    "mock/mock_ipc.cpp",
144    "mock/mock_os_account_manager.cpp",
145    "mock/mock_push_callback_stub.cpp",
146    "mock/mock_single_kv_store.cpp",
147    "mock/mock_swing_callback_stub.cpp",
148    "notification_preferences_database_test.cpp",
149  ]
150
151  deps = [
152    "${frameworks_module_ans_path}:ans_innerkits",
153    "${services_path}/ans:libans",
154  ]
155
156  if (distributed_notification_supported) {
157    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
158    deps += [ "${services_path}/distributed:libans_distributed" ]
159    include_dirs += [ "${services_path}/distributed/include" ]
160  }
161
162  external_deps = [
163    "ability_base:want",
164    "ability_base:zuri",
165    "ability_runtime:abilitykit_native",
166    "ability_runtime:app_manager",
167    "ability_runtime:wantagent_innerkits",
168    "access_token:libaccesstoken_sdk",
169    "bundle_framework:appexecfwk_base",
170    "bundle_framework:appexecfwk_core",
171    "c_utils:utils",
172    "common_event_service:cesfwk_innerkits",
173    "device_manager:devicemanagersdk",
174    "eventhandler:libeventhandler",
175    "ffrt:libffrt",
176    "googletest:gmock_main",
177    "googletest:gtest_main",
178    "hilog:libhilog",
179    "hitrace:hitrace_meter",
180    "hitrace:libhitracechain",
181    "image_framework:image_native",
182    "ipc:ipc_core",
183    "kv_store:distributeddata_inner",
184    "os_account:os_account_innerkits",
185    "relational_store:native_rdb",
186    "safwk:system_ability_fwk",
187    "samgr:samgr_proxy",
188    "time_service:time_client",
189  ]
190
191  if (device_usage) {
192    external_deps += [ "device_usage_statistics:usagestatsinner" ]
193    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
194  }
195
196  if (player_framework) {
197    external_deps += [ "player_framework:media_client" ]
198    defines += [ "PLAYER_FRAMEWORK_ENABLE" ]
199  }
200
201  cflags = []
202  if (hisysevent_usage) {
203    external_deps += [ "hisysevent:libhisysevent" ]
204    cflags += [ "-DHAS_HISYSEVENT_PART" ]
205  }
206
207  subsystem_name = "${subsystem_name}"
208  part_name = "${component_name}"
209}
210
211ohos_unittest("notification_subscriber_manager_test") {
212  module_out_path = module_output_path
213  include_dirs = [
214    ".",
215    "include",
216    "/${services_path}/ans/include",
217    "${services_path}/ans/test/unittest/mock/include",
218    "${services_path}/../frameworks/core/test/unittest/mock",
219    "${services_path}/../framworks/core/include",
220  ]
221
222  defines = []
223
224  sources = [
225    "${test_path}/mock/mock_tokenid_kit.cpp",
226    "bundle_manager_helper_test.cpp",
227    "mock/blob.cpp",
228    "mock/distributed_kv_data_manager.cpp",
229    "mock/mock_access_token_helper.cpp",
230    "mock/mock_accesstoken_kit.cpp",
231    "mock/mock_bundle_manager_helper.cpp",
232    "mock/mock_event_handler.cpp",
233    "mock/mock_ipc.cpp",
234    "mock/mock_push_callback_stub.cpp",
235    "mock/mock_single_kv_store.cpp",
236    "mock/mock_swing_callback_stub.cpp",
237    "notification_dialog_test/mock_os_account_manager_annex.cpp",
238    "notification_subscriber_manager_test.cpp",
239  ]
240
241  deps = [
242    "${frameworks_module_ans_path}:ans_innerkits",
243    "${services_path}/ans:libans",
244  ]
245
246  if (distributed_notification_supported) {
247    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
248    deps += [ "${services_path}/distributed:libans_distributed" ]
249    include_dirs += [ "${services_path}/distributed/include" ]
250  }
251
252  if (notification_smart_reminder_supported) {
253    defines += [ "NOTIFICATION_SMART_REMINDER_SUPPORTED" ]
254  }
255
256  external_deps = [
257    "ability_base:want",
258    "ability_base:zuri",
259    "ability_runtime:abilitykit_native",
260    "ability_runtime:app_manager",
261    "ability_runtime:wantagent_innerkits",
262    "access_token:libaccesstoken_sdk",
263    "bundle_framework:appexecfwk_base",
264    "bundle_framework:appexecfwk_core",
265    "c_utils:utils",
266    "common_event_service:cesfwk_innerkits",
267    "device_manager:devicemanagersdk",
268    "eventhandler:libeventhandler",
269    "ffrt:libffrt",
270    "googletest:gmock_main",
271    "googletest:gtest_main",
272    "hilog:libhilog",
273    "hitrace:hitrace_meter",
274    "hitrace:libhitracechain",
275    "image_framework:image_native",
276    "ipc:ipc_core",
277    "kv_store:distributeddata_inner",
278    "os_account:os_account_innerkits",
279    "relational_store:native_rdb",
280    "safwk:system_ability_fwk",
281    "samgr:samgr_proxy",
282    "time_service:time_client",
283  ]
284
285  if (device_usage) {
286    external_deps += [ "device_usage_statistics:usagestatsinner" ]
287    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
288  }
289
290  if (player_framework) {
291    external_deps += [ "player_framework:media_client" ]
292    defines += [ "PLAYER_FRAMEWORK_ENABLE" ]
293  }
294
295  cflags = []
296  if (hisysevent_usage) {
297    external_deps += [ "hisysevent:libhisysevent" ]
298    cflags += [ "-DHAS_HISYSEVENT_PART" ]
299  }
300
301  subsystem_name = "${subsystem_name}"
302  part_name = "${component_name}"
303}
304
305ohos_unittest("notification_service_test") {
306  sanitize = {
307    integer_overflow = true
308    ubsan = true
309    boundary_sanitize = true
310    cfi = true
311    cfi_cross_dso = true
312    debug = false
313  }
314  module_out_path = module_output_path
315  include_dirs = [
316    ".",
317    "include",
318    "/${services_path}/ans/include",
319    "${services_path}/ans/test/unittest/mock/include",
320  ]
321
322  defines = []
323
324  sources = [
325    "${test_path}/mock/mock_tokenid_kit.cpp",
326    "advanced_notification_live_view_service_test.cpp",
327    "advanced_notification_service_test.cpp",
328    "advanced_notification_slot_service_test.cpp",
329    "advanced_notification_utils_test.cpp",
330    "mock/blob.cpp",
331    "mock/distributed_kv_data_manager.cpp",
332    "mock/mock_access_token_helper.cpp",
333    "mock/mock_accesstoken_kit.cpp",
334    "mock/mock_bundle_manager_helper.cpp",
335    "mock/mock_bundle_mgr.cpp",
336    "mock/mock_event_handler.cpp",
337    "mock/mock_ipc.cpp",
338    "mock/mock_push_callback_stub.cpp",
339    "mock/mock_single_kv_store.cpp",
340    "notification_dialog_test/mock_os_account_manager_annex.cpp",
341  ]
342
343  deps = [
344    "${frameworks_module_ans_path}:ans_innerkits",
345    "${services_path}/ans:libans",
346  ]
347
348  if (distributed_notification_supported) {
349    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
350    deps += [ "${services_path}/distributed:libans_distributed" ]
351    include_dirs += [ "${services_path}/distributed/include" ]
352  }
353
354  external_deps = [
355    "ability_base:base",
356    "ability_base:want",
357    "ability_base:zuri",
358    "ability_runtime:abilitykit_native",
359    "ability_runtime:app_manager",
360    "ability_runtime:wantagent_innerkits",
361    "access_token:libaccesstoken_sdk",
362    "bundle_framework:appexecfwk_base",
363    "bundle_framework:appexecfwk_core",
364    "c_utils:utils",
365    "googletest:gmock_main",
366    "common_event_service:cesfwk_innerkits",
367    "device_manager:devicemanagersdk",
368    "eventhandler:libeventhandler",
369    "ffrt:libffrt",
370    "googletest:gtest_main",
371    "hilog:libhilog",
372    "hitrace:hitrace_meter",
373    "hitrace:libhitracechain",
374    "image_framework:image_native",
375    "ipc:ipc_core",
376    "kv_store:distributeddata_inner",
377    "os_account:os_account_innerkits",
378    "relational_store:native_rdb",
379    "safwk:system_ability_fwk",
380    "samgr:samgr_proxy",
381    "time_service:time_client",
382  ]
383
384  if (device_usage) {
385    external_deps += [ "device_usage_statistics:usagestatsinner" ]
386    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
387  }
388
389  if (player_framework) {
390    external_deps += [ "player_framework:media_client" ]
391    defines += [ "PLAYER_FRAMEWORK_ENABLE" ]
392  }
393
394  cflags = []
395  if (hisysevent_usage) {
396    external_deps += [ "hisysevent:libhisysevent" ]
397    cflags += [ "-DHAS_HISYSEVENT_PART" ]
398  }
399
400  subsystem_name = "${subsystem_name}"
401  part_name = "${component_name}"
402}
403
404ohos_unittest("notification_clone_test") {
405  sanitize = {
406    integer_overflow = true
407    ubsan = true
408    boundary_sanitize = true
409    cfi = true
410    cfi_cross_dso = true
411    debug = false
412  }
413  module_out_path = module_output_path
414  include_dirs = [
415    ".",
416    "include",
417    "/${services_path}/ans/include",
418    "${services_path}/ans/test/unittest/mock/include",
419  ]
420
421  defines = []
422
423  sources = [
424    "${test_path}/mock/mock_tokenid_kit.cpp",
425    "clone_test/notification_clone_bundle_info_test.cpp",
426    "clone_test/notification_clone_disturb_service.cpp",
427    "clone_test/notification_clone_bundle_service_test.cpp",
428    "clone_test/notification_clone_manager_test.cpp",
429    "clone_test/notification_clone_util_test.cpp",
430    "clone_test/dh_notification_clone_bundle_service_test.cpp",
431    "mock/blob.cpp",
432    "mock/distributed_kv_data_manager.cpp",
433    "mock/mock_access_token_helper.cpp",
434    "mock/mock_accesstoken_kit.cpp",
435    "mock/mock_bundle_manager_helper.cpp",
436    "mock/mock_bundle_mgr.cpp",
437    "mock/mock_event_handler.cpp",
438    "mock/mock_ipc.cpp",
439    "mock/mock_push_callback_stub.cpp",
440    "mock/mock_single_kv_store.cpp",
441    "notification_dialog_test/mock_os_account_manager_annex.cpp",
442  ]
443
444  deps = [
445    "${frameworks_module_ans_path}:ans_innerkits",
446    "${services_path}/ans:libans",
447  ]
448
449  if (distributed_notification_supported) {
450    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
451    deps += [ "${services_path}/distributed:libans_distributed" ]
452    include_dirs += [ "${services_path}/distributed/include" ]
453  }
454
455  external_deps = [
456    "ability_base:base",
457    "ability_base:want",
458    "ability_base:zuri",
459    "ability_runtime:abilitykit_native",
460    "ability_runtime:app_manager",
461    "ability_runtime:wantagent_innerkits",
462    "access_token:libaccesstoken_sdk",
463    "bundle_framework:appexecfwk_base",
464    "bundle_framework:appexecfwk_core",
465    "c_utils:utils",
466    "googletest:gmock_main",
467    "common_event_service:cesfwk_innerkits",
468    "device_manager:devicemanagersdk",
469    "eventhandler:libeventhandler",
470    "ffrt:libffrt",
471    "googletest:gtest_main",
472    "hilog:libhilog",
473    "hitrace:hitrace_meter",
474    "hitrace:libhitracechain",
475    "image_framework:image_native",
476    "ipc:ipc_core",
477    "kv_store:distributeddata_inner",
478    "os_account:os_account_innerkits",
479    "player_framework:media_client",
480    "relational_store:native_rdb",
481    "safwk:system_ability_fwk",
482    "samgr:samgr_proxy",
483    "time_service:time_client",
484  ]
485
486  if (device_usage) {
487    external_deps += [ "device_usage_statistics:usagestatsinner" ]
488    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
489  }
490
491  cflags = []
492  if (hisysevent_usage) {
493    external_deps += [ "hisysevent:libhisysevent" ]
494    cflags += [ "-DHAS_HISYSEVENT_PART" ]
495  }
496
497  subsystem_name = "${subsystem_name}"
498  part_name = "${component_name}"
499}
500
501ohos_unittest("notification_publish_service_test") {
502  sanitize = {
503    integer_overflow = true
504    ubsan = true
505    boundary_sanitize = true
506    cfi = true
507    cfi_cross_dso = true
508    debug = false
509  }
510  module_out_path = module_output_path
511  include_dirs = [
512    ".",
513    "include",
514    "/${services_path}/ans/include",
515    "${services_path}/ans/test/unittest/mock/include",
516  ]
517
518  defines = []
519
520  sources = [
521    "${test_path}/mock/mock_tokenid_kit.cpp",
522    "advanced_notification_flow_control_service_test.cpp",
523    "advanced_notification_publish_service_test.cpp",
524    "mock/blob.cpp",
525    "mock/distributed_kv_data_manager.cpp",
526    "mock/mock_access_token_helper.cpp",
527    "mock/mock_accesstoken_kit.cpp",
528    "mock/mock_bundle_manager_helper.cpp",
529    "mock/mock_bundle_mgr.cpp",
530    "mock/mock_event_handler.cpp",
531    "mock/mock_ipc.cpp",
532    "mock/mock_parameters.cpp",
533    "mock/mock_push_callback_stub.cpp",
534    "mock/mock_single_kv_store.cpp",
535    "notification_dialog_test/mock_os_account_manager_annex.cpp",
536    "publish_process_test.cpp",
537  ]
538
539  deps = [
540    "${frameworks_module_ans_path}:ans_innerkits",
541    "${services_path}/ans:libans",
542  ]
543
544  if (distributed_notification_supported) {
545    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
546    deps += [ "${services_path}/distributed:libans_distributed" ]
547    include_dirs += [ "${services_path}/distributed/include" ]
548  }
549
550  external_deps = [
551    "ability_base:base",
552    "ability_base:want",
553    "ability_base:zuri",
554    "ability_runtime:ability_manager",
555    "ability_runtime:abilitykit_native",
556    "ability_runtime:app_manager",
557    "ability_runtime:wantagent_innerkits",
558    "access_token:libaccesstoken_sdk",
559    "bundle_framework:appexecfwk_base",
560    "bundle_framework:appexecfwk_core",
561    "c_utils:utils",
562    "common_event_service:cesfwk_innerkits",
563    "data_share:datashare_consumer",
564    "device_manager:devicemanagersdk",
565    "eventhandler:libeventhandler",
566    "ffrt:libffrt",
567    "googletest:gtest_main",
568    "hilog:libhilog",
569    "hitrace:hitrace_meter",
570    "hitrace:libhitracechain",
571    "image_framework:image_native",
572    "ipc:ipc_core",
573    "kv_store:distributeddata_inner",
574    "os_account:os_account_innerkits",
575    "relational_store:native_rdb",
576    "safwk:system_ability_fwk",
577    "samgr:samgr_proxy",
578    "time_service:time_client",
579  ]
580
581  if (device_usage) {
582    external_deps += [ "device_usage_statistics:usagestatsinner" ]
583    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
584  }
585
586  if (player_framework) {
587    external_deps += [ "player_framework:media_client" ]
588    defines += [ "PLAYER_FRAMEWORK_ENABLE" ]
589  }
590
591  cflags = []
592  if (hisysevent_usage) {
593    external_deps += [ "hisysevent:libhisysevent" ]
594    cflags += [ "-DHAS_HISYSEVENT_PART" ]
595  }
596
597  subsystem_name = "${subsystem_name}"
598  part_name = "${component_name}"
599}
600
601ohos_unittest("notification_service_publish_test") {
602  sanitize = {
603    integer_overflow = true
604    ubsan = true
605    boundary_sanitize = true
606    cfi = true
607    cfi_cross_dso = true
608    debug = false
609  }
610  module_out_path = module_output_path
611  include_dirs = [
612    ".",
613    "include",
614    "/${services_path}/ans/include",
615    "${services_path}/ans/test/unittest/mock/include",
616  ]
617
618  defines = []
619
620  sources = [
621    "${test_path}/mock/mock_tokenid_kit.cpp",
622    "advanced_notification_service_test/advanced_notification_service_publish_test.cpp",
623    "mock/blob.cpp",
624    "mock/distributed_kv_data_manager.cpp",
625    "mock/mock_access_token_helper.cpp",
626    "mock/mock_accesstoken_kit.cpp",
627    "mock/mock_bundle_manager_helper.cpp",
628    "mock/mock_bundle_mgr.cpp",
629    "mock/mock_event_handler.cpp",
630    "mock/mock_ipc.cpp",
631    "mock/mock_push_callback_stub.cpp",
632    "mock/mock_single_kv_store.cpp",
633    "notification_dialog_test/mock_os_account_manager_annex.cpp",
634  ]
635
636  deps = [
637    "${frameworks_module_ans_path}:ans_innerkits",
638    "${services_path}/ans:libans",
639  ]
640
641  if (distributed_notification_supported) {
642    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
643    deps += [ "${services_path}/distributed:libans_distributed" ]
644    include_dirs += [ "${services_path}/distributed/include" ]
645  }
646
647  external_deps = [
648    "ability_base:base",
649    "ability_base:want",
650    "ability_base:zuri",
651    "ability_runtime:abilitykit_native",
652    "ability_runtime:app_manager",
653    "ability_runtime:wantagent_innerkits",
654    "access_token:libaccesstoken_sdk",
655    "bundle_framework:appexecfwk_base",
656    "bundle_framework:appexecfwk_core",
657    "c_utils:utils",
658    "common_event_service:cesfwk_innerkits",
659    "device_manager:devicemanagersdk",
660    "eventhandler:libeventhandler",
661    "ffrt:libffrt",
662    "googletest:gtest_main",
663    "hilog:libhilog",
664    "hitrace:hitrace_meter",
665    "hitrace:libhitracechain",
666    "image_framework:image_native",
667    "ipc:ipc_core",
668    "kv_store:distributeddata_inner",
669    "os_account:os_account_innerkits",
670    "relational_store:native_rdb",
671    "safwk:system_ability_fwk",
672    "samgr:samgr_proxy",
673    "time_service:time_client",
674  ]
675
676  if (device_usage) {
677    external_deps += [ "device_usage_statistics:usagestatsinner" ]
678    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
679  }
680
681  if (player_framework) {
682    external_deps += [ "player_framework:media_client" ]
683    defines += [ "PLAYER_FRAMEWORK_ENABLE" ]
684  }
685
686  cflags = []
687  if (hisysevent_usage) {
688    external_deps += [ "hisysevent:libhisysevent" ]
689    cflags += [ "-DHAS_HISYSEVENT_PART" ]
690  }
691
692  subsystem_name = "${subsystem_name}"
693  part_name = "${component_name}"
694}
695
696ohos_unittest("notification_preferences_second_test") {
697  module_out_path = module_output_path
698  include_dirs = [
699    ".",
700    "/${services_path}/ans/include",
701  ]
702
703  defines = []
704
705  sources = [ "notification_preferences_second_test.cpp" ]
706
707  deps = [
708    "${frameworks_module_ans_path}:ans_innerkits",
709    "${services_path}/ans:libans",
710  ]
711
712  external_deps = [
713    "c_utils:utils",
714    "data_share:datashare_consumer",
715    "ffrt:libffrt",
716    "googletest:gtest_main",
717    "hilog:libhilog",
718    "hitrace:hitrace_meter",
719    "kv_store:distributeddata_inner",
720    "relational_store:native_rdb",
721  ]
722
723  subsystem_name = "${subsystem_name}"
724  part_name = "${component_name}"
725}
726
727ohos_unittest("notification_preferences_test") {
728  module_out_path = module_output_path
729  include_dirs = [
730    ".",
731    "include",
732    "/${services_path}/ans/include",
733    "${services_path}/ans/include/notification_extension",
734    "${services_path}/ans/test/unittest/mock/include",
735  ]
736
737  defines = []
738
739  sources = [
740    "${test_path}/mock/mock_tokenid_kit.cpp",
741    "advanced_notification_service_ability_test.cpp",
742    "mock/blob.cpp",
743    "mock/distributed_kv_data_manager.cpp",
744    "mock/mock_access_token_helper.cpp",
745    "mock/mock_accesstoken_kit.cpp",
746    "mock/mock_bundle_manager_helper.cpp",
747    "mock/mock_event_handler.cpp",
748    "mock/mock_ipc.cpp",
749    "mock/mock_push_callback_stub.cpp",
750    "mock/mock_single_kv_store.cpp",
751    "notification_preferences_info_test.cpp",
752    "notification_preferences_test.cpp",
753  ]
754
755  if (distributed_notification_service_feature_all_scenario_collaboration) {
756    defines += [ "ALL_SCENARIO_COLLABORATION" ]
757  }
758
759  deps = [
760    "${frameworks_module_ans_path}:ans_innerkits",
761    "${services_path}/ans:libans",
762  ]
763
764  if (distributed_notification_supported) {
765    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
766    deps += [ "${services_path}/distributed:libans_distributed" ]
767    include_dirs += [ "${services_path}/distributed/include" ]
768  }
769
770  external_deps = [
771    "ability_base:want",
772    "ability_base:zuri",
773    "ability_runtime:abilitykit_native",
774    "ability_runtime:app_manager",
775    "ability_runtime:wantagent_innerkits",
776    "access_token:libaccesstoken_sdk",
777    "bundle_framework:appexecfwk_base",
778    "bundle_framework:appexecfwk_core",
779    "c_utils:utils",
780    "common_event_service:cesfwk_innerkits",
781    "data_share:datashare_common",
782    "data_share:datashare_consumer",
783    "device_manager:devicemanagersdk",
784    "eventhandler:libeventhandler",
785    "ffrt:libffrt",
786    "googletest:gtest_main",
787    "hilog:libhilog",
788    "hitrace:hitrace_meter",
789    "hitrace:libhitracechain",
790    "image_framework:image_native",
791    "ipc:ipc_core",
792    "kv_store:distributeddata_inner",
793    "os_account:os_account_innerkits",
794    "relational_store:native_rdb",
795    "safwk:system_ability_fwk",
796    "samgr:samgr_proxy",
797    "time_service:time_client",
798  ]
799
800  if (device_usage) {
801    external_deps += [ "device_usage_statistics:usagestatsinner" ]
802    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
803  }
804
805  if (player_framework) {
806    external_deps += [ "player_framework:media_client" ]
807    defines += [ "PLAYER_FRAMEWORK_ENABLE" ]
808  }
809
810  cflags = []
811  if (hisysevent_usage) {
812    external_deps += [ "hisysevent:libhisysevent" ]
813    cflags += [ "-DHAS_HISYSEVENT_PART" ]
814  }
815
816  subsystem_name = "${subsystem_name}"
817  part_name = "${component_name}"
818}
819
820ohos_unittest("access_token_helper_test") {
821  module_out_path = module_output_path
822  include_dirs = [
823    ".",
824    "include",
825    "/${services_path}/ans/include",
826    "${services_path}/ans/test/unittest/mock/include",
827  ]
828
829  sources = [
830    "${services_path}/ans/src/access_token_helper.cpp",
831    "${services_path}/ans/test/unittest/mock/mock_accesstoken_kit.cpp",
832    "${services_path}/ans/test/unittest/mock/mock_notification_analytics_util.cpp",
833    "${test_path}/mock/mock_tokenid_kit.cpp",
834    "access_token_helper_test/access_token_helper_test.cpp",
835  ]
836
837  deps = [ "${frameworks_module_ans_path}:ans_innerkits" ]
838
839  external_deps = [
840    "ability_base:want",
841    "ability_base:zuri",
842    "ability_runtime:abilitykit_native",
843    "ability_runtime:app_manager",
844    "ability_runtime:wantagent_innerkits",
845    "access_token:libaccesstoken_sdk",
846    "access_token:libtokenid_sdk",
847    "bundle_framework:appexecfwk_base",
848    "bundle_framework:appexecfwk_core",
849    "c_utils:utils",
850    "common_event_service:cesfwk_innerkits",
851    "eventhandler:libeventhandler",
852    "ffrt:libffrt",
853    "hilog:libhilog",
854    "hitrace:hitrace_meter",
855    "hitrace:libhitracechain",
856    "image_framework:image_native",
857    "init:libbegetutil",
858    "ipc:ipc_core",
859    "kv_store:distributeddata_inner",
860    "os_account:os_account_innerkits",
861    "relational_store:native_rdb",
862    "safwk:system_ability_fwk",
863    "samgr:samgr_proxy",
864    "time_service:time_client",
865  ]
866
867  if (player_framework) {
868    external_deps += [ "player_framework:media_client" ]
869    defines = [ "PLAYER_FRAMEWORK_ENABLE" ]
870  }
871  subsystem_name = "${subsystem_name}"
872  part_name = "${component_name}"
873}
874
875ohos_unittest("bundle_manager_helper_branch_test") {
876  module_out_path = module_output_path
877  include_dirs = [
878    ".",
879    "include",
880    "/${services_path}/ans/include",
881    "${services_path}/ans/test/unittest/mock/include",
882  ]
883
884  sources = [
885    "bundle_manager_helper_branch_test/bundle_manager_helper_branch_test.cpp",
886    "bundle_manager_helper_branch_test/mock_service_registry.cpp",
887  ]
888
889  deps = [
890    "${frameworks_module_ans_path}:ans_innerkits",
891    "${services_path}/ans:libans",
892  ]
893
894  external_deps = [
895    "ability_base:want",
896    "ability_base:zuri",
897    "ability_runtime:abilitykit_native",
898    "ability_runtime:app_manager",
899    "ability_runtime:wantagent_innerkits",
900    "access_token:libaccesstoken_sdk",
901    "bundle_framework:appexecfwk_base",
902    "bundle_framework:appexecfwk_core",
903    "c_utils:utils",
904    "common_event_service:cesfwk_innerkits",
905    "eventhandler:libeventhandler",
906    "ffrt:libffrt",
907    "googletest:gtest_main",
908    "hilog:libhilog",
909    "hitrace:hitrace_meter",
910    "hitrace:libhitracechain",
911    "image_framework:image_native",
912    "ipc:ipc_core",
913    "kv_store:distributeddata_inner",
914    "os_account:os_account_innerkits",
915    "relational_store:native_rdb",
916    "safwk:system_ability_fwk",
917    "samgr:samgr_proxy",
918    "time_service:time_client",
919  ]
920
921  if (player_framework) {
922    external_deps += [ "player_framework:media_client" ]
923    defines = [ "PLAYER_FRAMEWORK_ENABLE" ]
924  }
925  subsystem_name = "${subsystem_name}"
926  part_name = "${component_name}"
927}
928
929ohos_unittest("notification_dialog_test") {
930  module_out_path = module_output_path
931  include_dirs = [
932    ".",
933    "include",
934    "/${services_path}/ans/include",
935    "${services_path}/ans/test/unittest/mock/include",
936  ]
937
938  sources = [
939    "mock/mock_ability_manager_client.cpp",
940    "notification_dialog_test/mock_os_account_manager_annex.cpp",
941    "notification_dialog_test/notification_dialog_test.cpp",
942  ]
943
944  deps = [
945    "${frameworks_module_ans_path}:ans_innerkits",
946    "${services_path}/ans:libans",
947  ]
948
949  external_deps = [
950    "ability_base:want",
951    "ability_base:zuri",
952    "ability_runtime:ability_manager",
953    "ability_runtime:abilitykit_native",
954    "ability_runtime:app_manager",
955    "ability_runtime:wantagent_innerkits",
956    "access_token:libaccesstoken_sdk",
957    "bundle_framework:appexecfwk_base",
958    "bundle_framework:appexecfwk_core",
959    "c_utils:utils",
960    "common_event_service:cesfwk_innerkits",
961    "eventhandler:libeventhandler",
962    "ffrt:libffrt",
963    "googletest:gtest_main",
964    "hilog:libhilog",
965    "hitrace:hitrace_meter",
966    "hitrace:libhitracechain",
967    "image_framework:image_native",
968    "ipc:ipc_core",
969    "kv_store:distributeddata_inner",
970    "os_account:os_account_innerkits",
971    "relational_store:native_rdb",
972    "safwk:system_ability_fwk",
973    "samgr:samgr_proxy",
974    "time_service:time_client",
975  ]
976
977  if (player_framework) {
978    external_deps += [ "player_framework:media_client" ]
979    defines = [ "PLAYER_FRAMEWORK_ENABLE" ]
980  }
981  subsystem_name = "${subsystem_name}"
982  part_name = "${component_name}"
983}
984
985ohos_unittest("notification_subscriber_manager_branch_test") {
986  module_out_path = module_output_path
987  include_dirs = [
988    ".",
989    "include",
990    "/${services_path}/ans/include",
991    "${services_path}/ans/test/unittest/mock/include",
992  ]
993
994  defines = []
995
996  sources = [
997    "${test_path}/mock/mock_tokenid_kit.cpp",
998    "mock/mock_accesstoken_kit.cpp",
999    "mock/mock_bundle_manager_helper.cpp",
1000    "mock/mock_ipc.cpp",
1001    "notification_dialog_test/mock_os_account_manager_annex.cpp",
1002    "notification_subscriber_manager_branch_test/mock_access_token_helper.cpp",
1003    "notification_subscriber_manager_branch_test/mock_notification.cpp",
1004    "notification_subscriber_manager_branch_test/mock_notification_preferences.cpp",
1005    "notification_subscriber_manager_branch_test/notification_subscriber_manager_branch_test.cpp",
1006  ]
1007
1008  deps = [
1009    "${frameworks_module_ans_path}:ans_innerkits",
1010    "${services_path}/ans:libans",
1011  ]
1012
1013  if (distributed_notification_supported) {
1014    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
1015    deps += [ "${services_path}/distributed:libans_distributed" ]
1016    include_dirs += [ "${services_path}/distributed/include" ]
1017  }
1018
1019  external_deps = [
1020    "ability_base:want",
1021    "ability_base:zuri",
1022    "ability_runtime:abilitykit_native",
1023    "ability_runtime:app_manager",
1024    "ability_runtime:wantagent_innerkits",
1025    "access_token:libaccesstoken_sdk",
1026    "bundle_framework:appexecfwk_base",
1027    "bundle_framework:appexecfwk_core",
1028    "c_utils:utils",
1029    "common_event_service:cesfwk_innerkits",
1030    "eventhandler:libeventhandler",
1031    "ffrt:libffrt",
1032    "googletest:gtest_main",
1033    "hilog:libhilog",
1034    "hitrace:hitrace_meter",
1035    "hitrace:libhitracechain",
1036    "image_framework:image_native",
1037    "ipc:ipc_core",
1038    "kv_store:distributeddata_inner",
1039    "os_account:os_account_innerkits",
1040    "relational_store:native_rdb",
1041    "safwk:system_ability_fwk",
1042    "samgr:samgr_proxy",
1043    "time_service:time_client",
1044  ]
1045
1046  if (player_framework) {
1047    external_deps += [ "player_framework:media_client" ]
1048    defines += [ "PLAYER_FRAMEWORK_ENABLE" ]
1049  }
1050  subsystem_name = "${subsystem_name}"
1051  part_name = "${component_name}"
1052}
1053
1054ohos_unittest("advanced_notification_service_branch_test") {
1055  module_out_path = module_output_path
1056  include_dirs = [
1057    ".",
1058    "include",
1059    "/${services_path}/ans/include",
1060    "${services_path}/ans/test/unittest/mock/include",
1061  ]
1062
1063  defines = []
1064
1065  sources = [
1066    "${test_path}/mock/mock_tokenid_kit.cpp",
1067    "advanced_notification_service_branch_test.cpp",
1068    "mock/blob.cpp",
1069    "mock/distributed_kv_data_manager.cpp",
1070    "mock/mock_accesstoken_kit.cpp",
1071    "mock/mock_advanced_notification_service.cpp",
1072    "mock/mock_bundle_manager_helper.cpp",
1073    "mock/mock_bundle_mgr.cpp",
1074    "mock/mock_event_handler.cpp",
1075    "mock/mock_ipc.cpp",
1076    "mock/mock_single_kv_store.cpp",
1077    "notification_dialog_test/mock_os_account_manager_annex.cpp",
1078    "notification_subscriber_manager_branch_test/mock_access_token_helper.cpp",
1079  ]
1080
1081  deps = [
1082    "${frameworks_module_ans_path}:ans_innerkits",
1083    "${services_path}/ans:libans",
1084  ]
1085
1086  if (distributed_notification_supported) {
1087    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
1088    deps += [ "${services_path}/distributed:libans_distributed" ]
1089    include_dirs += [ "${services_path}/distributed/include" ]
1090  }
1091
1092  external_deps = [
1093    "ability_base:want",
1094    "ability_base:zuri",
1095    "ability_runtime:abilitykit_native",
1096    "ability_runtime:app_manager",
1097    "ability_runtime:wantagent_innerkits",
1098    "access_token:libaccesstoken_sdk",
1099    "bundle_framework:appexecfwk_base",
1100    "bundle_framework:appexecfwk_core",
1101    "c_utils:utils",
1102    "common_event_service:cesfwk_innerkits",
1103    "eventhandler:libeventhandler",
1104    "ffrt:libffrt",
1105    "googletest:gtest_main",
1106    "hilog:libhilog",
1107    "hitrace:hitrace_meter",
1108    "hitrace:libhitracechain",
1109    "image_framework:image_native",
1110    "ipc:ipc_core",
1111    "kv_store:distributeddata_inner",
1112    "os_account:os_account_innerkits",
1113    "relational_store:native_rdb",
1114    "safwk:system_ability_fwk",
1115    "samgr:samgr_proxy",
1116    "time_service:time_client",
1117  ]
1118
1119  if (player_framework) {
1120    external_deps += [ "player_framework:media_client" ]
1121    defines += [ "PLAYER_FRAMEWORK_ENABLE" ]
1122  }
1123  subsystem_name = "${subsystem_name}"
1124  part_name = "${component_name}"
1125}
1126
1127ohos_unittest("notification_preferences_database_branch_test") {
1128  module_out_path = module_output_path
1129  include_dirs = [
1130    ".",
1131    "include",
1132    "/${services_path}/ans/include",
1133    "${services_path}/ans/test/unittest/mock/include",
1134  ]
1135
1136  sources = [
1137    "${services_path}/ans/src/bundle_manager_helper.cpp",
1138    "${services_path}/ans/src/common/file_utils.cpp",
1139    "${services_path}/ans/src/common/notification_app_privileges.cpp",
1140    "${services_path}/ans/src/common/notification_config_parse.cpp",
1141    "${services_path}/ans/src/notification_preferences_database.cpp",
1142    "${services_path}/ans/src/notification_preferences_info.cpp",
1143    "${services_path}/ans/src/os_account_manager_helper.cpp",
1144    "${services_path}/ans/test/unittest/mock/mock_notification_analytics_util.cpp",
1145    "notification_dialog_test/mock_os_account_manager_annex.cpp",
1146    "notification_preferences_database_branch_test/mock_notification_rdb_data_mgr.cpp",
1147    "notification_preferences_database_branch_test/notification_preferences_database_branch_test.cpp",
1148  ]
1149
1150  deps = [ "${frameworks_module_ans_path}:ans_innerkits" ]
1151
1152  external_deps = [
1153    "ability_base:want",
1154    "ability_base:zuri",
1155    "ability_runtime:abilitykit_native",
1156    "ability_runtime:app_manager",
1157    "ability_runtime:wantagent_innerkits",
1158    "access_token:libaccesstoken_sdk",
1159    "bundle_framework:appexecfwk_base",
1160    "bundle_framework:appexecfwk_core",
1161    "c_utils:utils",
1162    "common_event_service:cesfwk_innerkits",
1163    "eventhandler:libeventhandler",
1164    "ffrt:libffrt",
1165    "googletest:gtest_main",
1166    "hilog:libhilog",
1167    "hitrace:hitrace_meter",
1168    "hitrace:libhitracechain",
1169    "image_framework:image_native",
1170    "ipc:ipc_core",
1171    "kv_store:distributeddata_inner",
1172    "libxml2:libxml2",
1173    "os_account:os_account_innerkits",
1174    "relational_store:native_rdb",
1175    "safwk:system_ability_fwk",
1176    "samgr:samgr_proxy",
1177    "time_service:time_client",
1178  ]
1179
1180  if (player_framework) {
1181    external_deps += [ "player_framework:media_client" ]
1182    defines = [ "PLAYER_FRAMEWORK_ENABLE" ]
1183  }
1184  subsystem_name = "${subsystem_name}"
1185  part_name = "${component_name}"
1186}
1187
1188ohos_unittest("push_callback_stub_test") {
1189  module_out_path = module_output_path
1190  include_dirs = [
1191    ".",
1192    "include",
1193    "/${services_path}/ans/include",
1194  ]
1195
1196  sources = [ "push_callback_stub_test.cpp" ]
1197
1198  deps = [
1199    "${frameworks_module_ans_path}:ans_innerkits",
1200    "${services_path}/ans:libans",
1201  ]
1202
1203  external_deps = [
1204    "ability_base:want",
1205    "ability_base:zuri",
1206    "ability_runtime:abilitykit_native",
1207    "ability_runtime:app_manager",
1208    "ability_runtime:wantagent_innerkits",
1209    "access_token:libaccesstoken_sdk",
1210    "bundle_framework:appexecfwk_base",
1211    "bundle_framework:appexecfwk_core",
1212    "c_utils:utils",
1213    "common_event_service:cesfwk_innerkits",
1214    "eventhandler:libeventhandler",
1215    "ffrt:libffrt",
1216    "googletest:gtest_main",
1217    "hilog:libhilog",
1218    "hitrace:hitrace_meter",
1219    "hitrace:libhitracechain",
1220    "image_framework:image_native",
1221    "ipc:ipc_core",
1222    "kv_store:distributeddata_inner",
1223    "os_account:os_account_innerkits",
1224    "relational_store:native_rdb",
1225    "safwk:system_ability_fwk",
1226    "samgr:samgr_proxy",
1227    "time_service:time_client",
1228  ]
1229
1230  if (player_framework) {
1231    external_deps += [ "player_framework:media_client" ]
1232    defines = [ "PLAYER_FRAMEWORK_ENABLE" ]
1233  }
1234  subsystem_name = "${subsystem_name}"
1235  part_name = "${component_name}"
1236}
1237
1238ohos_unittest("notification_rdb_data_mgr_test") {
1239  module_out_path = module_output_path
1240  include_dirs = [
1241    ".",
1242    "include",
1243    "/${services_path}/ans/include",
1244    "${services_path}/ans/test/unittest/mock/include",
1245  ]
1246
1247  sources = [
1248    "notification_rdb_data_mgr_test/mock_abs_result_set.cpp",
1249    "notification_rdb_data_mgr_test/mock_abs_shared_result_set.cpp",
1250    "notification_rdb_data_mgr_test/mock_rdb_helper.cpp",
1251    "notification_rdb_data_mgr_test/notification_rdb_data_mgr_test.cpp",
1252  ]
1253
1254  deps = [
1255    "${frameworks_module_ans_path}:ans_innerkits",
1256    "${services_path}/ans:libans",
1257  ]
1258
1259  external_deps = [
1260    "ability_base:want",
1261    "ability_base:zuri",
1262    "ability_runtime:abilitykit_native",
1263    "ability_runtime:app_manager",
1264    "ability_runtime:wantagent_innerkits",
1265    "access_token:libaccesstoken_sdk",
1266    "bundle_framework:appexecfwk_base",
1267    "bundle_framework:appexecfwk_core",
1268    "c_utils:utils",
1269    "common_event_service:cesfwk_innerkits",
1270    "eventhandler:libeventhandler",
1271    "ffrt:libffrt",
1272    "googletest:gtest_main",
1273    "hilog:libhilog",
1274    "hitrace:hitrace_meter",
1275    "hitrace:libhitracechain",
1276    "image_framework:image_native",
1277    "ipc:ipc_core",
1278    "kv_store:distributeddata_inner",
1279    "os_account:os_account_innerkits",
1280    "relational_store:native_rdb",
1281    "safwk:system_ability_fwk",
1282    "samgr:samgr_proxy",
1283    "time_service:time_client",
1284  ]
1285
1286  if (player_framework) {
1287    external_deps += [ "player_framework:media_client" ]
1288    defines = [ "PLAYER_FRAMEWORK_ENABLE" ]
1289  }
1290  subsystem_name = "${subsystem_name}"
1291  part_name = "${component_name}"
1292}
1293
1294ohos_unittest("notification_config_parse_test") {
1295  module_out_path = module_output_path
1296  include_dirs = [
1297    ".",
1298    "include",
1299    "/${services_path}/ans/include",
1300    "${services_path}/ans/test/unittest/mock/include",
1301  ]
1302
1303  sources = [
1304    "notification_app_privileges_test.cpp",
1305    "notification_config_parse_test.cpp",
1306  ]
1307
1308  deps = [
1309    "${frameworks_module_ans_path}:ans_innerkits",
1310    "${services_path}/ans:libans",
1311  ]
1312
1313  external_deps = [
1314    "ability_base:want",
1315    "ability_base:zuri",
1316    "ability_runtime:abilitykit_native",
1317    "ability_runtime:app_manager",
1318    "ability_runtime:wantagent_innerkits",
1319    "access_token:libaccesstoken_sdk",
1320    "bundle_framework:appexecfwk_base",
1321    "bundle_framework:appexecfwk_core",
1322    "c_utils:utils",
1323    "common_event_service:cesfwk_innerkits",
1324    "eventhandler:libeventhandler",
1325    "ffrt:libffrt",
1326    "googletest:gtest_main",
1327    "hilog:libhilog",
1328    "hitrace:hitrace_meter",
1329    "hitrace:libhitracechain",
1330    "image_framework:image_native",
1331    "ipc:ipc_core",
1332    "kv_store:distributeddata_inner",
1333    "libxml2:libxml2",
1334    "os_account:os_account_innerkits",
1335    "relational_store:native_rdb",
1336    "safwk:system_ability_fwk",
1337    "samgr:samgr_proxy",
1338    "time_service:time_client",
1339  ]
1340
1341  if (player_framework) {
1342    external_deps += [ "player_framework:media_client" ]
1343    defines = [ "PLAYER_FRAMEWORK_ENABLE" ]
1344  }
1345}
1346
1347ohos_unittest("os_account_manager_helper_test") {
1348  module_out_path = module_output_path
1349  include_dirs = [
1350    ".",
1351    "include",
1352    "/${services_path}/ans/include",
1353    "${services_path}/ans/test/unittest/mock/include",
1354  ]
1355
1356  sources = [ "os_account_manager_helper_test.cpp" ]
1357
1358  deps = [
1359    "${frameworks_module_ans_path}:ans_innerkits",
1360    "${services_path}/ans:libans",
1361  ]
1362
1363  external_deps = [
1364    "ability_base:want",
1365    "ability_base:zuri",
1366    "ability_runtime:abilitykit_native",
1367    "ability_runtime:app_manager",
1368    "ability_runtime:wantagent_innerkits",
1369    "access_token:libaccesstoken_sdk",
1370    "bundle_framework:appexecfwk_base",
1371    "bundle_framework:appexecfwk_core",
1372    "c_utils:utils",
1373    "common_event_service:cesfwk_innerkits",
1374    "eventhandler:libeventhandler",
1375    "ffrt:libffrt",
1376    "googletest:gtest_main",
1377    "hilog:libhilog",
1378    "hitrace:hitrace_meter",
1379    "hitrace:libhitracechain",
1380    "image_framework:image_native",
1381    "ipc:ipc_core",
1382    "kv_store:distributeddata_inner",
1383    "os_account:os_account_innerkits",
1384    "relational_store:native_rdb",
1385    "safwk:system_ability_fwk",
1386    "samgr:samgr_proxy",
1387    "time_service:time_client",
1388  ]
1389
1390  if (player_framework) {
1391    external_deps += [ "player_framework:media_client" ]
1392    defines = [ "PLAYER_FRAMEWORK_ENABLE" ]
1393  }
1394  subsystem_name = "${subsystem_name}"
1395  part_name = "${component_name}"
1396}
1397
1398ohos_unittest("advanced_datashare_observer_unit_test") {
1399  module_out_path = module_output_path
1400  include_dirs = [
1401    ".",
1402    "include",
1403    "/${services_path}/ans/include",
1404    "${services_path}/ans/test/unittest/mock/include",
1405  ]
1406
1407  sources = [
1408    "advanced_datashare_helper_test.cpp",
1409    "advanced_datashare_observer_test.cpp",
1410    "bundle_manager_helper_branch_test/mock_service_registry.cpp",
1411    "mock/mock_datashare.cpp",
1412  ]
1413
1414  deps = [
1415    "${frameworks_module_ans_path}:ans_innerkits",
1416    "${services_path}/ans:libans",
1417  ]
1418
1419  external_deps = [
1420    "c_utils:utils",
1421    "data_share:datashare_common",
1422    "data_share:datashare_consumer",
1423    "eventhandler:libeventhandler",
1424    "ffrt:libffrt",
1425    "googletest:gtest_main",
1426    "hilog:libhilog",
1427    "ipc:ipc_core",
1428    "relational_store:native_rdb",
1429    "safwk:system_ability_fwk",
1430    "samgr:samgr_proxy",
1431  ]
1432  subsystem_name = "${subsystem_name}"
1433  part_name = "${component_name}"
1434}
1435
1436ohos_unittest("notification_extension_wrapper_unit_test") {
1437  module_out_path = module_output_path
1438  include_dirs = [
1439    ".",
1440    "include",
1441    "/${services_path}/ans/include",
1442    "${services_path}/ans/test/unittest/mock/include",
1443  ]
1444  defines = []
1445
1446  sources = [ "notification_extension_wrapper_test.cpp" ]
1447
1448  deps = [
1449    "${frameworks_module_ans_path}:ans_innerkits",
1450    "${services_path}/ans:libans",
1451  ]
1452
1453  external_deps = [
1454    "ability_runtime:dataobs_manager",
1455    "c_utils:utils",
1456    "ffrt:libffrt",
1457    "googletest:gtest_main",
1458    "hilog:libhilog",
1459  ]
1460
1461  if (distributed_notification_service_feature_additional_control ||
1462      distributed_notification_service_feature_privileged_message) {
1463    defines += [ "ENABLE_ANS_EXT_WRAPPER" ]
1464  }
1465
1466  if (distributed_notification_service_feature_privileged_message) {
1467    defines += [ "ENABLE_ANS_PRIVILEGED_MESSAGE_EXT_WRAPPER" ]
1468  }
1469
1470  if (distributed_notification_service_feature_additional_control) {
1471    defines += [ "ENABLE_ANS_ADDITIONAL_CONTROL" ]
1472  }
1473
1474  if (distributed_notification_service_feature_summary) {
1475    defines += [ "ENABLE_ANS_AGGREGATION" ]
1476  }
1477
1478  subsystem_name = "${subsystem_name}"
1479  part_name = "${component_name}"
1480}
1481
1482ohos_unittest("advanced_notification_service_unit_test") {
1483  sanitize = {
1484    integer_overflow = true
1485    ubsan = true
1486    boundary_sanitize = true
1487    cfi = true
1488    cfi_cross_dso = true
1489    debug = false
1490  }
1491
1492  module_out_path = module_output_path
1493
1494  include_dirs = [
1495    ".",
1496    "mock/include",
1497    "/${services_path}/ans/include",
1498  ]
1499
1500  sources = [
1501    "${test_path}/mock/mock_tokenid_kit.cpp",
1502    "advanced_notification_service_test/advanced_notification_distributed_manager_service_test.cpp",
1503    "advanced_notification_service_test/advanced_notification_service_unit_test.cpp",
1504    "advanced_notification_service_test/advanced_notification_system_live_view_service_test.cpp",
1505    "distributed_device_status_test.cpp",
1506    "mock/mock_accesstoken_kit.cpp",
1507    "mock/mock_bundle_mgr.cpp",
1508    "mock/mock_datashare.cpp",
1509    "mock/mock_ipc.cpp",
1510    "mock/mock_push_callback_stub.cpp",
1511    "mock/mock_time_service_client.cpp",
1512  ]
1513
1514  defines = []
1515
1516  deps = [
1517    "${frameworks_module_ans_path}:ans_innerkits",
1518    "${services_path}/ans:libans",
1519  ]
1520
1521  if (distributed_notification_supported) {
1522    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
1523    deps += [ "${services_path}/distributed:libans_distributed" ]
1524    include_dirs += [ "${services_path}/distributed/include" ]
1525  }
1526
1527  if (notification_smart_reminder_supported) {
1528    defines += [ "NOTIFICATION_SMART_REMINDER_SUPPORTED" ]
1529  }
1530
1531  external_deps = [
1532    "ability_base:zuri",
1533    "access_token:libaccesstoken_sdk",
1534    "bundle_framework:appexecfwk_base",
1535    "bundle_framework:appexecfwk_core",
1536    "c_utils:utils",
1537    "data_share:datashare_common",
1538    "data_share:datashare_consumer",
1539    "ffrt:libffrt",
1540    "hilog:libhilog",
1541    "ipc:ipc_core",
1542    "kv_store:distributeddata_inner",
1543    "time_service:time_client",
1544  ]
1545
1546  subsystem_name = "${subsystem_name}"
1547  part_name = "${component_name}"
1548}
1549
1550ohos_unittest("common_utils_test") {
1551  sanitize = {
1552    integer_overflow = true
1553    ubsan = true
1554    boundary_sanitize = true
1555    cfi = true
1556    cfi_cross_dso = true
1557    debug = false
1558  }
1559
1560  module_out_path = module_output_path
1561
1562  include_dirs = [
1563    ".",
1564    "mock/include",
1565    "/${services_path}/ans/include",
1566  ]
1567
1568  sources = [
1569    "common_utils/notification_analytics_util_test.cpp",
1570    "mock/mock_common_event_manager.cpp",
1571  ]
1572
1573  defines = []
1574
1575  deps = [
1576    "${frameworks_module_ans_path}:ans_innerkits",
1577    "${services_path}/ans:libans",
1578  ]
1579
1580  external_deps = [
1581    "ability_base:zuri",
1582    "c_utils:utils",
1583    "ffrt:libffrt",
1584    "hilog:libhilog",
1585  ]
1586
1587  subsystem_name = "${subsystem_name}"
1588  part_name = "${component_name}"
1589}
1590
1591ohos_unittest("notification_extension_test") {
1592  sanitize = {
1593    integer_overflow = true
1594    ubsan = true
1595    boundary_sanitize = true
1596    cfi = true
1597    cfi_cross_dso = true
1598    debug = false
1599  }
1600
1601  module_out_path = module_output_path
1602
1603  include_dirs = [
1604    ".",
1605    "mock/include",
1606    "/${services_path}/ans/include",
1607    "/${services_path}/ans/include/utils",
1608    "/${services_path}/ans/include/notification_extension",
1609  ]
1610
1611  sources = [
1612    "notification_extension/device_manager_impl_mock.cpp",
1613    "notification_extension/distributed_collaboration_service_test.cpp",
1614    "notification_extension/distributed_device_data_service_test.cpp",
1615    "notification_extension/distributed_device_status_test.cpp",
1616    "notification_extension/distributed_extension_service_test.cpp",
1617    "notification_extension/mock_distributed_operation_callback.cpp",
1618    "notification_extension/notification_config_parse_mock.cpp",
1619    "notification_extension/notification_load_utils_mock.cpp",
1620    "notification_extension/notification_operation_service_test.cpp",
1621    "${services_path}/ans/src/access_token_helper.cpp",
1622    "${services_path}/ans/src/advanced_aggregation_data_roaming_observer.cpp",
1623    "${services_path}/ans/src/advanced_datashare_helper.cpp",
1624    "${services_path}/ans/src/advanced_datashare_helper_ext.cpp",
1625    "${services_path}/ans/src/advanced_datashare_observer.cpp",
1626    "${services_path}/ans/src/advanced_notification_manager/advanced_notification_cancel.cpp",
1627    "${services_path}/ans/src/advanced_notification_clone_service.cpp",
1628    "${services_path}/ans/src/advanced_notification_event_service.cpp",
1629    "${services_path}/ans/src/advanced_notification_flow_control_service.cpp",
1630    "${services_path}/ans/src/advanced_notification_inline.cpp",
1631    "${services_path}/ans/src/advanced_notification_live_view_service.cpp",
1632    "${services_path}/ans/src/advanced_notification_manager/advanced_notification_publish.cpp",
1633    "${services_path}/ans/src/advanced_notification_manager/advanced_notification_atomic_service_publish.cpp",
1634    "${services_path}/ans/src/advanced_notification_manager/advanced_notification_query.cpp",
1635    "${services_path}/ans/src/advanced_notification_publish/base_publish_process.cpp",
1636    "${services_path}/ans/src/advanced_notification_publish/common_notification_publish_process.cpp",
1637    "${services_path}/ans/src/advanced_notification_publish/live_publish_process.cpp",
1638    "${services_path}/ans/src/advanced_notification_publish_service.cpp",
1639    "${services_path}/ans/src/advanced_notification_reminder_service.cpp",
1640    "${services_path}/ans/src/advanced_notification_service.cpp",
1641    "${services_path}/ans/src/advanced_notification_service_ability.cpp",
1642    "${services_path}/ans/src/advanced_notification_slot_service.cpp",
1643    "${services_path}/ans/src/advanced_notification_subscriber_service.cpp",
1644    "${services_path}/ans/src/advanced_notification_utils.cpp",
1645    "${services_path}/ans/src/badge_manager/badge_manager.cpp",
1646    "${services_path}/ans/src/bundle_manager_helper.cpp",
1647    "${services_path}/ans/src/clone/dh_notification_clone_bundle_service.cpp",
1648    "${services_path}/ans/src/clone/notification_clone_bundle_info.cpp",
1649    "${services_path}/ans/src/clone/notification_clone_bundle_service.cpp",
1650    "${services_path}/ans/src/clone/notification_clone_disturb_service.cpp",
1651    "${services_path}/ans/src/clone/notification_clone_manager.cpp",
1652    "${services_path}/ans/src/clone/notification_clone_util.cpp",
1653    "${services_path}/ans/src/common/aes_gcm_helper.cpp",
1654    "${services_path}/ans/src/common/file_utils.cpp",
1655    "${services_path}/ans/src/common/notification_analytics_util.cpp",
1656    "${services_path}/ans/src/common/ans_status.cpp",
1657    "${services_path}/ans/src/common/notification_app_privileges.cpp",
1658    "${services_path}/ans/src/distributed_device_status.cpp",
1659    "${services_path}/ans/src/distributed_manager/advanced_notification_distributed_manager_service.cpp",
1660    "${services_path}/ans/src/disturb_manager/advanced_notification_disturb_manager_service.cpp",
1661    "${services_path}/ans/src/enable_manager/enable_manager.cpp",
1662    "${services_path}/ans/src/enable_manager/silent_reminder_manager.cpp",
1663    "${services_path}/ans/src/event_report.cpp",
1664    "${services_path}/ans/src/liveview_all_scenarios_extension_wrapper.cpp",
1665    "${services_path}/ans/src/notification_dialog.cpp",
1666    "${services_path}/ans/src/notification_dialog_manager.cpp",
1667    "${services_path}/ans/src/notification_extension/distributed_collaboration_service.cpp",
1668    "${services_path}/ans/src/notification_extension/distributed_device_data_service.cpp",
1669    "${services_path}/ans/src/notification_extension/distributed_device_manager.cpp",
1670    "${services_path}/ans/src/notification_extension/distributed_extension_service.cpp",
1671    "${services_path}/ans/src/notification_extension/notification_operation_service.cpp",
1672    "${services_path}/ans/src/notification_extension_wrapper.cpp",
1673    "${services_path}/ans/src/notification_local_live_view_subscriber_manager.cpp",
1674    "${services_path}/ans/src/notification_preferences.cpp",
1675    "${services_path}/ans/src/notification_preferences_database.cpp",
1676    "${services_path}/ans/src/notification_preferences_info.cpp",
1677    "${services_path}/ans/src/notification_rdb_data_mgr.cpp",
1678    "${services_path}/ans/src/notification_slot_filter.cpp",
1679    "${services_path}/ans/src/notification_smart_reminder/reminder_affected.cpp",
1680    "${services_path}/ans/src/notification_smart_reminder/smart_reminder_center.cpp",
1681    "${services_path}/ans/src/notification_smart_reminder/string_utils.cpp",
1682    "${services_path}/ans/src/notification_subscriber_manager.cpp",
1683    "${services_path}/ans/src/notification_timer_info.cpp",
1684    "${services_path}/ans/src/os_account_manager_helper.cpp",
1685    "${services_path}/ans/src/permission_filter.cpp",
1686    "${services_path}/ans/src/reminder_swing_decision_center.cpp",
1687    "${services_path}/ans/src/report_time_info.cpp",
1688    "${services_path}/ans/src/system_dialog_connect_stb.cpp",
1689    "${services_path}/ans/src/system_event_observer.cpp",
1690    "${services_path}/ans/src/system_live_view/advanced_notification_system_live_view_service.cpp",
1691    "${services_path}/ans/src/telephony_extension_wrapper.cpp",
1692  ]
1693
1694  defines = []
1695
1696  deps = [
1697    "${frameworks_module_ans_path}:ans_innerkits",
1698    "${frameworks_module_reminder_path}:reminder_innerkits",
1699  ]
1700
1701  external_deps = [
1702    "ability_base:configuration",
1703    "ability_runtime:ability_manager",
1704    "ability_runtime:app_manager",
1705    "ability_runtime:appkit_native",
1706    "ability_runtime:dataobs_manager",
1707    "ability_runtime:extension_manager",
1708    "ability_runtime:wantagent_innerkits",
1709    "access_token:libaccesstoken_sdk",
1710    "access_token:libtokenid_sdk",
1711    "bundle_framework:appexecfwk_base",
1712    "bundle_framework:appexecfwk_core",
1713    "c_utils:utils",
1714    "common_event_service:cesfwk_innerkits",
1715    "config_policy:configpolicy_util",
1716    "data_share:datashare_common",
1717    "data_share:datashare_consumer",
1718    "data_share:datashare_permission",
1719    "device_manager:devicemanagersdk",
1720    "ffrt:libffrt",
1721    "hilog:libhilog",
1722    "hitrace:hitrace_meter",
1723    "hitrace:libhitracechain",
1724    "i18n:intl_util",
1725    "image_framework:image_native",
1726    "init:libbegetutil",
1727    "ipc:ipc_single",
1728    "kv_store:distributeddata_inner",
1729    "openssl:libcrypto_shared",
1730    "os_account:os_account_innerkits",
1731    "relational_store:native_rdb",
1732    "resource_management:global_resmgr",
1733    "safwk:system_ability_fwk",
1734    "samgr:samgr_proxy",
1735    "time_service:time_client",
1736  ]
1737
1738  subsystem_name = "${subsystem_name}"
1739  part_name = "${component_name}"
1740}
1741
1742group("unittest") {
1743  testonly = true
1744  deps = [
1745    ":access_token_helper_test",
1746    ":advanced_datashare_observer_unit_test",
1747    ":advanced_notification_service_branch_test",
1748    ":advanced_notification_service_unit_test",
1749    ":ans_unit_test",
1750    ":bundle_manager_helper_branch_test",
1751    ":common_utils_test",
1752    ":notification_config_parse_test",
1753    ":notification_dialog_test",
1754    ":notification_extension_test",
1755    ":notification_extension_wrapper_unit_test",
1756    ":notification_preferences_database_branch_test",
1757    ":notification_preferences_database_test",
1758    ":notification_preferences_second_test",
1759    ":notification_preferences_test",
1760    ":notification_publish_service_test",
1761    ":notification_rdb_data_mgr_test",
1762    ":notification_service_publish_test",
1763    ":notification_service_test",
1764    ":notification_clone_test",
1765    ":notification_subscriber_manager_branch_test",
1766    ":notification_subscriber_manager_test",
1767    ":os_account_manager_helper_test",
1768    ":push_callback_stub_test",
1769  ]
1770}
1771