• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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    "../../include/",
27    "../../../../../../interfaces/inner_api/native/session/include/",
28    "../../../../../services/session/server/",
29    "../../../../../services/session/adapter",
30  ]
31}
32
33common_deps = [
34  "../../../../../services/session:avsession_item_static",
35  "../../../../../services/session:avsession_service_static",
36  "../../../../../utils:avsession_utils",
37  "../../../../common:avsession_common",
38  "../../../session:avsession_client_static",
39  "//third_party/googletest:gtest_main",
40]
41
42common_deps_without_third_party = [
43  "../../../../../services/session:avsession_item_static",
44  "../../../../../services/session:avsession_service_static",
45  "../../../../../utils:avsession_utils",
46  "../../../../common:avsession_common",
47  "../../../session:avsession_client_static",
48]
49
50common_external_deps = [
51  "ability_base:want",
52  "ability_runtime:wantagent_innerkits",
53  "access_token:libaccesstoken_sdk",
54  "access_token:libnativetoken_shared",
55  "access_token:libtokensetproc_shared",
56  "audio_framework:audio_client",
57  "audio_framework:audio_foundation",
58  "background_task_mgr:bgtaskmgr_innerkits",
59  "c_utils:utils",
60  "device_manager:devicemanagersdk",
61  "dsoftbus:softbus_client",
62  "hilog:libhilog",
63  "image_framework:image_native",
64  "input:libmmi-client",
65  "ipc:ipc_single",
66  "jsoncpp:jsoncpp",
67  "samgr:samgr_proxy",
68]
69
70ohos_unittest("AVSessionManagerTest") {
71  module_out_path = module_output_path
72
73  sources = [ "avsession_manager_test.cpp" ]
74
75  configs = [ ":module_private_config" ]
76
77  deps = common_deps
78
79  external_deps = common_external_deps
80}
81
82ohos_unittest("MediaInfoHolderTest") {
83  module_out_path = module_output_path
84
85  sources = [ "media_info_holder_test.cpp" ]
86
87  configs = [ ":module_private_config" ]
88
89  deps = common_deps
90
91  external_deps = common_external_deps
92}
93
94ohos_unittest("AVQueueInfoTest") {
95  module_out_path = module_output_path
96
97  sources = [ "avqueue_info_test.cpp" ]
98
99  configs = [ ":module_private_config" ]
100
101  deps = common_deps
102
103  external_deps = common_external_deps
104}
105
106ohos_unittest("AVControllerCallbackClientTest") {
107  module_out_path = module_output_path
108
109  sources = [ "avcontroller_callback_client_test.cpp" ]
110
111  configs = [ ":module_private_config" ]
112
113  deps = common_deps
114
115  external_deps = common_external_deps
116
117  external_deps += [ "ability_base:base" ]
118}
119
120ohos_unittest("SessionListenerClientTest") {
121  module_out_path = module_output_path
122
123  sources = [ "session_listener_client_test.cpp" ]
124
125  configs = [ ":module_private_config" ]
126
127  deps = common_deps
128
129  external_deps = common_external_deps
130
131  external_deps += [ "ability_base:base" ]
132}
133
134ohos_unittest("AVSessionPixelMapAdapterTest") {
135  module_out_path = module_output_path
136
137  sources = [ "avsession_pixel_map_adapter_test.cpp" ]
138
139  configs = [ ":module_private_config" ]
140
141  deps = common_deps
142
143  external_deps = common_external_deps
144
145  external_deps += [ "ability_base:base" ]
146}
147
148ohos_unittest("AVSessionManagerImplTest") {
149  module_out_path = module_output_path
150
151  sources = [ "avsession_manager_impl_test.cpp" ]
152
153  configs = [ ":module_private_config" ]
154
155  deps = common_deps
156
157  external_deps = common_external_deps
158
159  external_deps += [ "ability_base:base" ]
160}
161
162ohos_unittest("AVSessionControllerTest") {
163  module_out_path = module_output_path
164
165  sources = [ "avsession_controller_test.cpp" ]
166
167  configs = [ ":module_private_config" ]
168
169  deps = common_deps
170
171  external_deps = common_external_deps
172
173  external_deps += [ "ability_base:base" ]
174}
175
176ohos_unittest("AVPlaybackStateTest") {
177  module_out_path = module_output_path
178
179  sources = [ "avplayback_state_test.cpp" ]
180
181  configs = [ ":module_private_config" ]
182
183  deps = common_deps
184
185  external_deps = common_external_deps
186}
187
188ohos_unittest("AVSessionTest") {
189  module_out_path = module_output_path
190
191  sources = [ "avsession_test.cpp" ]
192
193  configs = [ ":module_private_config" ]
194
195  deps = common_deps
196
197  external_deps = common_external_deps
198
199  external_deps += [ "ability_base:base" ]
200}
201
202ohos_unittest("AVMetaDataTest") {
203  module_out_path = module_output_path
204
205  sources = [ "avmeta_data_test.cpp" ]
206
207  cflags_cc = [ "-fno-access-control" ]
208
209  configs = [ ":module_private_config" ]
210
211  deps = common_deps
212
213  external_deps = common_external_deps
214}
215
216ohos_unittest("AVCallMetaDataTest") {
217  module_out_path = module_output_path
218
219  sources = [ "avcallmeta_data_test.cpp" ]
220
221  configs = [ ":module_private_config" ]
222
223  deps = common_deps
224
225  external_deps = common_external_deps
226}
227
228ohos_unittest("AVCallStateTest") {
229  module_out_path = module_output_path
230
231  sources = [ "avcall_state_test.cpp" ]
232
233  configs = [ ":module_private_config" ]
234
235  deps = common_deps
236
237  external_deps = common_external_deps
238}
239
240ohos_unittest("AVSessionPermissionTest") {
241  module_out_path = module_output_path
242
243  sources = [ "avsession_permission_test.cpp" ]
244
245  configs = [ ":module_private_config" ]
246
247  deps = common_deps
248
249  external_deps = common_external_deps
250}
251
252ohos_unittest("AVSessionRemoteTest") {
253  module_out_path = module_output_path
254
255  sources = [ "avsession_remote_test.cpp" ]
256
257  configs = [ ":module_private_config" ]
258
259  if (castplus_cast_engine_enable) {
260    cflags = [ "-DCASTPLUS_CAST_ENGINE_ENABLE" ]
261  }
262
263  deps = common_deps
264
265  external_deps = common_external_deps
266}
267
268ohos_unittest("AVMediaDescriptionTest") {
269  module_out_path = module_output_path
270
271  sources = [ "avmedia_description_test.cpp" ]
272
273  configs = [ ":module_private_config" ]
274
275  deps = common_deps
276
277  external_deps = common_external_deps
278}
279
280ohos_unittest("AVDumperTest") {
281  module_out_path = module_output_path
282
283  sources = [ "avsession_dumper_test.cpp" ]
284
285  configs = [ ":module_private_config" ]
286
287  deps = common_deps
288
289  visibility = [ ":*" ]
290
291  include_dirs = [
292    "../../include/",
293    "../../../../../../interfaces/inner_api/native/session/include/",
294    "../../../../../services/session/adapter",
295    "../../../../../services/session/server/",
296    "../../../../../services/session/server/remote",
297  ]
298
299  external_deps = common_external_deps
300  cflags = []
301
302  if (bluetooth_part_enable) {
303    cflags = [ "-DBLUETOOTH_ENABLE" ]
304    external_deps += [ "bluetooth:btframework" ]
305  }
306
307  if (castplus_cast_engine_enable) {
308    cflags += [ "-DCASTPLUS_CAST_ENGINE_ENABLE" ]
309    deps += [
310      "../../../../../frameworks/native/session:avsession_cast_client",
311      "../../../../../services/session:avsession_cast_item_static",
312      "../../../../../services/session:avsession_router_static",
313    ]
314    external_deps += [
315      "cast_engine:cast_engine_client",
316      "window_manager:libdm_lite",
317    ]
318  }
319
320  if (efficiency_manager_enable_in_avsession) {
321    cflags += [ "-DEFFICIENCY_MANAGER_ENABLE" ]
322  }
323
324  if (multimedia_av_session_enable_trace_control) {
325    cflags += [ "-DENBABLE_AVSESSION_TRACE_CONTROL" ]
326    external_deps += [ "hitrace:hitrace_meter" ]
327  }
328
329  if (multimedia_av_session_enable_sysevent_control) {
330    cflags += [ "-DENABLE_AVSESSION_SYSEVENT_CONTROL" ]
331    external_deps += [ "hisysevent:libhisysevent" ]
332  }
333}
334
335if (castplus_cast_engine_enable) {
336  ohos_unittest("AVCastControllerTest") {
337    module_out_path = module_output_path
338
339    sources = [ "avcast_controller_test.cpp" ]
340
341    cflags = [
342      "-DCASTPLUS_CAST_ENGINE_ENABLE",
343      "-fno-access-control",
344    ]
345
346    deps = common_deps_without_third_party
347
348    deps += [
349      "../../../../../services/session:avsession_cast_item_static",
350      "../../../../../services/session:avsession_router_static",
351    ]
352
353    visibility = [ ":*" ]
354
355    include_dirs = [
356      "../../include/",
357      "../../../../../services/session/adapter",
358      "../../../../../services/session/ipc/server",
359      "../../../../../services/session/server/",
360      "../../../../../services/session/server/remote",
361    ]
362
363    external_deps = common_external_deps
364
365    external_deps += [
366      "ability_base:want",
367      "ability_runtime:app_manager",
368      "ability_runtime:wantagent_innerkits",
369      "access_token:libaccesstoken_sdk",
370      "access_token:libtokenid_sdk",
371      "audio_framework:audio_client",
372      "bundle_framework:appexecfwk_base",
373      "bundle_framework:appexecfwk_core",
374      "c_utils:utils",
375      "cast_engine:cast_engine_client",
376      "data_object:distributeddataobject_impl",
377      "device_manager:devicemanagersdk",
378      "googletest:gtest_main",
379      "hilog:libhilog",
380      "input:libmmi-client",
381      "ipc:ipc_single",
382      "safwk:system_ability_fwk",
383      "samgr:samgr_proxy",
384    ]
385  }
386}
387
388###############################################################################
389group("av_session_unittest") {
390  testonly = true
391
392  deps = [
393    ":AVCallMetaDataTest",
394    ":AVCallStateTest",
395    ":AVControllerCallbackClientTest",
396    ":AVDumperTest",
397    ":AVMediaDescriptionTest",
398    ":AVMetaDataTest",
399    ":AVPlaybackStateTest",
400    ":AVQueueInfoTest",
401    ":AVSessionControllerTest",
402    ":AVSessionManagerImplTest",
403    ":AVSessionManagerTest",
404    ":AVSessionPermissionTest",
405    ":AVSessionPixelMapAdapterTest",
406    ":AVSessionRemoteTest",
407    ":AVSessionTest",
408    ":MediaInfoHolderTest",
409    ":SessionListenerClientTest",
410  ]
411
412  if (castplus_cast_engine_enable) {
413    deps += [ ":AVCastControllerTest" ]
414  }
415}
416###############################################################################
417