1e0e9324cSopenharmony_ci# Copyright (c) 2023 Shenzhen Kaihong Digital Industry Development Co., Ltd.
2e0e9324cSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3e0e9324cSopenharmony_ci# you may not use this file except in compliance with the License.
4e0e9324cSopenharmony_ci# You may obtain a copy of the License at
5e0e9324cSopenharmony_ci#
6e0e9324cSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7e0e9324cSopenharmony_ci#
8e0e9324cSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9e0e9324cSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10e0e9324cSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11e0e9324cSopenharmony_ci# See the License for the specific language governing permissions and
12e0e9324cSopenharmony_ci# limitations under the License.
13e0e9324cSopenharmony_ci
14e0e9324cSopenharmony_ciimport("//build/ohos.gni")
15e0e9324cSopenharmony_ciimport("//build/test.gni")
16e0e9324cSopenharmony_ciimport("//foundation/CastEngine/castengine_wifi_display/config.gni")
17e0e9324cSopenharmony_ci
18e0e9324cSopenharmony_cimodule_out_path = "sharing/mediaplayer"
19e0e9324cSopenharmony_ci
20e0e9324cSopenharmony_cigroup("mediaplayer_unit_test") {
21e0e9324cSopenharmony_ci  testonly = true
22e0e9324cSopenharmony_ci  deps = [
23e0e9324cSopenharmony_ci    ":audioplaycontroller_unit_test",
24e0e9324cSopenharmony_ci    ":audioplayer_unit_test",
25e0e9324cSopenharmony_ci    ":audiosink_unit_test",
26e0e9324cSopenharmony_ci    ":mediacontroller_unit_test",
27e0e9324cSopenharmony_ci    ":videoplaycontroller_unit_test",
28e0e9324cSopenharmony_ci  ]
29e0e9324cSopenharmony_ci}
30e0e9324cSopenharmony_ci
31e0e9324cSopenharmony_ciconfig("mediaplayer_configs") {
32e0e9324cSopenharmony_ci  cflags_cc = [
33e0e9324cSopenharmony_ci    "-Dprivate=public",
34e0e9324cSopenharmony_ci    "-Dprotected=public",
35e0e9324cSopenharmony_ci  ]
36e0e9324cSopenharmony_ci}
37e0e9324cSopenharmony_ci
38e0e9324cSopenharmony_ciohos_unittest("audiosink_unit_test") {
39e0e9324cSopenharmony_ci  module_out_path = module_out_path
40e0e9324cSopenharmony_ci  sanitize = {
41e0e9324cSopenharmony_ci    cfi = true
42e0e9324cSopenharmony_ci    cfi_cross_dso = true
43e0e9324cSopenharmony_ci    debug = false
44e0e9324cSopenharmony_ci  }
45e0e9324cSopenharmony_ci  include_dirs = [
46e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services",
47e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/mediaplayer/include",
48e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/protocol/frame",
49e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/extend/magic_enum",
50e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/mediachannel",
51e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/codec/include",
52e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/frameworks/innerkitsimpl",
53e0e9324cSopenharmony_ci  ]
54e0e9324cSopenharmony_ci
55e0e9324cSopenharmony_ci  sources = [ "audiosink_unit_test.cpp" ]
56e0e9324cSopenharmony_ci
57e0e9324cSopenharmony_ci  public_configs = [ ":mediaplayer_configs" ]
58e0e9324cSopenharmony_ci
59e0e9324cSopenharmony_ci  deps = [
60e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services:sharing_service",
61e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/common:sharing_common",
62e0e9324cSopenharmony_ci  ]
63e0e9324cSopenharmony_ci
64e0e9324cSopenharmony_ci  if (is_standard_system) {
65e0e9324cSopenharmony_ci    external_deps = [
66e0e9324cSopenharmony_ci      "audio_framework:audio_client",
67e0e9324cSopenharmony_ci      "audio_framework:audio_renderer",
68e0e9324cSopenharmony_ci      "c_utils:utils",
69e0e9324cSopenharmony_ci      "c_utils:utilsbase",
70e0e9324cSopenharmony_ci      "googletest:gtest",
71e0e9324cSopenharmony_ci      "graphic_surface:surface",
72e0e9324cSopenharmony_ci      "hilog:libhilog",
73e0e9324cSopenharmony_ci      "ipc:ipc_core",
74e0e9324cSopenharmony_ci      "player_framework:media_client",
75e0e9324cSopenharmony_ci      "samgr:samgr_proxy",
76e0e9324cSopenharmony_ci    ]
77e0e9324cSopenharmony_ci  } else {
78e0e9324cSopenharmony_ci    external_deps = [ "hilog:libhilog" ]
79e0e9324cSopenharmony_ci  }
80e0e9324cSopenharmony_ci}
81e0e9324cSopenharmony_ci
82e0e9324cSopenharmony_ciohos_unittest("audioplayer_unit_test") {
83e0e9324cSopenharmony_ci  module_out_path = module_out_path
84e0e9324cSopenharmony_ci  sanitize = {
85e0e9324cSopenharmony_ci    cfi = true
86e0e9324cSopenharmony_ci    cfi_cross_dso = true
87e0e9324cSopenharmony_ci    debug = false
88e0e9324cSopenharmony_ci  }
89e0e9324cSopenharmony_ci  include_dirs = [
90e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services",
91e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/mediaplayer/include",
92e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/protocol/frame",
93e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/extend/magic_enum",
94e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/mediachannel",
95e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/codec/include",
96e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/frameworks/innerkitsimpl",
97e0e9324cSopenharmony_ci  ]
98e0e9324cSopenharmony_ci
99e0e9324cSopenharmony_ci  sources = [ "audioplayer_unit_test.cpp" ]
100e0e9324cSopenharmony_ci  public_configs = [ ":mediaplayer_configs" ]
101e0e9324cSopenharmony_ci
102e0e9324cSopenharmony_ci  deps = [
103e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services:sharing_service",
104e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/common:sharing_common",
105e0e9324cSopenharmony_ci  ]
106e0e9324cSopenharmony_ci
107e0e9324cSopenharmony_ci  if (is_standard_system) {
108e0e9324cSopenharmony_ci    external_deps = [
109e0e9324cSopenharmony_ci      "audio_framework:audio_client",
110e0e9324cSopenharmony_ci      "audio_framework:audio_renderer",
111e0e9324cSopenharmony_ci      "c_utils:utils",
112e0e9324cSopenharmony_ci      "c_utils:utilsbase",
113e0e9324cSopenharmony_ci      "googletest:gtest",
114e0e9324cSopenharmony_ci      "graphic_surface:surface",
115e0e9324cSopenharmony_ci      "hilog:libhilog",
116e0e9324cSopenharmony_ci      "ipc:ipc_core",
117e0e9324cSopenharmony_ci      "player_framework:media_client",
118e0e9324cSopenharmony_ci      "samgr:samgr_proxy",
119e0e9324cSopenharmony_ci    ]
120e0e9324cSopenharmony_ci  } else {
121e0e9324cSopenharmony_ci    external_deps = [ "hilog:libhilog" ]
122e0e9324cSopenharmony_ci  }
123e0e9324cSopenharmony_ci}
124e0e9324cSopenharmony_ci
125e0e9324cSopenharmony_ciohos_unittest("audioplaycontroller_unit_test") {
126e0e9324cSopenharmony_ci  module_out_path = module_out_path
127e0e9324cSopenharmony_ci  sanitize = {
128e0e9324cSopenharmony_ci    cfi = true
129e0e9324cSopenharmony_ci    cfi_cross_dso = true
130e0e9324cSopenharmony_ci    debug = false
131e0e9324cSopenharmony_ci  }
132e0e9324cSopenharmony_ci  include_dirs = [
133e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services",
134e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/mediaplayer/include",
135e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/protocol/frame",
136e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/extend/magic_enum",
137e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/mediachannel",
138e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/codec/include",
139e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/frameworks/innerkitsimpl",
140e0e9324cSopenharmony_ci  ]
141e0e9324cSopenharmony_ci
142e0e9324cSopenharmony_ci  sources = [ "audioplaycontroller_unit_test.cpp" ]
143e0e9324cSopenharmony_ci  public_configs = [ ":mediaplayer_configs" ]
144e0e9324cSopenharmony_ci
145e0e9324cSopenharmony_ci  deps = [
146e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services:sharing_service",
147e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/common:sharing_common",
148e0e9324cSopenharmony_ci  ]
149e0e9324cSopenharmony_ci
150e0e9324cSopenharmony_ci  if (is_standard_system) {
151e0e9324cSopenharmony_ci    external_deps = [
152e0e9324cSopenharmony_ci      "audio_framework:audio_client",
153e0e9324cSopenharmony_ci      "audio_framework:audio_renderer",
154e0e9324cSopenharmony_ci      "c_utils:utils",
155e0e9324cSopenharmony_ci      "c_utils:utilsbase",
156e0e9324cSopenharmony_ci      "googletest:gtest",
157e0e9324cSopenharmony_ci      "graphic_surface:surface",
158e0e9324cSopenharmony_ci      "hilog:libhilog",
159e0e9324cSopenharmony_ci      "ipc:ipc_core",
160e0e9324cSopenharmony_ci      "player_framework:media_client",
161e0e9324cSopenharmony_ci      "samgr:samgr_proxy",
162e0e9324cSopenharmony_ci    ]
163e0e9324cSopenharmony_ci  } else {
164e0e9324cSopenharmony_ci    external_deps = [ "hilog:libhilog" ]
165e0e9324cSopenharmony_ci  }
166e0e9324cSopenharmony_ci}
167e0e9324cSopenharmony_ci
168e0e9324cSopenharmony_ciohos_unittest("videoplaycontroller_unit_test") {
169e0e9324cSopenharmony_ci  module_out_path = module_out_path
170e0e9324cSopenharmony_ci  sanitize = {
171e0e9324cSopenharmony_ci    cfi = true
172e0e9324cSopenharmony_ci    cfi_cross_dso = true
173e0e9324cSopenharmony_ci    debug = false
174e0e9324cSopenharmony_ci  }
175e0e9324cSopenharmony_ci  include_dirs = [
176e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services",
177e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/mediaplayer/include",
178e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/protocol/frame",
179e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/extend/magic_enum",
180e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/mediachannel",
181e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/codec/include",
182e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/frameworks/innerkitsimpl",
183e0e9324cSopenharmony_ci  ]
184e0e9324cSopenharmony_ci
185e0e9324cSopenharmony_ci  sources = [ "videoplaycontroller_unit_test.cpp" ]
186e0e9324cSopenharmony_ci  public_configs = [ ":mediaplayer_configs" ]
187e0e9324cSopenharmony_ci
188e0e9324cSopenharmony_ci  deps = [
189e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services:sharing_service",
190e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/common:sharing_common",
191e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/protocol/rtp:sharing_rtp",
192e0e9324cSopenharmony_ci  ]
193e0e9324cSopenharmony_ci
194e0e9324cSopenharmony_ci  if (is_standard_system) {
195e0e9324cSopenharmony_ci    external_deps = [
196e0e9324cSopenharmony_ci      "audio_framework:audio_client",
197e0e9324cSopenharmony_ci      "audio_framework:audio_renderer",
198e0e9324cSopenharmony_ci      "c_utils:utils",
199e0e9324cSopenharmony_ci      "c_utils:utilsbase",
200e0e9324cSopenharmony_ci      "googletest:gtest",
201e0e9324cSopenharmony_ci      "graphic_2d:libgraphic_utils",
202e0e9324cSopenharmony_ci      "graphic_2d:librender_service_client",
203e0e9324cSopenharmony_ci      "hilog:libhilog",
204e0e9324cSopenharmony_ci      "ipc:ipc_core",
205e0e9324cSopenharmony_ci      "player_framework:media_client",
206e0e9324cSopenharmony_ci      "samgr:samgr_proxy",
207e0e9324cSopenharmony_ci      "window_manager:libwm",
208e0e9324cSopenharmony_ci    ]
209e0e9324cSopenharmony_ci  } else {
210e0e9324cSopenharmony_ci    external_deps = [ "hilog:libhilog" ]
211e0e9324cSopenharmony_ci  }
212e0e9324cSopenharmony_ci}
213e0e9324cSopenharmony_ci
214e0e9324cSopenharmony_ciohos_unittest("mediacontroller_unit_test") {
215e0e9324cSopenharmony_ci  module_out_path = module_out_path
216e0e9324cSopenharmony_ci  sanitize = {
217e0e9324cSopenharmony_ci    cfi = true
218e0e9324cSopenharmony_ci    cfi_cross_dso = true
219e0e9324cSopenharmony_ci    debug = false
220e0e9324cSopenharmony_ci  }
221e0e9324cSopenharmony_ci  include_dirs = [
222e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services",
223e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/mediaplayer/include",
224e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/protocol/frame",
225e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/extend/magic_enum",
226e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/mediachannel",
227e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/codec/include",
228e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/frameworks/innerkitsimpl",
229e0e9324cSopenharmony_ci  ]
230e0e9324cSopenharmony_ci
231e0e9324cSopenharmony_ci  sources = [ "mediacontroller_unit_test.cpp" ]
232e0e9324cSopenharmony_ci  public_configs = [ ":mediaplayer_configs" ]
233e0e9324cSopenharmony_ci
234e0e9324cSopenharmony_ci  deps = [
235e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services:sharing_service",
236e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/common:sharing_common",
237e0e9324cSopenharmony_ci    "$SHARING_ROOT_DIR/services/protocol/rtp:sharing_rtp",
238e0e9324cSopenharmony_ci  ]
239e0e9324cSopenharmony_ci
240e0e9324cSopenharmony_ci  if (is_standard_system) {
241e0e9324cSopenharmony_ci    external_deps = [
242e0e9324cSopenharmony_ci      "audio_framework:audio_client",
243e0e9324cSopenharmony_ci      "audio_framework:audio_renderer",
244e0e9324cSopenharmony_ci      "c_utils:utils",
245e0e9324cSopenharmony_ci      "c_utils:utilsbase",
246e0e9324cSopenharmony_ci      "googletest:gtest",
247e0e9324cSopenharmony_ci      "graphic_2d:libgraphic_utils",
248e0e9324cSopenharmony_ci      "graphic_2d:librender_service_client",
249e0e9324cSopenharmony_ci      "hilog:libhilog",
250e0e9324cSopenharmony_ci      "ipc:ipc_core",
251e0e9324cSopenharmony_ci      "player_framework:media_client",
252e0e9324cSopenharmony_ci      "samgr:samgr_proxy",
253e0e9324cSopenharmony_ci      "window_manager:libwm",
254e0e9324cSopenharmony_ci    ]
255e0e9324cSopenharmony_ci  } else {
256e0e9324cSopenharmony_ci    external_deps = [ "hilog:libhilog" ]
257e0e9324cSopenharmony_ci  }
258e0e9324cSopenharmony_ci}
259