1# Copyright (c) 2022 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.
13import("//build/test.gni")
14import("../../../../bluetooth_part.gni")
15import("../../../../castplus_cast_engine_part.gni")
16import("../../../../config.gni")
17import("../../../../efficiency_manager_part.gni")
18
19module_output_path = "multimedia_av_session/session"
20
21###############################################################################
22config("module_private_config") {
23  visibility = [ ":*" ]
24
25  include_dirs = [
26    "../../ipc/base/",
27    "../../ipc/proxy/",
28    "../../ipc/stub/",
29    "../../server/",
30    "../../server/migrate/",
31    "../../server/softbus/",
32    "../../server/remote/",
33    "../../../../interfaces/inner_api/native/session/include/",
34    "../../../../frameworks/native/session/include",
35    "../../adapter/",
36    "../../../../utils/include/",
37    "../",
38    "../remote",
39    "//third_party/json/single_include",
40    "$commontype_dir/include",
41  ]
42}
43
44config("common_config") {
45  visibility = [ ":*" ]
46  if (castplus_cast_engine_enable) {
47    cflags = [ "-DCASTPLUS_CAST_ENGINE_ENABLE" ]
48  }
49}
50
51common_deps = [
52  "../../../../frameworks/common:avsession_common",
53  "../../../../frameworks/native/session:avsession_client",
54  "../../../../utils:avsession_utils",
55  "../../../session:avsession_item",
56  "../../../session:avsession_service",
57  "//third_party/bounds_checking_function:libsec_shared",
58  "//third_party/googletest:gtest_main",
59  "//third_party/openssl:libcrypto_shared",
60]
61
62common_external_deps = [
63  "ability_base:want",
64  "ability_runtime:wantagent_innerkits",
65  "access_token:libaccesstoken_sdk",
66  "access_token:libnativetoken",
67  "access_token:libtoken_setproc",
68  "audio_framework:audio_client",
69  "background_task_mgr:bgtaskmgr_innerkits",
70  "c_utils:utils",
71  "device_manager:devicemanagersdk",
72  "dsoftbus:softbus_client",
73  "hilog:libhilog",
74  "image_framework:image_native",
75  "input:libmmi-client",
76  "ipc:ipc_single",
77  "jsoncpp:jsoncpp",
78  "samgr:samgr_proxy",
79]
80
81ohos_unittest("AVSessionServiceSupplementTest") {
82  module_out_path = module_output_path
83
84  sources = [ "avsession_service_supplement_test.cpp" ]
85
86  configs = [ ":module_private_config" ]
87
88  cflags_cc = [ "-fno-access-control" ]
89
90  deps = common_deps
91
92  external_deps = common_external_deps
93
94  if (castplus_cast_engine_enable) {
95    cflags_cc += [ "-DCASTPLUS_CAST_ENGINE_ENABLE" ]
96    deps += [
97      "../../../../frameworks/native/session:avsession_cast_client",
98      "../../../../services/session:avsession_cast_item",
99      "../../../../services/session:avsession_router",
100    ]
101    external_deps += [
102      "CollaborationFwk:cfwk_allconnect_client",
103      "CollaborationFwk:collaborationfwk_client",
104      "cast_engine:cast_engine_client",
105    ]
106  }
107}
108
109ohos_unittest("DetectBluetoothHostObserverTest") {
110  module_out_path = module_output_path
111
112  sources = [ "detect_bluetooth_host_observer_test.cpp" ]
113
114  configs = [ ":module_private_config" ]
115
116  cflags_cc = [ "--coverage" ]
117
118  ldflags = [ "--coverage" ]
119
120  deps = common_deps
121
122  external_deps = common_external_deps
123
124  if (bluetooth_part_enable) {
125    cflags_cc += [ "-DBLUETOOTH_ENABLE" ]
126    external_deps += [ "bluetooth:btframework" ]
127  }
128}
129
130ohos_unittest("RemoteSessionSinkTest") {
131  module_out_path = module_output_path
132
133  sources = [ "remote_session_sink_test.cpp" ]
134
135  configs = [ ":module_private_config" ]
136
137  cflags_cc = [
138    "--coverage",
139    "-fno-access-control",
140  ]
141
142  ldflags = [ "--coverage" ]
143
144  deps = common_deps
145
146  external_deps = common_external_deps
147
148  external_deps += [ "data_object:distributeddataobject_impl" ]
149
150  if (bluetooth_part_enable) {
151    cflags_cc += [ "-DBLUETOOTH_ENABLE" ]
152    external_deps += [ "bluetooth:btframework" ]
153  }
154
155  if (castplus_cast_engine_enable) {
156    cflags_cc += [ "-DCASTPLUS_CAST_ENGINE_ENABLE" ]
157    deps += [
158      "../../../../frameworks/native/session:avsession_cast_client",
159      "../../../../services/session:avsession_cast_item",
160      "../../../../services/session:avsession_router",
161    ]
162    external_deps += [
163      "CollaborationFwk:cfwk_allconnect_client",
164      "CollaborationFwk:collaborationfwk_client",
165      "cast_engine:cast_engine_client",
166    ]
167  }
168}
169
170ohos_unittest("RemoteSessionSourceTest") {
171  module_out_path = module_output_path
172
173  sources = [ "remote_session_source_test.cpp" ]
174
175  configs = [ ":module_private_config" ]
176
177  cflags_cc = [
178    "--coverage",
179    "-fno-access-control",
180  ]
181
182  ldflags = [ "--coverage" ]
183
184  deps = common_deps
185
186  external_deps = common_external_deps
187
188  external_deps += [ "data_object:distributeddataobject_impl" ]
189
190  if (bluetooth_part_enable) {
191    cflags_cc += [ "-DBLUETOOTH_ENABLE" ]
192    external_deps += [ "bluetooth:btframework" ]
193  }
194
195  if (castplus_cast_engine_enable) {
196    cflags_cc += [ "-DCASTPLUS_CAST_ENGINE_ENABLE" ]
197    deps += [
198      "../../../../frameworks/native/session:avsession_cast_client",
199      "../../../../services/session:avsession_cast_item",
200      "../../../../services/session:avsession_router",
201    ]
202    external_deps += [
203      "CollaborationFwk:cfwk_allconnect_client",
204      "CollaborationFwk:collaborationfwk_client",
205      "cast_engine:cast_engine_client",
206    ]
207  }
208}
209
210ohos_unittest("JsonUtilsTest") {
211  module_out_path = module_output_path
212
213  sources = [ "json_utils_test.cpp" ]
214
215  configs = [ ":module_private_config" ]
216
217  cflags_cc = [
218    "--coverage",
219    "-fno-access-control",
220  ]
221
222  ldflags = [ "--coverage" ]
223
224  deps = common_deps
225
226  external_deps = common_external_deps
227}
228
229ohos_unittest("FocusSessionStrategyTest") {
230  module_out_path = module_output_path
231
232  sources = [ "focus_session_strategy_test.cpp" ]
233
234  configs = [ ":module_private_config" ]
235
236  cflags_cc = [
237    "--coverage",
238    "-fno-access-control",
239  ]
240
241  ldflags = [ "--coverage" ]
242
243  deps = common_deps
244
245  external_deps = common_external_deps
246}
247
248ohos_unittest("CollaborationManagerTest") {
249  module_out_path = module_output_path
250
251  sources = [ "collaboration_manager_test.cpp" ]
252
253  configs = [ ":module_private_config" ]
254
255  cflags_cc = [
256    "--coverage",
257    "-fno-access-control",
258  ]
259
260  ldflags = [ "--coverage" ]
261
262  deps = common_deps
263
264  external_deps = common_external_deps
265}
266
267ohos_unittest("ParamsConfigOperatorTest") {
268  module_out_path = module_output_path
269
270  sources = [ "params_config_operator_test.cpp" ]
271
272  configs = [ ":module_private_config" ]
273
274  cflags_cc = [ "--coverage" ]
275
276  ldflags = [ "--coverage" ]
277
278  deps = common_deps
279
280  external_deps = common_external_deps
281}
282
283ohos_unittest("HashCalculatorTest") {
284  module_out_path = module_output_path
285
286  sources = [ "hash_calculator_test.cpp" ]
287
288  configs = [ ":module_private_config" ]
289
290  cflags_cc = [ "--coverage" ]
291
292  ldflags = [ "--coverage" ]
293
294  deps = common_deps
295
296  external_deps = common_external_deps
297}
298
299ohos_unittest("AVSessionDynamicLoaderTest") {
300  module_out_path = module_output_path
301
302  sources = [ "avsession_dynamic_loader_test.cpp" ]
303
304  configs = [ ":module_private_config" ]
305
306  cflags_cc = [ "--coverage" ]
307
308  ldflags = [ "--coverage" ]
309
310  deps = common_deps
311
312  external_deps = common_external_deps
313}
314
315ohos_unittest("AVsessionSyseventTest") {
316  module_out_path = module_output_path
317
318  sources = [ "avsession_sysevent_test.cpp" ]
319
320  configs = [ ":module_private_config" ]
321
322  cflags_cc = [
323    "--coverage",
324    "-fno-access-control",
325  ]
326
327  ldflags = [ "--coverage" ]
328
329  deps = common_deps
330
331  external_deps = common_external_deps
332
333  if (multimedia_av_session_enable_sysevent_control) {
334    cflags_cc += [ "-DENABLE_AVSESSION_SYSEVENT_CONTROL" ]
335    external_deps += [ "hisysevent:libhisysevent" ]
336  }
337}
338
339ohos_unittest("PermissionCheckerTest") {
340  module_out_path = module_output_path
341
342  sources = [ "permission_checker_test.cpp" ]
343
344  configs = [ ":module_private_config" ]
345
346  cflags_cc = [ "--coverage" ]
347
348  ldflags = [ "--coverage" ]
349
350  deps = common_deps
351
352  external_deps = common_external_deps
353}
354
355ohos_unittest("CommandSendLimitTest") {
356  module_out_path = module_output_path
357
358  sources = [ "command_send_limit_test.cpp" ]
359
360  configs = [ ":module_private_config" ]
361
362  cflags_cc = [ "--coverage" ]
363
364  ldflags = [ "--coverage" ]
365
366  deps = common_deps
367
368  external_deps = common_external_deps
369}
370
371ohos_unittest("AVSessionServiceProxyTest") {
372  module_out_path = module_output_path
373
374  sources = [ "avsession_service_proxy_test.cpp" ]
375
376  configs = [ ":module_private_config" ]
377
378  cflags_cc = [ "--coverage" ]
379
380  ldflags = [ "--coverage" ]
381
382  deps = common_deps
383
384  external_deps = common_external_deps
385}
386
387ohos_unittest("AVSessionServiceStubPermissionTest") {
388  module_out_path = module_output_path
389
390  sources = [ "avsession_service_stub_permission_test.cpp" ]
391
392  configs = [
393    ":common_config",
394    ":module_private_config",
395  ]
396
397  cflags_cc = [ "--coverage" ]
398
399  ldflags = [ "--coverage" ]
400
401  deps = common_deps
402
403  external_deps = common_external_deps
404
405  external_deps += [ "ability_base:base" ]
406}
407
408ohos_unittest("AVSessionServiceStubTest") {
409  module_out_path = module_output_path
410
411  sources = [ "avsession_service_stub_test.cpp" ]
412
413  configs = [
414    ":common_config",
415    ":module_private_config",
416  ]
417
418  cflags_cc = [ "--coverage" ]
419
420  ldflags = [ "--coverage" ]
421
422  deps = common_deps
423
424  external_deps = common_external_deps
425
426  external_deps += [ "ability_base:base" ]
427}
428
429ohos_unittest("AVSessionProxyTest") {
430  module_out_path = module_output_path
431
432  sources = [ "avsession_proxy_test.cpp" ]
433
434  configs = [ ":module_private_config" ]
435
436  cflags_cc = [ "--coverage" ]
437
438  ldflags = [ "--coverage" ]
439
440  deps = common_deps
441
442  external_deps = common_external_deps
443
444  if (castplus_cast_engine_enable) {
445    cflags_cc += [ "-DCASTPLUS_CAST_ENGINE_ENABLE" ]
446    deps += [
447      "../../../../frameworks/native/session:avsession_cast_client",
448      "../../../../services/session:avsession_cast_item",
449      "../../../../services/session:avsession_router",
450    ]
451    external_deps += [
452      "CollaborationFwk:cfwk_allconnect_client",
453      "CollaborationFwk:collaborationfwk_client",
454      "cast_engine:cast_engine_client",
455    ]
456  }
457}
458
459ohos_unittest("AbilityManagerAdapterDemoTest") {
460  module_out_path = module_output_path
461
462  sources = [ "ability_manager_adapter_test.cpp" ]
463
464  configs = [ ":module_private_config" ]
465
466  cflags_cc = [ "--coverage" ]
467
468  ldflags = [ "--coverage" ]
469
470  deps = common_deps
471
472  external_deps = common_external_deps
473}
474
475ohos_unittest("AVControllerCallbackStubTest") {
476  module_out_path = module_output_path
477
478  sources = [ "avcontroller_callback_stub_test.cpp" ]
479
480  configs = [ ":module_private_config" ]
481
482  cflags_cc = [ "--coverage" ]
483
484  ldflags = [ "--coverage" ]
485
486  deps = common_deps
487
488  external_deps = common_external_deps
489
490  external_deps += [ "ability_base:base" ]
491}
492
493ohos_unittest("AVSessionControllerStubTest") {
494  module_out_path = module_output_path
495
496  sources = [ "avsession_controller_stub_test.cpp" ]
497
498  configs = [ ":module_private_config" ]
499
500  cflags_cc = [ "--coverage" ]
501
502  ldflags = [ "--coverage" ]
503
504  deps = common_deps
505
506  external_deps = common_external_deps
507
508  external_deps += [ "ability_base:base" ]
509}
510
511ohos_unittest("AVSessionDumperTest") {
512  module_out_path = module_output_path
513
514  sources = [ "avsession_dumper_test.cpp" ]
515
516  configs = [ ":module_private_config" ]
517
518  cflags_cc = [ "--coverage" ]
519
520  ldflags = [ "--coverage" ]
521
522  deps = common_deps
523
524  external_deps = common_external_deps
525
526  external_deps += [ "ability_base:base" ]
527}
528
529ohos_unittest("SessionListenerStubTest") {
530  module_out_path = module_output_path
531
532  sources = [ "session_listener_stub_test.cpp" ]
533
534  configs = [ ":module_private_config" ]
535
536  cflags_cc = [ "--coverage" ]
537
538  ldflags = [ "--coverage" ]
539
540  deps = common_deps
541
542  external_deps = common_external_deps
543
544  external_deps += [ "ability_base:base" ]
545}
546
547ohos_unittest("AVSessionCallbackStubTest") {
548  module_out_path = module_output_path
549
550  sources = [ "avsession_callback_stub_test.cpp" ]
551
552  configs = [ ":module_private_config" ]
553
554  cflags_cc = [ "--coverage" ]
555
556  ldflags = [ "--coverage" ]
557
558  deps = common_deps
559
560  external_deps = common_external_deps
561
562  external_deps += [ "ability_base:base" ]
563}
564
565ohos_unittest("AVControllerCallbackProxyTest") {
566  module_out_path = module_output_path
567
568  sources = [ "avcontroller_callback_proxy_test.cpp" ]
569
570  configs = [ ":module_private_config" ]
571
572  cflags_cc = [ "--coverage" ]
573
574  ldflags = [ "--coverage" ]
575
576  deps = common_deps
577
578  external_deps = common_external_deps
579}
580
581ohos_unittest("AVSessionCallbackProxyTest") {
582  module_out_path = module_output_path
583
584  sources = [ "avsession_callback_proxy_test.cpp" ]
585
586  configs = [ ":module_private_config" ]
587
588  cflags_cc = [ "--coverage" ]
589
590  ldflags = [ "--coverage" ]
591
592  deps = common_deps
593
594  external_deps = common_external_deps
595}
596
597ohos_unittest("AVSessionControllerProxyTest") {
598  module_out_path = module_output_path
599
600  sources = [ "avsession_controller_proxy_test.cpp" ]
601
602  configs = [ ":module_private_config" ]
603
604  cflags_cc = [ "--coverage" ]
605
606  ldflags = [ "--coverage" ]
607
608  deps = common_deps
609
610  external_deps = common_external_deps
611}
612
613ohos_unittest("SessionListenerProxyTest") {
614  module_out_path = module_output_path
615
616  sources = [ "session_listener_proxy_test.cpp" ]
617
618  configs = [ ":module_private_config" ]
619
620  cflags_cc = [ "--coverage" ]
621
622  ldflags = [ "--coverage" ]
623
624  deps = common_deps
625
626  external_deps = common_external_deps
627}
628
629ohos_unittest("BundleStatusAdapterTest") {
630  module_out_path = module_output_path
631
632  sources = [ "bundle_status_adapter_test.cpp" ]
633
634  configs = [ ":module_private_config" ]
635
636  cflags_cc = [ "--coverage" ]
637
638  ldflags = [ "--coverage" ]
639
640  deps = common_deps
641
642  external_deps = common_external_deps
643}
644
645ohos_unittest("MigrateAVSessionTest") {
646  module_out_path = module_output_path
647
648  sources = [ "migrate_avsession_test.cpp" ]
649
650  cflags_cc = [ "--coverage" ]
651
652  ldflags = [ "--coverage" ]
653
654  configs = [ ":module_private_config" ]
655
656  deps = [
657    "../../../../frameworks/common:avsession_common",
658    "../../../../frameworks/native/session:avsession_client",
659    "../../../../utils:avsession_utils",
660    "../../../session:avsession_item",
661    "../../../session:avsession_server",
662    "../../../session:avsession_service",
663    "//third_party/bounds_checking_function:libsec_shared",
664    "//third_party/googletest:gtest_main",
665    "//third_party/jsoncpp:jsoncpp",
666  ]
667
668  external_deps = [
669    "ability_base:want",
670    "ability_runtime:wantagent_innerkits",
671    "access_token:libaccesstoken_sdk",
672    "access_token:libnativetoken_shared",
673    "access_token:libtokensetproc_shared",
674    "audio_framework:audio_client",
675    "background_task_mgr:bgtaskmgr_innerkits",
676    "c_utils:utils",
677    "device_manager:devicemanagersdk",
678    "dsoftbus:softbus_client",
679    "hilog:libhilog",
680    "input:libmmi-client",
681    "ipc:ipc_single",
682    "samgr:samgr_proxy",
683  ]
684
685  cflags = []
686
687  if (bluetooth_part_enable) {
688    cflags += [ "-DBLUETOOTH_ENABLE" ]
689    external_deps += [ "bluetooth:btframework" ]
690  }
691
692  if (efficiency_manager_enable_in_avsession) {
693    cflags += [ "-DEFFICIENCY_MANAGER_ENABLE" ]
694  }
695
696  if (multimedia_av_session_enable_trace_control) {
697    cflags += [ "-DENBABLE_AVSESSION_TRACE_CONTROL" ]
698    external_deps += [ "hitrace:hitrace_meter" ]
699  }
700
701  if (multimedia_av_session_enable_sysevent_control) {
702    cflags += [ "-DENABLE_AVSESSION_SYSEVENT_CONTROL" ]
703    external_deps += [ "hisysevent:libhisysevent" ]
704  }
705}
706
707ohos_unittest("SoftbusSessionManagerTest") {
708  module_out_path = module_output_path
709
710  sources = [ "softbus_session_manager_test.cpp" ]
711
712  cflags_cc = [ "--coverage" ]
713
714  ldflags = [ "--coverage" ]
715
716  configs = [ ":module_private_config" ]
717
718  deps = [
719    "../../../session:avsession_server",
720    "//third_party/bounds_checking_function:libsec_shared",
721    "//third_party/googletest:gtest_main",
722  ]
723
724  external_deps = [
725    "ability_base:want",
726    "ability_runtime:wantagent_innerkits",
727    "access_token:libaccesstoken_sdk",
728    "access_token:libnativetoken_shared",
729    "access_token:libtokensetproc_shared",
730    "audio_framework:audio_client",
731    "c_utils:utils",
732    "device_manager:devicemanagersdk",
733    "dsoftbus:softbus_client",
734    "hilog:libhilog",
735    "input:libmmi-client",
736    "ipc:ipc_single",
737    "jsoncpp:jsoncpp",
738    "samgr:samgr_proxy",
739  ]
740}
741
742ohos_unittest("AVSessionServiceTest") {
743  module_out_path = module_output_path
744
745  sources = [ "avsession_service_test.cpp" ]
746
747  configs = [ ":module_private_config" ]
748
749  deps = [
750    "../../../../frameworks/common:avsession_common",
751    "../../../../frameworks/native/session:avsession_client",
752    "../../../../services/session:avsession_item",
753    "../../../../services/session:avsession_service",
754    "../../../../utils:avsession_utils",
755    "//third_party/bounds_checking_function:libsec_shared",
756    "//third_party/googletest:gtest_main",
757  ]
758
759  external_deps = [
760    "ability_base:want",
761    "ability_runtime:wantagent_innerkits",
762    "access_token:libaccesstoken_sdk",
763    "access_token:libnativetoken_shared",
764    "access_token:libtokensetproc_shared",
765    "audio_framework:audio_client",
766    "background_task_mgr:bgtaskmgr_innerkits",
767    "c_utils:utils",
768    "device_manager:devicemanagersdk",
769    "dsoftbus:softbus_client",
770    "hilog:libhilog",
771    "image_framework:image_native",
772    "input:libmmi-client",
773    "ipc:ipc_single",
774    "jsoncpp:jsoncpp",
775    "samgr:samgr_proxy",
776    "window_manager:libdm",
777    "window_manager:libwm",
778  ]
779
780  cflags = []
781  if (castplus_cast_engine_enable) {
782    cflags += [ "-DCASTPLUS_CAST_ENGINE_ENABLE" ]
783    deps += [
784      "../../../../frameworks/native/session:avsession_cast_client",
785      "../../../../services/session:avsession_cast_item",
786      "../../../../services/session:avsession_router",
787    ]
788    external_deps += [
789      "CollaborationFwk:cfwk_allconnect_client",
790      "CollaborationFwk:collaborationfwk_client",
791      "cast_engine:cast_engine_client",
792    ]
793  }
794
795  if (bluetooth_part_enable) {
796    cflags = [ "-DBLUETOOTH_ENABLE" ]
797    external_deps += [ "bluetooth:btframework" ]
798  }
799}
800
801ohos_unittest("AppManagerAdapterTest") {
802  module_out_path = module_output_path
803
804  sources = [ "appmanager_adapter_test.cpp" ]
805
806  configs = [ ":module_private_config" ]
807
808  deps = [
809    "./../../../session:avsession_item",
810    "./../../../session:avsession_service",
811    "//third_party/bounds_checking_function:libsec_shared",
812    "//third_party/googletest:gtest_main",
813  ]
814
815  external_deps = [
816    "ability_base:want",
817    "ability_runtime:app_manager",
818    "ability_runtime:wantagent_innerkits",
819    "access_token:libaccesstoken_sdk",
820    "access_token:libtokensetproc_shared",
821    "audio_framework:audio_client",
822    "c_utils:utils",
823    "hilog:libhilog",
824    "hitrace:hitrace_meter",
825    "image_framework:image_native",
826    "input:libmmi-client",
827    "ipc:ipc_single",
828    "safwk:system_ability_fwk",
829    "samgr:samgr_proxy",
830  ]
831}
832
833ohos_unittest("AbilityConnectHelperTest") {
834  module_out_path = module_output_path
835
836  sources = [ "ability_connect_helper_test.cpp" ]
837
838  configs = [ ":module_private_config" ]
839
840  deps = [
841    "./../../../session:avsession_item",
842    "./../../../session:avsession_service",
843    "//third_party/bounds_checking_function:libsec_shared",
844    "//third_party/googletest:gtest_main",
845  ]
846
847  external_deps = [
848    "ability_base:want",
849    "ability_runtime:app_manager",
850    "ability_runtime:wantagent_innerkits",
851    "access_token:libaccesstoken_sdk",
852    "access_token:libtokensetproc_shared",
853    "audio_framework:audio_client",
854    "background_task_mgr:bgtaskmgr_innerkits",
855    "c_utils:utils",
856    "hilog:libhilog",
857    "hitrace:hitrace_meter",
858    "image_framework:image_native",
859    "input:libmmi-client",
860    "ipc:ipc_single",
861    "jsoncpp:jsoncpp",
862    "safwk:system_ability_fwk",
863    "samgr:samgr_proxy",
864  ]
865}
866
867ohos_unittest("BkGrAudioControllerTest") {
868  module_out_path = module_output_path
869
870  sources = [ "bkgr_audio_controller_test.cpp" ]
871
872  configs = [ ":module_private_config" ]
873
874  cflags_cc = [
875    "--coverage",
876    "-fno-access-control",
877  ]
878
879  ldflags = [ "--coverage" ]
880
881  deps = [
882    "./../../../session:avsession_item",
883    "./../../../session:avsession_service",
884    "//third_party/bounds_checking_function:libsec_shared",
885    "//third_party/googletest:gtest_main",
886  ]
887
888  external_deps = [
889    "ability_base:want",
890    "ability_runtime:app_manager",
891    "ability_runtime:wantagent_innerkits",
892    "access_token:libaccesstoken_sdk",
893    "access_token:libtokensetproc_shared",
894    "audio_framework:audio_client",
895    "background_task_mgr:bgtaskmgr_innerkits",
896    "bundle_framework:appexecfwk_core",
897    "c_utils:utils",
898    "hilog:libhilog",
899    "hitrace:hitrace_meter",
900    "image_framework:image_native",
901    "input:libmmi-client",
902    "ipc:ipc_single",
903    "safwk:system_ability_fwk",
904    "samgr:samgr_proxy",
905  ]
906}
907
908ohos_unittest("AudioAdapterTest") {
909  module_out_path = module_output_path
910
911  sources = [ "audio_adapter_test.cpp" ]
912
913  configs = [ ":module_private_config" ]
914
915  deps = [
916    "../../../session:avsession_server",
917    "//third_party/bounds_checking_function:libsec_shared",
918    "//third_party/googletest:gtest_main",
919  ]
920
921  external_deps = [
922    "audio_framework:audio_client",
923    "hilog:libhilog",
924  ]
925}
926
927ohos_unittest("RemoteUtilsTest") {
928  module_out_path = module_output_path
929
930  sources = [ "remote_utils_test.cpp" ]
931
932  configs = [ ":module_private_config" ]
933
934  deps = [
935    "../../../session:avsession_server",
936    "//third_party/bounds_checking_function:libsec_shared",
937    "//third_party/googletest:gtest_main",
938  ]
939
940  external_deps = [
941    "ability_base:want",
942    "ability_runtime:wantagent_innerkits",
943    "audio_framework:audio_client",
944    "hilog:libhilog",
945    "input:libmmi-client",
946    "safwk:system_ability_fwk",
947  ]
948}
949
950ohos_unittest("SessionStackTest") {
951  module_out_path = module_output_path
952
953  sources = [ "session_stack_test.cpp" ]
954
955  configs = [ ":module_private_config" ]
956
957  deps = [
958    "../../../session:avsession_server",
959    "//third_party/bounds_checking_function:libsec_shared",
960    "//third_party/googletest:gtest_main",
961  ]
962
963  external_deps = [
964    "ability_base:want",
965    "ability_runtime:app_manager",
966    "ability_runtime:wantagent_innerkits",
967    "access_token:libaccesstoken_sdk",
968    "access_token:libtokensetproc_shared",
969    "audio_framework:audio_client",
970    "background_task_mgr:bgtaskmgr_innerkits",
971    "c_utils:utils",
972    "device_manager:devicemanagersdk",
973    "hilog:libhilog",
974    "hitrace:hitrace_meter",
975    "input:libmmi-client",
976    "ipc:ipc_single",
977    "jsoncpp:jsoncpp",
978    "safwk:system_ability_fwk",
979    "samgr:samgr_proxy",
980  ]
981
982  cflags = []
983
984  if (bluetooth_part_enable) {
985    cflags += [ "-DBLUETOOTH_ENABLE" ]
986    external_deps += [ "bluetooth:btframework" ]
987  }
988
989  if (efficiency_manager_enable_in_avsession) {
990    cflags += [ "-DEFFICIENCY_MANAGER_ENABLE" ]
991  }
992
993  if (multimedia_av_session_enable_trace_control) {
994    cflags += [ "-DENBABLE_AVSESSION_TRACE_CONTROL" ]
995    external_deps += [ "hitrace:hitrace_meter" ]
996  }
997
998  if (multimedia_av_session_enable_sysevent_control) {
999    cflags += [ "-DENABLE_AVSESSION_SYSEVENT_CONTROL" ]
1000    external_deps += [ "hisysevent:libhisysevent" ]
1001  }
1002}
1003
1004ohos_unittest("AVRouterTest") {
1005  module_out_path = module_output_path
1006
1007  sources = [ "avrouter_test.cpp" ]
1008
1009  configs = [ ":module_private_config" ]
1010
1011  deps = [
1012    "../../../session:avsession_server",
1013    "//third_party/bounds_checking_function:libsec_shared",
1014    "//third_party/googletest:gtest_main",
1015  ]
1016
1017  external_deps = [
1018    "ability_base:want",
1019    "ability_runtime:app_manager",
1020    "ability_runtime:wantagent_innerkits",
1021    "access_token:libaccesstoken_sdk",
1022    "access_token:libtokenid_sdk",
1023    "access_token:libtokensetproc_shared",
1024    "audio_framework:audio_client",
1025    "background_task_mgr:bgtaskmgr_innerkits",
1026    "bundle_framework:appexecfwk_base",
1027    "bundle_framework:appexecfwk_core",
1028    "c_utils:utils",
1029    "data_object:distributeddataobject_impl",
1030    "device_manager:devicemanagersdk",
1031    "hilog:libhilog",
1032    "input:libmmi-client",
1033    "ipc:ipc_single",
1034    "jsoncpp:jsoncpp",
1035    "safwk:system_ability_fwk",
1036    "samgr:samgr_proxy",
1037  ]
1038
1039  if (castplus_cast_engine_enable) {
1040    cflags = [ "-DCASTPLUS_CAST_ENGINE_ENABLE" ]
1041    deps += [
1042      "../../../../services/session:avsession_cast_item",
1043      "../../../session:avsession_router",
1044    ]
1045  }
1046}
1047
1048if (castplus_cast_engine_enable) {
1049  ohos_unittest("HwCastSupplementTest") {
1050    module_out_path = module_output_path
1051
1052    sources = [ "hw_cast_supplement_test.cpp" ]
1053
1054    configs = [ ":module_private_config" ]
1055
1056    cflags_cc = [ "-fno-access-control" ]
1057
1058    deps = [
1059      "../../../session:avsession_server",
1060      "./../../../../frameworks/common:avsession_common",
1061      "./../../../../frameworks/native/session:avsession_cast_client",
1062      "./../../../../utils:avsession_utils",
1063      "./../../../session:avsession_cast_item",
1064      "./../../../session:avsession_item",
1065      "./../../../session:avsession_router",
1066      "//third_party/bounds_checking_function:libsec_shared",
1067      "//third_party/googletest:gtest_main",
1068      "//third_party/openssl:libcrypto_shared",
1069    ]
1070
1071    external_deps = [
1072      "ability_base:want",
1073      "ability_runtime:app_manager",
1074      "ability_runtime:wantagent_innerkits",
1075      "access_token:libaccesstoken_sdk",
1076      "access_token:libtokenid_sdk",
1077      "access_token:libtokensetproc_shared",
1078      "audio_framework:audio_client",
1079      "background_task_mgr:bgtaskmgr_innerkits",
1080      "bundle_framework:appexecfwk_base",
1081      "bundle_framework:appexecfwk_core",
1082      "c_utils:utils",
1083      "cast_engine:cast_engine_client",
1084      "data_object:distributeddataobject_impl",
1085      "device_manager:devicemanagersdk",
1086      "hilog:libhilog",
1087      "image_framework:image_native",
1088      "input:libmmi-client",
1089      "ipc:ipc_single",
1090      "safwk:system_ability_fwk",
1091      "samgr:samgr_proxy",
1092    ]
1093  }
1094
1095  ohos_unittest("HwCastTest") {
1096    module_out_path = module_output_path
1097
1098    sources = [ "hw_cast_test.cpp" ]
1099
1100    configs = [ ":module_private_config" ]
1101
1102    deps = [
1103      "../../../session:avsession_server",
1104      "./../../../../frameworks/common:avsession_common",
1105      "./../../../../frameworks/native/session:avsession_cast_client",
1106      "./../../../../utils:avsession_utils",
1107      "./../../../session:avsession_cast_item",
1108      "./../../../session:avsession_item",
1109      "./../../../session:avsession_router",
1110      "//third_party/bounds_checking_function:libsec_shared",
1111      "//third_party/googletest:gtest_main",
1112      "//third_party/openssl:libcrypto_shared",
1113    ]
1114
1115    external_deps = [
1116      "ability_base:want",
1117      "ability_runtime:app_manager",
1118      "ability_runtime:wantagent_innerkits",
1119      "access_token:libaccesstoken_sdk",
1120      "access_token:libtokenid_sdk",
1121      "access_token:libtokensetproc_shared",
1122      "audio_framework:audio_client",
1123      "bundle_framework:appexecfwk_base",
1124      "bundle_framework:appexecfwk_core",
1125      "c_utils:utils",
1126      "cast_engine:cast_engine_client",
1127      "data_object:distributeddataobject_impl",
1128      "device_manager:devicemanagersdk",
1129      "hilog:libhilog",
1130      "image_framework:image_native",
1131      "input:libmmi-client",
1132      "ipc:ipc_single",
1133      "safwk:system_ability_fwk",
1134      "samgr:samgr_proxy",
1135    ]
1136  }
1137}
1138
1139if (castplus_cast_engine_enable) {
1140  ohos_unittest("HwCastStreamPlayerTest") {
1141    module_out_path = module_output_path
1142
1143    sources = [ "hw_cast_stream_player_test.cpp" ]
1144
1145    configs = [ ":module_private_config" ]
1146
1147    deps = [
1148      "../../../../frameworks/common:avsession_common",
1149      "../../../session:avsession_cast_item",
1150      "../../../session:avsession_item",
1151      "../../../session:avsession_router",
1152      "//third_party/bounds_checking_function:libsec_shared",
1153      "//third_party/googletest:gtest_main",
1154    ]
1155
1156    external_deps = [
1157      "ability_base:want",
1158      "ability_runtime:app_manager",
1159      "ability_runtime:wantagent_innerkits",
1160      "access_token:libaccesstoken_sdk",
1161      "access_token:libnativetoken_shared",
1162      "access_token:libtokensetproc_shared",
1163      "audio_framework:audio_client",
1164      "bundle_framework:appexecfwk_base",
1165      "bundle_framework:appexecfwk_core",
1166      "c_utils:utils",
1167      "cast_engine:cast_engine_client",
1168      "data_object:distributeddataobject_impl",
1169      "device_manager:devicemanagersdk",
1170      "hilog:libhilog",
1171      "image_framework:image_native",
1172      "input:libmmi-client",
1173      "ipc:ipc_single",
1174      "safwk:system_ability_fwk",
1175      "samgr:samgr_proxy",
1176    ]
1177  }
1178}
1179
1180if (castplus_cast_engine_enable) {
1181  ohos_unittest("AVSessionRadarTest") {
1182    module_out_path = module_output_path
1183
1184    sources = [ "avsession_radar_test.cpp" ]
1185
1186    configs = [ ":module_private_config" ]
1187
1188    deps = [
1189      "./../../../../utils:avsession_utils",
1190      "//third_party/bounds_checking_function:libsec_shared",
1191      "//third_party/googletest:gtest_main",
1192      "//third_party/openssl:libcrypto_shared",
1193    ]
1194
1195    external_deps = [
1196      "bundle_framework:appexecfwk_base",
1197      "bundle_framework:appexecfwk_core",
1198      "c_utils:utils",
1199      "device_manager:devicemanagersdk",
1200      "hilog:libhilog",
1201      "ipc:ipc_single",
1202      "safwk:system_ability_fwk",
1203      "samgr:samgr_proxy",
1204    ]
1205  }
1206}
1207
1208if (castplus_cast_engine_enable) {
1209  ohos_unittest("AVCastControllerStubTest") {
1210    module_out_path = module_output_path
1211
1212    sources = [ "avcast_controller_stub_test.cpp" ]
1213
1214    configs = [ ":module_private_config" ]
1215
1216    cflags_cc = [
1217      "-fno-access-control",
1218      "-DCASTPLUS_CAST_ENGINE_ENABLE",
1219    ]
1220
1221    deps = common_deps
1222
1223    deps += [
1224      "../../../../frameworks/native/session:avsession_cast_client",
1225      "../../../../services/session:avsession_cast_item",
1226      "../../../../services/session:avsession_router",
1227    ]
1228
1229    external_deps = common_external_deps
1230
1231    external_deps += [
1232      "CollaborationFwk:cfwk_allconnect_client",
1233      "CollaborationFwk:collaborationfwk_client",
1234      "cast_engine:cast_engine_client",
1235    ]
1236  }
1237
1238  ohos_unittest("AVCastControllerCallbackStubTest") {
1239    module_out_path = module_output_path
1240
1241    sources = [ "avcast_controller_callback_stub_test.cpp" ]
1242
1243    configs = [ ":module_private_config" ]
1244
1245    cflags_cc = [
1246      "-fno-access-control",
1247      "-DCASTPLUS_CAST_ENGINE_ENABLE",
1248    ]
1249
1250    deps = common_deps
1251
1252    deps += [
1253      "../../../../frameworks/native/session:avsession_cast_client",
1254      "../../../../services/session:avsession_cast_item",
1255      "../../../../services/session:avsession_router",
1256    ]
1257
1258    external_deps = common_external_deps
1259
1260    external_deps += [
1261      "CollaborationFwk:cfwk_allconnect_client",
1262      "CollaborationFwk:collaborationfwk_client",
1263      "cast_engine:cast_engine_client",
1264    ]
1265  }
1266
1267  ohos_unittest("AVCastControllerProxyTest") {
1268    module_out_path = module_output_path
1269
1270    sources = [ "avcast_controller_proxy_test.cpp" ]
1271
1272    configs = [ ":module_private_config" ]
1273
1274    cflags_cc = [
1275      "-fno-access-control",
1276      "-DCASTPLUS_CAST_ENGINE_ENABLE",
1277    ]
1278
1279    deps = common_deps
1280
1281    deps += [
1282      "../../../../frameworks/native/session:avsession_cast_client",
1283      "../../../../services/session:avsession_cast_item",
1284      "../../../../services/session:avsession_router",
1285    ]
1286
1287    external_deps = common_external_deps
1288
1289    external_deps += [
1290      "CollaborationFwk:cfwk_allconnect_client",
1291      "CollaborationFwk:collaborationfwk_client",
1292      "cast_engine:cast_engine_client",
1293    ]
1294  }
1295
1296  ohos_unittest("AVCastControllerCallbackProxyTest") {
1297    module_out_path = module_output_path
1298
1299    sources = [ "avcast_controller_callback_proxy_test.cpp" ]
1300
1301    configs = [ ":module_private_config" ]
1302
1303    cflags_cc = [
1304      "-fno-access-control",
1305      "-DCASTPLUS_CAST_ENGINE_ENABLE",
1306    ]
1307
1308    deps = common_deps
1309
1310    deps += [
1311      "../../../../frameworks/native/session:avsession_cast_client",
1312      "../../../../services/session:avsession_cast_item",
1313      "../../../../services/session:avsession_router",
1314    ]
1315
1316    external_deps = common_external_deps
1317
1318    external_deps += [
1319      "CollaborationFwk:cfwk_allconnect_client",
1320      "CollaborationFwk:collaborationfwk_client",
1321      "cast_engine:cast_engine_client",
1322    ]
1323  }
1324}
1325
1326###############################################################################
1327group("av_session_server_unittest") {
1328  testonly = true
1329
1330  deps = [
1331    ":AVControllerCallbackProxyTest",
1332    ":AVControllerCallbackStubTest",
1333    ":AVRouterTest",
1334    ":AVSessionCallbackProxyTest",
1335    ":AVSessionCallbackStubTest",
1336    ":AVSessionControllerProxyTest",
1337    ":AVSessionControllerStubTest",
1338    ":AVSessionDumperTest",
1339    ":AVSessionDynamicLoaderTest",
1340    ":AVSessionProxyTest",
1341    ":AVSessionServiceProxyTest",
1342    ":AVSessionServiceStubPermissionTest",
1343    ":AVSessionServiceStubTest",
1344    ":AVSessionServiceSupplementTest",
1345    ":AVSessionServiceTest",
1346    ":AVsessionSyseventTest",
1347    ":AbilityConnectHelperTest",
1348    ":AbilityConnectHelperTest",
1349    ":AbilityManagerAdapterDemoTest",
1350    ":AppManagerAdapterTest",
1351    ":AudioAdapterTest",
1352    ":BkGrAudioControllerTest",
1353    ":BundleStatusAdapterTest",
1354    ":CollaborationManagerTest",
1355    ":CommandSendLimitTest",
1356    ":DetectBluetoothHostObserverTest",
1357    ":FocusSessionStrategyTest",
1358    ":HashCalculatorTest",
1359    ":JsonUtilsTest",
1360    ":MigrateAVSessionTest",
1361    ":ParamsConfigOperatorTest",
1362    ":PermissionCheckerTest",
1363    ":RemoteSessionSinkTest",
1364    ":RemoteSessionSourceTest",
1365    ":RemoteUtilsTest",
1366    ":SessionListenerProxyTest",
1367    ":SessionListenerStubTest",
1368    ":SessionStackTest",
1369    ":SoftbusSessionManagerTest",
1370  ]
1371
1372  if (castplus_cast_engine_enable) {
1373    deps += [
1374      ":AVCastControllerCallbackProxyTest",
1375      ":AVCastControllerCallbackStubTest",
1376      ":AVCastControllerProxyTest",
1377      ":AVCastControllerStubTest",
1378      ":AVSessionRadarTest",
1379      ":HwCastStreamPlayerTest",
1380      ":HwCastSupplementTest",
1381      ":HwCastTest",
1382    ]
1383  }
1384}
1385###############################################################################
1386