• 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 = "${component_name}/unittest"
19
20ohos_unittest("reminder_unit_test") {
21  module_out_path = module_output_path
22  include_dirs = [
23    ".",
24    "include",
25    "/${services_path}/ans/include",
26    "${services_path}/ans/test/unittest/mock/include",
27  ]
28
29  defines = []
30
31  sources = [
32    "mock/blob.cpp",
33    "mock/distributed_kv_data_manager.cpp",
34    "mock/mock_access_token_helper.cpp",
35    "mock/mock_bundle_manager_helper.cpp",
36    "mock/mock_event_handler.cpp",
37    "mock/mock_ipc.cpp",
38    "mock/mock_single_kv_store.cpp",
39    "reminder_data_manager_test.cpp",
40  ]
41
42  deps = [
43    "${frameworks_module_ans_path}:ans_innerkits",
44    "${services_path}/ans:libans",
45    "//third_party/googletest:gtest_main",
46  ]
47
48  if (distributed_notification_supported) {
49    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
50    deps += [ "${services_path}/distributed:libans_distributed" ]
51    include_dirs += [ "${services_path}/distributed/include" ]
52  }
53
54  external_deps = [
55    "ability_base:want",
56    "ability_base:zuri",
57    "ability_runtime:ability_manager",
58    "ability_runtime:abilitykit_native",
59    "ability_runtime:app_manager",
60    "ability_runtime:wantagent_innerkits",
61    "access_token:libaccesstoken_sdk",
62    "bundle_framework:appexecfwk_base",
63    "bundle_framework:appexecfwk_core",
64    "c_utils:utils",
65    "common_event_service:cesfwk_innerkits",
66    "data_share:datashare_common",
67    "data_share:datashare_consumer",
68    "device_manager:devicemanagersdk",
69    "eventhandler:libeventhandler",
70    "ffrt:libffrt",
71    "hilog:libhilog",
72    "hitrace:hitrace_meter",
73    "hitrace:libhitracechain",
74    "image_framework:image_native",
75    "ipc:ipc_core",
76    "kv_store:distributeddata_inner",
77    "os_account:os_account_innerkits",
78    "player_framework:media_client",
79    "relational_store:native_rdb",
80    "safwk:system_ability_fwk",
81    "samgr:samgr_proxy",
82    "time_service:time_client",
83  ]
84
85  if (device_usage) {
86    external_deps += [ "device_usage_statistics:usagestatsinner" ]
87    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
88  }
89
90  cflags = []
91  if (hisysevent_usage) {
92    external_deps += [ "hisysevent:libhisysevent" ]
93    cflags += [ "-DHAS_HISYSEVENT_PART" ]
94  }
95
96  subsystem_name = "${subsystem_name}"
97  part_name = "${component_name}"
98}
99
100ohos_unittest("ans_unit_test") {
101  module_out_path = module_output_path
102  include_dirs = [
103    ".",
104    "include",
105    "/${services_path}/ans/include",
106    "${services_path}/ans/test/unittest/mock/include",
107    "${services_path}/../framworks/core/include",
108  ]
109
110  defines = []
111
112  sources = [
113    "${test_path}/mock/mock_tokenid_kit.cpp",
114    "mock/blob.cpp",
115    "mock/distributed_kv_data_manager.cpp",
116    "mock/mock_access_token_helper.cpp",
117    "mock/mock_accesstoken_kit.cpp",
118    "mock/mock_bundle_manager_helper.cpp",
119    "mock/mock_event_handler.cpp",
120    "mock/mock_ipc.cpp",
121    "mock/mock_push_callback_stub.cpp",
122    "mock/mock_single_kv_store.cpp",
123    "mock/mock_swing_callback_stub.cpp",
124    "notification_dialog_test/mock_os_account_manager_annex.cpp",
125    "notification_hisysevent_test.cpp",
126    "notification_local_live_view_subscriber_manager_test.cpp",
127    "notification_slot_filter_test.cpp",
128    "permission_filter_test.cpp",
129    "reminder_swing_decision_center_test.cpp",
130  ]
131
132  deps = [
133    "${frameworks_module_ans_path}:ans_innerkits",
134    "${services_path}/ans:libans",
135    "//third_party/googletest:gmock_main",
136    "//third_party/googletest:gtest_main",
137  ]
138
139  if (distributed_notification_supported) {
140    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
141    deps += [ "${services_path}/distributed:libans_distributed" ]
142    include_dirs += [ "${services_path}/distributed/include" ]
143  }
144
145  external_deps = [
146    "ability_base:want",
147    "ability_base:zuri",
148    "ability_runtime:abilitykit_native",
149    "ability_runtime:app_manager",
150    "ability_runtime:wantagent_innerkits",
151    "access_token:libaccesstoken_sdk",
152    "bundle_framework:appexecfwk_base",
153    "bundle_framework:appexecfwk_core",
154    "c_utils:utils",
155    "common_event_service:cesfwk_innerkits",
156    "device_manager:devicemanagersdk",
157    "eventhandler:libeventhandler",
158    "ffrt:libffrt",
159    "hilog:libhilog",
160    "hitrace:hitrace_meter",
161    "hitrace:libhitracechain",
162    "image_framework:image_native",
163    "ipc:ipc_core",
164    "kv_store:distributeddata_inner",
165    "os_account:os_account_innerkits",
166    "player_framework:media_client",
167    "relational_store:native_rdb",
168    "safwk:system_ability_fwk",
169    "samgr:samgr_proxy",
170    "time_service:time_client",
171  ]
172
173  if (device_usage) {
174    external_deps += [ "device_usage_statistics:usagestatsinner" ]
175    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
176  }
177
178  cflags = []
179  if (hisysevent_usage) {
180    external_deps += [ "hisysevent:libhisysevent" ]
181    cflags += [ "-DHAS_HISYSEVENT_PART" ]
182  }
183
184  subsystem_name = "${subsystem_name}"
185  part_name = "${component_name}"
186}
187
188ohos_unittest("notification_preferences_database_test") {
189  module_out_path = module_output_path
190  include_dirs = [
191    ".",
192    "include",
193    "/${services_path}/ans/include",
194    "${services_path}/ans/test/unittest/mock/include",
195    "${services_path}/../framworks/core/include",
196  ]
197
198  defines = []
199
200  sources = [
201    "${test_path}/mock/mock_tokenid_kit.cpp",
202    "mock/blob.cpp",
203    "mock/distributed_kv_data_manager.cpp",
204    "mock/mock_access_token_helper.cpp",
205    "mock/mock_accesstoken_kit.cpp",
206    "mock/mock_bundle_manager_helper.cpp",
207    "mock/mock_event_handler.cpp",
208    "mock/mock_ipc.cpp",
209    "mock/mock_push_callback_stub.cpp",
210    "mock/mock_single_kv_store.cpp",
211    "mock/mock_swing_callback_stub.cpp",
212    "notification_preferences_database_test.cpp",
213  ]
214
215  deps = [
216    "${frameworks_module_ans_path}:ans_innerkits",
217    "${services_path}/ans:libans",
218    "//third_party/googletest:gmock_main",
219    "//third_party/googletest:gtest_main",
220  ]
221
222  if (distributed_notification_supported) {
223    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
224    deps += [ "${services_path}/distributed:libans_distributed" ]
225    include_dirs += [ "${services_path}/distributed/include" ]
226  }
227
228  external_deps = [
229    "ability_base:want",
230    "ability_base:zuri",
231    "ability_runtime:abilitykit_native",
232    "ability_runtime:app_manager",
233    "ability_runtime:wantagent_innerkits",
234    "access_token:libaccesstoken_sdk",
235    "bundle_framework:appexecfwk_base",
236    "bundle_framework:appexecfwk_core",
237    "c_utils:utils",
238    "common_event_service:cesfwk_innerkits",
239    "device_manager:devicemanagersdk",
240    "eventhandler:libeventhandler",
241    "ffrt:libffrt",
242    "hilog:libhilog",
243    "hitrace:hitrace_meter",
244    "hitrace:libhitracechain",
245    "image_framework:image_native",
246    "ipc:ipc_core",
247    "kv_store:distributeddata_inner",
248    "os_account:os_account_innerkits",
249    "player_framework:media_client",
250    "relational_store:native_rdb",
251    "safwk:system_ability_fwk",
252    "samgr:samgr_proxy",
253    "time_service:time_client",
254  ]
255
256  if (device_usage) {
257    external_deps += [ "device_usage_statistics:usagestatsinner" ]
258    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
259  }
260
261  cflags = []
262  if (hisysevent_usage) {
263    external_deps += [ "hisysevent:libhisysevent" ]
264    cflags += [ "-DHAS_HISYSEVENT_PART" ]
265  }
266
267  subsystem_name = "${subsystem_name}"
268  part_name = "${component_name}"
269}
270
271ohos_unittest("notification_subscriber_manager_test") {
272  module_out_path = module_output_path
273  include_dirs = [
274    ".",
275    "include",
276    "/${services_path}/ans/include",
277    "${services_path}/ans/test/unittest/mock/include",
278    "${services_path}/../framworks/core/include",
279  ]
280
281  defines = []
282
283  sources = [
284    "${test_path}/mock/mock_tokenid_kit.cpp",
285    "bundle_manager_helper_test.cpp",
286    "mock/blob.cpp",
287    "mock/distributed_kv_data_manager.cpp",
288    "mock/mock_access_token_helper.cpp",
289    "mock/mock_accesstoken_kit.cpp",
290    "mock/mock_bundle_manager_helper.cpp",
291    "mock/mock_event_handler.cpp",
292    "mock/mock_ipc.cpp",
293    "mock/mock_push_callback_stub.cpp",
294    "mock/mock_single_kv_store.cpp",
295    "mock/mock_swing_callback_stub.cpp",
296    "notification_subscriber_manager_test.cpp",
297  ]
298
299  deps = [
300    "${frameworks_module_ans_path}:ans_innerkits",
301    "${services_path}/ans:libans",
302    "//third_party/googletest:gmock_main",
303    "//third_party/googletest:gtest_main",
304  ]
305
306  if (distributed_notification_supported) {
307    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
308    deps += [ "${services_path}/distributed:libans_distributed" ]
309    include_dirs += [ "${services_path}/distributed/include" ]
310  }
311
312  external_deps = [
313    "ability_base:want",
314    "ability_base:zuri",
315    "ability_runtime:abilitykit_native",
316    "ability_runtime:app_manager",
317    "ability_runtime:wantagent_innerkits",
318    "access_token:libaccesstoken_sdk",
319    "bundle_framework:appexecfwk_base",
320    "bundle_framework:appexecfwk_core",
321    "c_utils:utils",
322    "common_event_service:cesfwk_innerkits",
323    "device_manager:devicemanagersdk",
324    "eventhandler:libeventhandler",
325    "ffrt:libffrt",
326    "hilog:libhilog",
327    "hitrace:hitrace_meter",
328    "hitrace:libhitracechain",
329    "image_framework:image_native",
330    "ipc:ipc_core",
331    "kv_store:distributeddata_inner",
332    "os_account:os_account_innerkits",
333    "player_framework:media_client",
334    "relational_store:native_rdb",
335    "safwk:system_ability_fwk",
336    "samgr:samgr_proxy",
337    "time_service:time_client",
338  ]
339
340  if (device_usage) {
341    external_deps += [ "device_usage_statistics:usagestatsinner" ]
342    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
343  }
344
345  cflags = []
346  if (hisysevent_usage) {
347    external_deps += [ "hisysevent:libhisysevent" ]
348    cflags += [ "-DHAS_HISYSEVENT_PART" ]
349  }
350
351  subsystem_name = "${subsystem_name}"
352  part_name = "${component_name}"
353}
354
355ohos_unittest("notification_service_test") {
356  sanitize = {
357    integer_overflow = true
358    ubsan = true
359    boundary_sanitize = true
360    cfi = true
361    cfi_cross_dso = true
362    debug = false
363  }
364  module_out_path = module_output_path
365  include_dirs = [
366    ".",
367    "include",
368    "/${services_path}/ans/include",
369    "${services_path}/ans/test/unittest/mock/include",
370  ]
371
372  defines = []
373
374  sources = [
375    "${test_path}/mock/mock_tokenid_kit.cpp",
376    "advanced_notification_live_view_service_test.cpp",
377    "advanced_notification_service_test.cpp",
378    "advanced_notification_slot_service_test.cpp",
379    "advanced_notification_utils_test.cpp",
380    "mock/blob.cpp",
381    "mock/distributed_kv_data_manager.cpp",
382    "mock/mock_access_token_helper.cpp",
383    "mock/mock_accesstoken_kit.cpp",
384    "mock/mock_bundle_manager_helper.cpp",
385    "mock/mock_bundle_mgr.cpp",
386    "mock/mock_event_handler.cpp",
387    "mock/mock_ipc.cpp",
388    "mock/mock_push_callback_stub.cpp",
389    "mock/mock_single_kv_store.cpp",
390    "notification_dialog_test/mock_os_account_manager_annex.cpp",
391  ]
392
393  deps = [
394    "${frameworks_module_ans_path}:ans_innerkits",
395    "${services_path}/ans:libans",
396    "//third_party/googletest:gtest_main",
397  ]
398
399  if (distributed_notification_supported) {
400    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
401    deps += [ "${services_path}/distributed:libans_distributed" ]
402    include_dirs += [ "${services_path}/distributed/include" ]
403  }
404
405  external_deps = [
406    "ability_base:base",
407    "ability_base:want",
408    "ability_base:zuri",
409    "ability_runtime:abilitykit_native",
410    "ability_runtime:app_manager",
411    "ability_runtime:wantagent_innerkits",
412    "access_token:libaccesstoken_sdk",
413    "bundle_framework:appexecfwk_base",
414    "bundle_framework:appexecfwk_core",
415    "c_utils:utils",
416    "common_event_service:cesfwk_innerkits",
417    "device_manager:devicemanagersdk",
418    "eventhandler:libeventhandler",
419    "ffrt:libffrt",
420    "hilog:libhilog",
421    "hitrace:hitrace_meter",
422    "hitrace:libhitracechain",
423    "image_framework:image_native",
424    "ipc:ipc_core",
425    "kv_store:distributeddata_inner",
426    "os_account:os_account_innerkits",
427    "player_framework:media_client",
428    "relational_store:native_rdb",
429    "safwk:system_ability_fwk",
430    "samgr:samgr_proxy",
431    "time_service:time_client",
432  ]
433
434  if (device_usage) {
435    external_deps += [ "device_usage_statistics:usagestatsinner" ]
436    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
437  }
438
439  cflags = []
440  if (hisysevent_usage) {
441    external_deps += [ "hisysevent:libhisysevent" ]
442    cflags += [ "-DHAS_HISYSEVENT_PART" ]
443  }
444
445  subsystem_name = "${subsystem_name}"
446  part_name = "${component_name}"
447}
448
449ohos_unittest("notification_publish_service_test") {
450  sanitize = {
451    integer_overflow = true
452    ubsan = true
453    boundary_sanitize = true
454    cfi = true
455    cfi_cross_dso = true
456    debug = false
457  }
458  module_out_path = module_output_path
459  include_dirs = [
460    ".",
461    "include",
462    "/${services_path}/ans/include",
463    "${services_path}/ans/test/unittest/mock/include",
464  ]
465
466  defines = []
467
468  sources = [
469    "${test_path}/mock/mock_tokenid_kit.cpp",
470    "advanced_notification_publish_service_test.cpp",
471    "mock/blob.cpp",
472    "mock/distributed_kv_data_manager.cpp",
473    "mock/mock_access_token_helper.cpp",
474    "mock/mock_accesstoken_kit.cpp",
475    "mock/mock_bundle_manager_helper.cpp",
476    "mock/mock_bundle_mgr.cpp",
477    "mock/mock_event_handler.cpp",
478    "mock/mock_ipc.cpp",
479    "mock/mock_push_callback_stub.cpp",
480    "mock/mock_single_kv_store.cpp",
481    "notification_dialog_test/mock_os_account_manager_annex.cpp",
482  ]
483
484  deps = [
485    "${frameworks_module_ans_path}:ans_innerkits",
486    "${services_path}/ans:libans",
487    "//third_party/googletest:gtest_main",
488  ]
489
490  if (distributed_notification_supported) {
491    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
492    deps += [ "${services_path}/distributed:libans_distributed" ]
493    include_dirs += [ "${services_path}/distributed/include" ]
494  }
495
496  external_deps = [
497    "ability_base:base",
498    "ability_base:want",
499    "ability_base:zuri",
500    "ability_runtime:ability_manager",
501    "ability_runtime:abilitykit_native",
502    "ability_runtime:app_manager",
503    "ability_runtime:wantagent_innerkits",
504    "access_token:libaccesstoken_sdk",
505    "bundle_framework:appexecfwk_base",
506    "bundle_framework:appexecfwk_core",
507    "c_utils:utils",
508    "common_event_service:cesfwk_innerkits",
509    "device_manager:devicemanagersdk",
510    "eventhandler:libeventhandler",
511    "ffrt:libffrt",
512    "hilog:libhilog",
513    "hitrace:hitrace_meter",
514    "hitrace:libhitracechain",
515    "image_framework:image_native",
516    "ipc:ipc_core",
517    "kv_store:distributeddata_inner",
518    "os_account:os_account_innerkits",
519    "player_framework:media_client",
520    "relational_store:native_rdb",
521    "safwk:system_ability_fwk",
522    "samgr:samgr_proxy",
523    "time_service:time_client",
524  ]
525
526  if (device_usage) {
527    external_deps += [ "device_usage_statistics:usagestatsinner" ]
528    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
529  }
530
531  cflags = []
532  if (hisysevent_usage) {
533    external_deps += [ "hisysevent:libhisysevent" ]
534    cflags += [ "-DHAS_HISYSEVENT_PART" ]
535  }
536
537  subsystem_name = "${subsystem_name}"
538  part_name = "${component_name}"
539}
540
541ohos_unittest("notification_service_publish_test") {
542  sanitize = {
543    integer_overflow = true
544    ubsan = true
545    boundary_sanitize = true
546    cfi = true
547    cfi_cross_dso = true
548    debug = false
549  }
550  module_out_path = module_output_path
551  include_dirs = [
552    ".",
553    "include",
554    "/${services_path}/ans/include",
555    "${services_path}/ans/test/unittest/mock/include",
556  ]
557
558  defines = []
559
560  sources = [
561    "${test_path}/mock/mock_tokenid_kit.cpp",
562    "advanced_notification_service_test/advanced_notification_service_publish_test.cpp",
563    "mock/blob.cpp",
564    "mock/distributed_kv_data_manager.cpp",
565    "mock/mock_access_token_helper.cpp",
566    "mock/mock_accesstoken_kit.cpp",
567    "mock/mock_bundle_manager_helper.cpp",
568    "mock/mock_bundle_mgr.cpp",
569    "mock/mock_event_handler.cpp",
570    "mock/mock_ipc.cpp",
571    "mock/mock_push_callback_stub.cpp",
572    "mock/mock_single_kv_store.cpp",
573    "notification_dialog_test/mock_os_account_manager_annex.cpp",
574  ]
575
576  deps = [
577    "${frameworks_module_ans_path}:ans_innerkits",
578    "${services_path}/ans:libans",
579    "//third_party/googletest:gtest_main",
580  ]
581
582  if (distributed_notification_supported) {
583    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
584    deps += [ "${services_path}/distributed:libans_distributed" ]
585    include_dirs += [ "${services_path}/distributed/include" ]
586  }
587
588  external_deps = [
589    "ability_base:base",
590    "ability_base:want",
591    "ability_base:zuri",
592    "ability_runtime:abilitykit_native",
593    "ability_runtime:app_manager",
594    "ability_runtime:wantagent_innerkits",
595    "access_token:libaccesstoken_sdk",
596    "bundle_framework:appexecfwk_base",
597    "bundle_framework:appexecfwk_core",
598    "c_utils:utils",
599    "common_event_service:cesfwk_innerkits",
600    "device_manager:devicemanagersdk",
601    "eventhandler:libeventhandler",
602    "ffrt:libffrt",
603    "hilog:libhilog",
604    "hitrace:hitrace_meter",
605    "hitrace:libhitracechain",
606    "image_framework:image_native",
607    "ipc:ipc_core",
608    "kv_store:distributeddata_inner",
609    "os_account:os_account_innerkits",
610    "player_framework:media_client",
611    "relational_store:native_rdb",
612    "safwk:system_ability_fwk",
613    "samgr:samgr_proxy",
614    "time_service:time_client",
615  ]
616
617  if (device_usage) {
618    external_deps += [ "device_usage_statistics:usagestatsinner" ]
619    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
620  }
621
622  cflags = []
623  if (hisysevent_usage) {
624    external_deps += [ "hisysevent:libhisysevent" ]
625    cflags += [ "-DHAS_HISYSEVENT_PART" ]
626  }
627
628  subsystem_name = "${subsystem_name}"
629  part_name = "${component_name}"
630}
631
632ohos_unittest("notification_preferences_test") {
633  module_out_path = module_output_path
634  include_dirs = [
635    ".",
636    "include",
637    "/${services_path}/ans/include",
638    "${services_path}/ans/test/unittest/mock/include",
639  ]
640
641  defines = []
642
643  sources = [
644    "${test_path}/mock/mock_tokenid_kit.cpp",
645    "advanced_notification_service_ability_test.cpp",
646    "mock/blob.cpp",
647    "mock/distributed_kv_data_manager.cpp",
648    "mock/mock_access_token_helper.cpp",
649    "mock/mock_accesstoken_kit.cpp",
650    "mock/mock_bundle_manager_helper.cpp",
651    "mock/mock_event_handler.cpp",
652    "mock/mock_ipc.cpp",
653    "mock/mock_push_callback_stub.cpp",
654    "mock/mock_single_kv_store.cpp",
655    "notification_preferences_info_test.cpp",
656    "notification_preferences_test.cpp",
657  ]
658
659  deps = [
660    "${frameworks_module_ans_path}:ans_innerkits",
661    "${services_path}/ans:libans",
662    "//third_party/googletest:gtest_main",
663  ]
664
665  if (distributed_notification_supported) {
666    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
667    deps += [ "${services_path}/distributed:libans_distributed" ]
668    include_dirs += [ "${services_path}/distributed/include" ]
669  }
670
671  external_deps = [
672    "ability_base:want",
673    "ability_base:zuri",
674    "ability_runtime:abilitykit_native",
675    "ability_runtime:app_manager",
676    "ability_runtime:wantagent_innerkits",
677    "access_token:libaccesstoken_sdk",
678    "bundle_framework:appexecfwk_base",
679    "bundle_framework:appexecfwk_core",
680    "c_utils:utils",
681    "common_event_service:cesfwk_innerkits",
682    "data_share:datashare_common",
683    "data_share:datashare_consumer",
684    "device_manager:devicemanagersdk",
685    "eventhandler:libeventhandler",
686    "ffrt:libffrt",
687    "hilog:libhilog",
688    "hitrace:hitrace_meter",
689    "hitrace:libhitracechain",
690    "image_framework:image_native",
691    "ipc:ipc_core",
692    "kv_store:distributeddata_inner",
693    "os_account:os_account_innerkits",
694    "player_framework:media_client",
695    "relational_store:native_rdb",
696    "safwk:system_ability_fwk",
697    "samgr:samgr_proxy",
698    "time_service:time_client",
699  ]
700
701  if (device_usage) {
702    external_deps += [ "device_usage_statistics:usagestatsinner" ]
703    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
704  }
705
706  cflags = []
707  if (hisysevent_usage) {
708    external_deps += [ "hisysevent:libhisysevent" ]
709    cflags += [ "-DHAS_HISYSEVENT_PART" ]
710  }
711
712  subsystem_name = "${subsystem_name}"
713  part_name = "${component_name}"
714}
715
716ohos_unittest("access_token_helper_test") {
717  module_out_path = module_output_path
718  include_dirs = [
719    ".",
720    "include",
721    "/${services_path}/ans/include",
722    "${services_path}/ans/test/unittest/mock/include",
723  ]
724
725  sources = [
726    "${services_path}/ans/src/access_token_helper.cpp",
727    "${services_path}/ans/test/unittest/mock/mock_accesstoken_kit.cpp",
728    "${services_path}/ans/test/unittest/mock/mock_notification_analytics_util.cpp",
729    "${test_path}/mock/mock_tokenid_kit.cpp",
730    "access_token_helper_test/access_token_helper_test.cpp",
731  ]
732
733  deps = [ "${frameworks_module_ans_path}:ans_innerkits" ]
734
735  external_deps = [
736    "ability_base:want",
737    "ability_base:zuri",
738    "ability_runtime:abilitykit_native",
739    "ability_runtime:app_manager",
740    "ability_runtime:wantagent_innerkits",
741    "access_token:libaccesstoken_sdk",
742    "access_token:libtokenid_sdk",
743    "bundle_framework:appexecfwk_base",
744    "bundle_framework:appexecfwk_core",
745    "c_utils:utils",
746    "common_event_service:cesfwk_innerkits",
747    "eventhandler:libeventhandler",
748    "hilog:libhilog",
749    "hitrace:hitrace_meter",
750    "hitrace:libhitracechain",
751    "image_framework:image_native",
752    "init:libbegetutil",
753    "ipc:ipc_core",
754    "kv_store:distributeddata_inner",
755    "os_account:os_account_innerkits",
756    "player_framework:media_client",
757    "relational_store:native_rdb",
758    "safwk:system_ability_fwk",
759    "samgr:samgr_proxy",
760    "time_service:time_client",
761  ]
762
763  subsystem_name = "${subsystem_name}"
764  part_name = "${component_name}"
765}
766
767ohos_unittest("bundle_manager_helper_branch_test") {
768  module_out_path = module_output_path
769  include_dirs = [
770    ".",
771    "include",
772    "/${services_path}/ans/include",
773    "${services_path}/ans/test/unittest/mock/include",
774  ]
775
776  sources = [
777    "bundle_manager_helper_branch_test/bundle_manager_helper_branch_test.cpp",
778    "bundle_manager_helper_branch_test/mock_service_registry.cpp",
779  ]
780
781  deps = [
782    "${frameworks_module_ans_path}:ans_innerkits",
783    "${services_path}/ans:libans",
784    "//third_party/googletest:gtest_main",
785  ]
786
787  external_deps = [
788    "ability_base:want",
789    "ability_base:zuri",
790    "ability_runtime:abilitykit_native",
791    "ability_runtime:app_manager",
792    "ability_runtime:wantagent_innerkits",
793    "access_token:libaccesstoken_sdk",
794    "bundle_framework:appexecfwk_base",
795    "bundle_framework:appexecfwk_core",
796    "c_utils:utils",
797    "common_event_service:cesfwk_innerkits",
798    "eventhandler:libeventhandler",
799    "hilog:libhilog",
800    "hitrace:hitrace_meter",
801    "hitrace:libhitracechain",
802    "image_framework:image_native",
803    "ipc:ipc_core",
804    "kv_store:distributeddata_inner",
805    "os_account:os_account_innerkits",
806    "player_framework:media_client",
807    "relational_store:native_rdb",
808    "safwk:system_ability_fwk",
809    "samgr:samgr_proxy",
810    "time_service:time_client",
811  ]
812
813  subsystem_name = "${subsystem_name}"
814  part_name = "${component_name}"
815}
816
817ohos_unittest("notification_dialog_test") {
818  module_out_path = module_output_path
819  include_dirs = [
820    ".",
821    "include",
822    "/${services_path}/ans/include",
823    "${services_path}/ans/test/unittest/mock/include",
824  ]
825
826  sources = [
827    "notification_dialog_test/mock_os_account_manager_annex.cpp",
828    "notification_dialog_test/notification_dialog_test.cpp",
829  ]
830
831  deps = [
832    "${frameworks_module_ans_path}:ans_innerkits",
833    "${services_path}/ans:libans",
834    "//third_party/googletest:gtest_main",
835  ]
836
837  external_deps = [
838    "ability_base:want",
839    "ability_base:zuri",
840    "ability_runtime:abilitykit_native",
841    "ability_runtime:app_manager",
842    "ability_runtime:wantagent_innerkits",
843    "access_token:libaccesstoken_sdk",
844    "bundle_framework:appexecfwk_base",
845    "bundle_framework:appexecfwk_core",
846    "c_utils:utils",
847    "common_event_service:cesfwk_innerkits",
848    "eventhandler:libeventhandler",
849    "ffrt:libffrt",
850    "hilog:libhilog",
851    "hitrace:hitrace_meter",
852    "hitrace:libhitracechain",
853    "image_framework:image_native",
854    "ipc:ipc_core",
855    "kv_store:distributeddata_inner",
856    "os_account:os_account_innerkits",
857    "player_framework:media_client",
858    "relational_store:native_rdb",
859    "safwk:system_ability_fwk",
860    "samgr:samgr_proxy",
861    "time_service:time_client",
862  ]
863
864  subsystem_name = "${subsystem_name}"
865  part_name = "${component_name}"
866}
867
868ohos_unittest("notification_subscriber_manager_branch_test") {
869  module_out_path = module_output_path
870  include_dirs = [
871    ".",
872    "include",
873    "/${services_path}/ans/include",
874    "${services_path}/ans/test/unittest/mock/include",
875    "${ffrt_path}/interfaces/kits",
876  ]
877
878  defines = []
879
880  sources = [
881    "${test_path}/mock/mock_tokenid_kit.cpp",
882    "mock/mock_accesstoken_kit.cpp",
883    "mock/mock_bundle_manager_helper.cpp",
884    "mock/mock_ipc.cpp",
885    "notification_dialog_test/mock_os_account_manager_annex.cpp",
886    "notification_subscriber_manager_branch_test/mock_access_token_helper.cpp",
887    "notification_subscriber_manager_branch_test/mock_notification.cpp",
888    "notification_subscriber_manager_branch_test/mock_notification_preferences.cpp",
889    "notification_subscriber_manager_branch_test/notification_subscriber_manager_branch_test.cpp",
890  ]
891
892  deps = [
893    "${frameworks_module_ans_path}:ans_innerkits",
894    "${services_path}/ans:libans",
895    "//third_party/googletest:gtest_main",
896  ]
897
898  if (distributed_notification_supported) {
899    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
900    deps += [ "${services_path}/distributed:libans_distributed" ]
901    include_dirs += [ "${services_path}/distributed/include" ]
902  }
903
904  external_deps = [
905    "ability_base:want",
906    "ability_base:zuri",
907    "ability_runtime:abilitykit_native",
908    "ability_runtime:app_manager",
909    "ability_runtime:wantagent_innerkits",
910    "access_token:libaccesstoken_sdk",
911    "bundle_framework:appexecfwk_base",
912    "bundle_framework:appexecfwk_core",
913    "c_utils:utils",
914    "common_event_service:cesfwk_innerkits",
915    "eventhandler:libeventhandler",
916    "ffrt:libffrt",
917    "hilog:libhilog",
918    "hitrace:hitrace_meter",
919    "hitrace:libhitracechain",
920    "image_framework:image_native",
921    "ipc:ipc_core",
922    "kv_store:distributeddata_inner",
923    "os_account:os_account_innerkits",
924    "player_framework:media_client",
925    "relational_store:native_rdb",
926    "safwk:system_ability_fwk",
927    "samgr:samgr_proxy",
928    "time_service:time_client",
929  ]
930
931  subsystem_name = "${subsystem_name}"
932  part_name = "${component_name}"
933}
934
935ohos_unittest("advanced_notification_service_branch_test") {
936  module_out_path = module_output_path
937  include_dirs = [
938    ".",
939    "include",
940    "/${services_path}/ans/include",
941    "${services_path}/ans/test/unittest/mock/include",
942    "${ffrt_path}/interfaces/kits",
943  ]
944
945  defines = []
946
947  sources = [
948    "${test_path}/mock/mock_tokenid_kit.cpp",
949    "advanced_notification_service_branch_test.cpp",
950    "mock/blob.cpp",
951    "mock/distributed_kv_data_manager.cpp",
952    "mock/mock_accesstoken_kit.cpp",
953    "mock/mock_advanced_notification_service.cpp",
954    "mock/mock_bundle_manager_helper.cpp",
955    "mock/mock_bundle_mgr.cpp",
956    "mock/mock_event_handler.cpp",
957    "mock/mock_ipc.cpp",
958    "mock/mock_single_kv_store.cpp",
959    "notification_dialog_test/mock_os_account_manager_annex.cpp",
960    "notification_subscriber_manager_branch_test/mock_access_token_helper.cpp",
961  ]
962
963  deps = [
964    "${frameworks_module_ans_path}:ans_innerkits",
965    "${services_path}/ans:libans",
966    "//third_party/googletest:gtest_main",
967  ]
968
969  if (distributed_notification_supported) {
970    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
971    deps += [ "${services_path}/distributed:libans_distributed" ]
972    include_dirs += [ "${services_path}/distributed/include" ]
973  }
974
975  external_deps = [
976    "ability_base:want",
977    "ability_base:zuri",
978    "ability_runtime:abilitykit_native",
979    "ability_runtime:app_manager",
980    "ability_runtime:wantagent_innerkits",
981    "access_token:libaccesstoken_sdk",
982    "bundle_framework:appexecfwk_base",
983    "bundle_framework:appexecfwk_core",
984    "c_utils:utils",
985    "common_event_service:cesfwk_innerkits",
986    "eventhandler:libeventhandler",
987    "ffrt:libffrt",
988    "hilog:libhilog",
989    "hitrace:hitrace_meter",
990    "hitrace:libhitracechain",
991    "image_framework:image_native",
992    "ipc:ipc_core",
993    "kv_store:distributeddata_inner",
994    "os_account:os_account_innerkits",
995    "player_framework:media_client",
996    "relational_store:native_rdb",
997    "safwk:system_ability_fwk",
998    "samgr:samgr_proxy",
999    "time_service:time_client",
1000  ]
1001
1002  subsystem_name = "${subsystem_name}"
1003  part_name = "${component_name}"
1004}
1005
1006ohos_unittest("notification_preferences_database_branch_test") {
1007  module_out_path = module_output_path
1008  include_dirs = [
1009    ".",
1010    "include",
1011    "/${services_path}/ans/include",
1012    "${services_path}/ans/test/unittest/mock/include",
1013    "${ffrt_path}/interfaces/kits",
1014  ]
1015
1016  sources = [
1017    "${services_path}/ans/src/bundle_manager_helper.cpp",
1018    "${services_path}/ans/src/common/notification_config_parse.cpp",
1019    "${services_path}/ans/src/notification_preferences_database.cpp",
1020    "${services_path}/ans/src/notification_preferences_info.cpp",
1021    "${services_path}/ans/src/os_account_manager_helper.cpp",
1022    "${services_path}/ans/test/unittest/mock/mock_notification_analytics_util.cpp",
1023    "notification_dialog_test/mock_os_account_manager_annex.cpp",
1024    "notification_preferences_database_branch_test/mock_notification_rdb_data_mgr.cpp",
1025    "notification_preferences_database_branch_test/notification_preferences_database_branch_test.cpp",
1026  ]
1027
1028  deps = [
1029    "${frameworks_module_ans_path}:ans_innerkits",
1030    "//third_party/googletest:gtest_main",
1031    "//third_party/libxml2:libxml2",
1032  ]
1033
1034  external_deps = [
1035    "ability_base:want",
1036    "ability_base:zuri",
1037    "ability_runtime:abilitykit_native",
1038    "ability_runtime:app_manager",
1039    "ability_runtime:wantagent_innerkits",
1040    "access_token:libaccesstoken_sdk",
1041    "bundle_framework:appexecfwk_base",
1042    "bundle_framework:appexecfwk_core",
1043    "c_utils:utils",
1044    "common_event_service:cesfwk_innerkits",
1045    "eventhandler:libeventhandler",
1046    "hilog:libhilog",
1047    "hitrace:hitrace_meter",
1048    "hitrace:libhitracechain",
1049    "image_framework:image_native",
1050    "ipc:ipc_core",
1051    "kv_store:distributeddata_inner",
1052    "os_account:os_account_innerkits",
1053    "player_framework:media_client",
1054    "relational_store:native_rdb",
1055    "safwk:system_ability_fwk",
1056    "samgr:samgr_proxy",
1057    "time_service:time_client",
1058  ]
1059
1060  subsystem_name = "${subsystem_name}"
1061  part_name = "${component_name}"
1062}
1063
1064ohos_unittest("push_callback_stub_test") {
1065  module_out_path = module_output_path
1066  include_dirs = [
1067    ".",
1068    "include",
1069    "/${services_path}/ans/include",
1070  ]
1071
1072  sources = [ "push_callback_stub_test.cpp" ]
1073
1074  deps = [
1075    "${frameworks_module_ans_path}:ans_innerkits",
1076    "${services_path}/ans:libans",
1077    "//third_party/googletest:gtest_main",
1078  ]
1079
1080  external_deps = [
1081    "ability_base:want",
1082    "ability_base:zuri",
1083    "ability_runtime:abilitykit_native",
1084    "ability_runtime:app_manager",
1085    "ability_runtime:wantagent_innerkits",
1086    "access_token:libaccesstoken_sdk",
1087    "bundle_framework:appexecfwk_base",
1088    "bundle_framework:appexecfwk_core",
1089    "c_utils:utils",
1090    "common_event_service:cesfwk_innerkits",
1091    "eventhandler:libeventhandler",
1092    "hilog:libhilog",
1093    "hitrace:hitrace_meter",
1094    "hitrace:libhitracechain",
1095    "image_framework:image_native",
1096    "ipc:ipc_core",
1097    "kv_store:distributeddata_inner",
1098    "os_account:os_account_innerkits",
1099    "player_framework:media_client",
1100    "relational_store:native_rdb",
1101    "safwk:system_ability_fwk",
1102    "samgr:samgr_proxy",
1103    "time_service:time_client",
1104  ]
1105
1106  subsystem_name = "${subsystem_name}"
1107  part_name = "${component_name}"
1108}
1109
1110ohos_unittest("notification_rdb_data_mgr_test") {
1111  module_out_path = module_output_path
1112  include_dirs = [
1113    ".",
1114    "include",
1115    "/${services_path}/ans/include",
1116    "${services_path}/ans/test/unittest/mock/include",
1117  ]
1118
1119  sources = [
1120    "notification_rdb_data_mgr_test/mock_abs_result_set.cpp",
1121    "notification_rdb_data_mgr_test/mock_abs_shared_result_set.cpp",
1122    "notification_rdb_data_mgr_test/mock_rdb_helper.cpp",
1123    "notification_rdb_data_mgr_test/notification_rdb_data_mgr_test.cpp",
1124  ]
1125
1126  deps = [
1127    "${frameworks_module_ans_path}:ans_innerkits",
1128    "${services_path}/ans:libans",
1129    "//third_party/googletest:gtest_main",
1130  ]
1131
1132  external_deps = [
1133    "ability_base:want",
1134    "ability_base:zuri",
1135    "ability_runtime:abilitykit_native",
1136    "ability_runtime:app_manager",
1137    "ability_runtime:wantagent_innerkits",
1138    "access_token:libaccesstoken_sdk",
1139    "bundle_framework:appexecfwk_base",
1140    "bundle_framework:appexecfwk_core",
1141    "c_utils:utils",
1142    "common_event_service:cesfwk_innerkits",
1143    "eventhandler:libeventhandler",
1144    "hilog:libhilog",
1145    "hitrace:hitrace_meter",
1146    "hitrace:libhitracechain",
1147    "image_framework:image_native",
1148    "ipc:ipc_core",
1149    "kv_store:distributeddata_inner",
1150    "os_account:os_account_innerkits",
1151    "player_framework:media_client",
1152    "relational_store:native_rdb",
1153    "safwk:system_ability_fwk",
1154    "samgr:samgr_proxy",
1155    "time_service:time_client",
1156  ]
1157
1158  subsystem_name = "${subsystem_name}"
1159  part_name = "${component_name}"
1160}
1161
1162ohos_unittest("notification_config_parse_test") {
1163  module_out_path = module_output_path
1164  include_dirs = [
1165    ".",
1166    "include",
1167    "/${services_path}/ans/include",
1168    "${services_path}/ans/test/unittest/mock/include",
1169  ]
1170
1171  sources = [ "notification_config_parse_test.cpp" ]
1172
1173  deps = [
1174    "${frameworks_module_ans_path}:ans_innerkits",
1175    "${services_path}/ans:libans",
1176    "//third_party/googletest:gtest_main",
1177    "//third_party/libxml2:libxml2",
1178  ]
1179
1180  external_deps = [
1181    "ability_base:want",
1182    "ability_base:zuri",
1183    "ability_runtime:abilitykit_native",
1184    "ability_runtime:app_manager",
1185    "ability_runtime:wantagent_innerkits",
1186    "access_token:libaccesstoken_sdk",
1187    "bundle_framework:appexecfwk_base",
1188    "bundle_framework:appexecfwk_core",
1189    "c_utils:utils",
1190    "common_event_service:cesfwk_innerkits",
1191    "eventhandler:libeventhandler",
1192    "hilog:libhilog",
1193    "hitrace:hitrace_meter",
1194    "hitrace:libhitracechain",
1195    "image_framework:image_native",
1196    "ipc:ipc_core",
1197    "kv_store:distributeddata_inner",
1198    "os_account:os_account_innerkits",
1199    "player_framework:media_client",
1200    "relational_store:native_rdb",
1201    "safwk:system_ability_fwk",
1202    "samgr:samgr_proxy",
1203    "time_service:time_client",
1204  ]
1205}
1206
1207ohos_unittest("os_account_manager_helper_test") {
1208  module_out_path = module_output_path
1209  include_dirs = [
1210    ".",
1211    "include",
1212    "/${services_path}/ans/include",
1213    "${services_path}/ans/test/unittest/mock/include",
1214  ]
1215
1216  sources = [ "os_account_manager_helper_test.cpp" ]
1217
1218  deps = [
1219    "${frameworks_module_ans_path}:ans_innerkits",
1220    "${services_path}/ans:libans",
1221    "//third_party/googletest:gtest_main",
1222  ]
1223
1224  external_deps = [
1225    "ability_base:want",
1226    "ability_base:zuri",
1227    "ability_runtime:abilitykit_native",
1228    "ability_runtime:app_manager",
1229    "ability_runtime:wantagent_innerkits",
1230    "access_token:libaccesstoken_sdk",
1231    "bundle_framework:appexecfwk_base",
1232    "bundle_framework:appexecfwk_core",
1233    "c_utils:utils",
1234    "common_event_service:cesfwk_innerkits",
1235    "eventhandler:libeventhandler",
1236    "hilog:libhilog",
1237    "hitrace:hitrace_meter",
1238    "hitrace:libhitracechain",
1239    "image_framework:image_native",
1240    "ipc:ipc_core",
1241    "kv_store:distributeddata_inner",
1242    "os_account:os_account_innerkits",
1243    "player_framework:media_client",
1244    "relational_store:native_rdb",
1245    "safwk:system_ability_fwk",
1246    "samgr:samgr_proxy",
1247    "time_service:time_client",
1248  ]
1249
1250  subsystem_name = "${subsystem_name}"
1251  part_name = "${component_name}"
1252}
1253
1254group("unittest") {
1255  testonly = true
1256  deps = [
1257    ":access_token_helper_test",
1258    ":advanced_notification_service_branch_test",
1259    ":ans_unit_test",
1260    ":bundle_manager_helper_branch_test",
1261    ":notification_config_parse_test",
1262    ":notification_dialog_test",
1263    ":notification_preferences_database_branch_test",
1264    ":notification_preferences_database_test",
1265    ":notification_preferences_test",
1266    ":notification_publish_service_test",
1267    ":notification_rdb_data_mgr_test",
1268    ":notification_service_publish_test",
1269    ":notification_service_test",
1270    ":notification_subscriber_manager_branch_test",
1271    ":notification_subscriber_manager_test",
1272    ":os_account_manager_helper_test",
1273    ":push_callback_stub_test",
1274    ":reminder_unit_test",
1275  ]
1276}
1277