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("../../../../../castplus_cast_engine_part.gni") 15import("../../../../../config.gni") 16 17module_output_path = "multimedia_av_session/session" 18 19############################################################################### 20config("module_private_config") { 21 visibility = [ ":*" ] 22 23 include_dirs = [ 24 "../../include/", 25 "../../../../../../interfaces/inner_api/native/session/include/", 26 "../../../../../services/session/server/", 27 "../../../../../services/session/adapter", 28 ] 29} 30 31common_deps = [ 32 "../../../../../services/session:avsession_item", 33 "../../../../../services/session:avsession_service", 34 "../../../../../utils:avsession_utils", 35 "../../../../common:avsession_common", 36 "../../../session:avsession_client", 37 "//third_party/googletest:gtest_main", 38] 39 40common_external_deps = [ 41 "ability_base:want", 42 "ability_runtime:wantagent_innerkits", 43 "access_token:libaccesstoken_sdk", 44 "access_token:libnativetoken", 45 "access_token:libtoken_setproc", 46 "audio_framework:audio_client", 47 "c_utils:utils", 48 "device_manager:devicemanagersdk", 49 "dsoftbus:softbus_client", 50 "hilog:libhilog", 51 "image_framework:image_native", 52 "input:libmmi-client", 53 "ipc:ipc_single", 54 "samgr:samgr_proxy", 55] 56 57ohos_unittest("AVSessionManagerTest") { 58 module_out_path = module_output_path 59 60 sources = [ "avsession_manager_test.cpp" ] 61 62 configs = [ ":module_private_config" ] 63 64 deps = common_deps 65 66 external_deps = common_external_deps 67} 68 69ohos_unittest("AVSessionControllerTest") { 70 module_out_path = module_output_path 71 72 sources = [ "avsession_controller_test.cpp" ] 73 74 configs = [ ":module_private_config" ] 75 76 deps = common_deps 77 78 external_deps = common_external_deps 79 80 external_deps += [ "ability_base:base" ] 81} 82 83ohos_unittest("AVPlaybackStateTest") { 84 module_out_path = module_output_path 85 86 sources = [ "avplayback_state_test.cpp" ] 87 88 configs = [ ":module_private_config" ] 89 90 deps = common_deps 91 92 external_deps = common_external_deps 93} 94 95ohos_unittest("AVSessionTest") { 96 module_out_path = module_output_path 97 98 sources = [ "avsession_test.cpp" ] 99 100 configs = [ ":module_private_config" ] 101 102 deps = common_deps 103 104 external_deps = common_external_deps 105 106 external_deps += [ "ability_base:base" ] 107} 108 109ohos_unittest("AVMetaDataTest") { 110 module_out_path = module_output_path 111 112 sources = [ "avmeta_data_test.cpp" ] 113 114 configs = [ ":module_private_config" ] 115 116 deps = common_deps 117 118 external_deps = common_external_deps 119} 120 121ohos_unittest("AVSessionPermissionTest") { 122 module_out_path = module_output_path 123 124 sources = [ "avsession_permission_test.cpp" ] 125 126 configs = [ ":module_private_config" ] 127 128 deps = common_deps 129 130 external_deps = common_external_deps 131} 132 133ohos_unittest("AVSessionRemoteTest") { 134 module_out_path = module_output_path 135 136 sources = [ "avsession_remote_test.cpp" ] 137 138 configs = [ ":module_private_config" ] 139 140 if (castplus_cast_engine_enable) { 141 cflags = [ "-DCASTPLUS_CAST_ENGINE_ENABLE" ] 142 } 143 144 deps = common_deps 145 146 external_deps = common_external_deps 147} 148 149ohos_unittest("AVMediaDescriptionTest") { 150 module_out_path = module_output_path 151 152 sources = [ "avmedia_description_test.cpp" ] 153 154 configs = [ ":module_private_config" ] 155 156 deps = common_deps 157 158 external_deps = common_external_deps 159} 160 161ohos_unittest("AVDumperTest") { 162 module_out_path = module_output_path 163 164 sources = [ "avsession_dumper_test.cpp" ] 165 166 configs = [ ":module_private_config" ] 167 168 deps = common_deps 169 170 visibility = [ ":*" ] 171 172 include_dirs = [ 173 "../../include/", 174 "../../../../../../interfaces/inner_api/native/session/include/", 175 "../../../../../services/session/adapter", 176 "../../../../../services/session/server/", 177 "../../../../../services/session/server/remote", 178 ] 179 180 external_deps = common_external_deps 181} 182 183if (castplus_cast_engine_enable) { 184 ohos_unittest("AVCastControllerTest") { 185 module_out_path = module_output_path 186 187 sources = [ "avcast_controller_test.cpp" ] 188 189 configs = [ ":module_private_config" ] 190 191 cflags = [ "-DCASTPLUS_CAST_ENGINE_ENABLE" ] 192 193 deps = common_deps 194 195 deps += [ 196 "../../../../../services/session:avsession_cast_item", 197 "../../../../../services/session:avsession_router", 198 ] 199 200 visibility = [ ":*" ] 201 202 include_dirs = [ 203 "../../include/", 204 "../../../../../../interfaces/inner_api/native/session/include/", 205 "../../../../../services/session/adapter", 206 "../../../../../services/session/ipc/server", 207 "../../../../../services/session/server/", 208 "../../../../../services/session/server/remote", 209 ] 210 211 external_deps = common_external_deps 212 213 external_deps += [ 214 "ability_base:want", 215 "ability_runtime:app_manager", 216 "ability_runtime:wantagent_innerkits", 217 "access_token:libaccesstoken_sdk", 218 "access_token:libtokenid_sdk", 219 "audio_framework:audio_client", 220 "bundle_framework:appexecfwk_base", 221 "bundle_framework:appexecfwk_core", 222 "c_utils:utils", 223 "cast_engine:cast_engine_client", 224 "data_object:distributeddataobject_impl", 225 "device_manager:devicemanagersdk", 226 "hilog:libhilog", 227 "input:libmmi-client", 228 "ipc:ipc_single", 229 "safwk:system_ability_fwk", 230 "samgr:samgr_proxy", 231 ] 232 } 233} 234 235############################################################################### 236group("av_session_unittest") { 237 testonly = true 238 239 deps = [ 240 ":AVDumperTest", 241 ":AVMediaDescriptionTest", 242 ":AVMetaDataTest", 243 ":AVPlaybackStateTest", 244 ":AVSessionControllerTest", 245 ":AVSessionManagerTest", 246 ":AVSessionPermissionTest", 247 ":AVSessionRemoteTest", 248 ":AVSessionTest", 249 ] 250 251 if (castplus_cast_engine_enable) { 252 deps += [ ":AVCastControllerTest" ] 253 } 254} 255############################################################################### 256