1# Copyright (c) 2025 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("//build/test.gni") 15import("//foundation/multimedia/player_framework/config.gni") 16 17module_output_path = "player_framework/player" 18 19ohos_unittest("media_server_manager_unittest") { 20 module_out_path = module_output_path 21 22 include_dirs = [ 23 "./mock", 24 "$MEDIA_PLAYER_ROOT_DIR/services/services/sa_media/ipc", 25 "$MEDIA_PLAYER_ROOT_DIR/services/services/sa_media/server", 26 "$MEDIA_PLAYER_ROOT_DIR/services/services/sa_media/server_manager", 27 "$MEDIA_PLAYER_ROOT_DIR/services/services/common", 28 "$MEDIA_PLAYER_ROOT_DIR/services/services/player/audio_background_adapter", 29 "$MEDIA_PLAYER_ROOT_DIR/services/services/player/ipc", 30 "$MEDIA_PLAYER_ROOT_DIR/services/services/player/player_mem_manage", 31 "$MEDIA_PLAYER_ROOT_DIR/services/services/player/server", 32 "$MEDIA_PLAYER_ROOT_DIR/services/services/player/subscriber", 33 "$MEDIA_PLAYER_ROOT_DIR/services/services/media_data_source/ipc", 34 "$MEDIA_PLAYER_ROOT_DIR/services/services/media_data_source/server", 35 "$MEDIA_PLAYER_ROOT_DIR/services/services/media_source/ipc", 36 "$MEDIA_PLAYER_ROOT_DIR/services/services/media_source/server", 37 "$MEDIA_PLAYER_ROOT_DIR/services/services/monitor/client", 38 "$MEDIA_PLAYER_ROOT_DIR/services/services/monitor/ipc", 39 "$MEDIA_PLAYER_ROOT_DIR/services/services/monitor/server", 40 "$MEDIA_PLAYER_ROOT_DIR/services/services/recorder/ipc", 41 "$MEDIA_PLAYER_ROOT_DIR/services/services/recorder/server", 42 "$MEDIA_PLAYER_ROOT_DIR/services/services/avmetadatahelper/ipc", 43 "$MEDIA_PLAYER_ROOT_DIR/services/services/avmetadatahelper/server", 44 "$MEDIA_PLAYER_ROOT_DIR/services/services/avcodec/ipc", 45 "$MEDIA_PLAYER_ROOT_DIR/services/services/avcodec/server", 46 "$MEDIA_PLAYER_ROOT_DIR/services/services/avcodeclist/ipc", 47 "$MEDIA_PLAYER_ROOT_DIR/services/services/avcodeclist/server", 48 "$MEDIA_PLAYER_ROOT_DIR/services/services/recorder_profiles/ipc", 49 "$MEDIA_PLAYER_ROOT_DIR/services/services/recorder_profiles/server", 50 "$MEDIA_PLAYER_ROOT_DIR/services/services/screen_capture/server", 51 "$MEDIA_PLAYER_ROOT_DIR/services/services/screen_capture/ipc", 52 "$MEDIA_PLAYER_ROOT_DIR/services/services/screen_capture_monitor/server", 53 "$MEDIA_PLAYER_ROOT_DIR/services/services/screen_capture_monitor/ipc", 54 "$MEDIA_PLAYER_ROOT_DIR/services/services/transcoder/server", 55 "$MEDIA_PLAYER_ROOT_DIR/services/services/transcoder/ipc", 56 "$MEDIA_PLAYER_ROOT_DIR/services/services/observer", 57 "$MEDIA_PLAYER_ROOT_DIR/services/include", 58 "$MEDIA_PLAYER_ROOT_DIR/services/services/factory", 59 "$MEDIA_PLAYER_ROOT_DIR/services/services/engine_intf", 60 "$MEDIA_PLAYER_ROOT_DIR/services/utils/include", 61 "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native", 62 "$MEDIA_PLAYER_ROOT_DIR/services/services/common", 63 "$MEDIA_PLAYER_ROOT_DIR/services/engine/common/recorder_profiles", 64 "$MEDIA_PLAYER_ROOT_DIR/services/dfx", 65 ] 66 67 if (player_framework_support_avsession_background) { 68 include_dirs += [ 69 "$MEDIA_PLAYER_ROOT_DIR/services/services/player/avsession_background", 70 ] 71 } 72 73 cflags = [ 74 "-Wall", 75 "-Werror", 76 "-Dprivate=public", 77 "-Dprotected=public", 78 ] 79 sanitize = { 80 cfi = true 81 cfi_cross_dso = true 82 } 83 84 external_deps = [ 85 "ability_runtime:ability_connect_callback_stub", 86 "access_token:libaccesstoken_sdk", 87 "access_token:libtokenid_sdk", 88 "audio_framework:audio_client", 89 "av_codec:av_codec_client", 90 "c_utils:utils", 91 "common_event_service:cesfwk_innerkits", 92 "googletest:gmock_main", 93 "graphic_2d:librender_service_base", 94 "hdf_core:libhdi", 95 "hicollie:libhicollie", 96 "hilog:libhilog", 97 "hisysevent:libhisysevent", 98 "hitrace:hitrace_meter", 99 "hitrace:libhitracechain", 100 "hiview:libucollection_client", 101 "i18n:intl_util", 102 "image_framework:image_native", 103 "init:libbegetutil", 104 "ipc:ipc_single", 105 "jsoncpp:jsoncpp", 106 "libxml2:libxml2", 107 "media_foundation:media_foundation", 108 "memmgr:memmgrclient", 109 "napi:ace_napi", 110 "os_account:os_account_innerkits", 111 "qos_manager:qos", 112 "resource_management:global_resmgr", 113 "resource_schedule_service:ressched_client", 114 "safwk:system_ability_fwk", 115 "samgr:samgr_proxy", 116 ] 117 118 if (player_framework_support_video) { 119 external_deps += [ "graphic_surface:surface" ] 120 } 121 122 if (player_framework_support_screen_capture_stopbycall) { 123 external_deps += [ 124 "call_manager:tel_call_manager_api", 125 "core_service:tel_core_service_api", 126 "state_registry:tel_state_registry_api", 127 ] 128 } 129 130 if (player_framework_support_screen_capture) { 131 external_deps += [ 132 "ability_base:base", 133 "ability_base:want", 134 "ability_base:zuri", 135 "ability_runtime:ability_context_native", 136 "ability_runtime:ability_manager", 137 "ability_runtime:abilitykit_native", 138 "ability_runtime:extension_manager", 139 "ability_runtime:runtime", 140 "access_token:libnativetoken_shared", 141 "access_token:libprivacy_sdk", 142 "access_token:libtokensetproc_shared", 143 "audio_framework:audio_capturer", 144 "audio_framework:audio_client", 145 "distributed_notification_service:ans_innerkits", 146 "graphic_surface:sync_fence", 147 "relational_store:native_rdb", 148 "window_manager:libdm", 149 "window_manager:scene_session", 150 "window_manager:scene_session_manager", 151 "window_manager:session_manager_lite", 152 ] 153 } 154 155 if (player_framework_support_avsession_background) { 156 external_deps += [ 157 "ability_base:want", 158 "ability_runtime:wantagent_innerkits", 159 "audio_framework:audio_client", 160 "av_session:avsession_client", 161 "input:libmmi-client", 162 ] 163 } 164 165 if (player_framework_support_auto_create_file) { 166 external_deps += [ 167 "camera_framework:camera_framework", 168 "data_share:datashare_common", 169 "data_share:datashare_consumer", 170 "media_library:media_library", 171 "media_library:media_library_manager", 172 "samgr:samgr_proxy", 173 ] 174 } 175 176 if (use_memmgr_plugin) { 177 external_deps += [ "memmgr_override:memmgrclient" ] 178 } else if (use_memmgr) { 179 external_deps += [ "memmgr:memmgrclient" ] 180 } 181 182 if (player_framework_support_drm) { 183 external_deps += [ "drm_framework:drm_framework" ] 184 } 185 186 if (player_framework_support_power_manager) { 187 external_deps += [ "power_manager:powermgr_client" ] 188 } 189 190 deps = [ 191 "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native:media_client", 192 "$MEDIA_PLAYER_ROOT_DIR/services/dfx:media_service_dfx", 193 "$MEDIA_PLAYER_ROOT_DIR/services/dfx:media_service_log_dfx", 194 "$MEDIA_PLAYER_ROOT_DIR/services/services:media_service", 195 "$MEDIA_PLAYER_ROOT_DIR/services/utils:media_service_utils", 196 ] 197 198 sources = [ 199 "$MEDIA_PLAYER_ROOT_DIR/services/services/sa_media/server_manager/media_server_manager.cpp", 200 "media_server_manager_unittest.cpp", 201 ] 202 203 resource_config_file = 204 "$MEDIA_PLAYER_ROOT_DIR/test/unittest/resources/ohos_test.xml" 205} 206