1# Copyright (c) 2024 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 19config("hiplayer_impl_unit_test_config") { 20 visibility = [ ":*" ] 21 22 cflags = [ 23 "-O2", 24 "-fPIC", 25 "-Wall", 26 "-fexceptions", 27 "-fno-rtti", 28 "-Wno-unused-but-set-variable", 29 "-Wno-format", 30 "-Dprivate=public", 31 "-Dprotected=public", 32 ] 33 cflags_cc = cflags 34 include_dirs = [ 35 "./", 36 "./mock", 37 "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native", 38 "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player", 39 "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/utils", 40 "$MEDIA_PLAYER_ROOT_DIR/services/services/engine_intf", 41 "$MEDIA_PLAYER_ROOT_DIR/services/services/player/client", 42 "$MEDIA_PLAYER_ROOT_DIR/services/services/player/ipc", 43 "$MEDIA_PLAYER_ROOT_DIR/services/services/player/server/", 44 "$MEDIA_PLAYER_ROOT_DIR/services/utils/include", 45 ] 46 defines = [] 47 48 if (target_cpu == "arm64" || is_emulator) { 49 dragging_player_path = "\"/system/lib64\"" 50 } else { 51 dragging_player_path = "\"/system/lib\"" 52 } 53 54 defines += [ "DRAGGING_PLAYER_PATH=${dragging_player_path}" ] 55 56 defines += player_framework_defines 57} 58 59ohos_unittest("hiplayer_impl_unit_test") { 60 module_out_path = module_output_path 61 stack_protector_ret = true 62 63 sources = [ 64 "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player/dfx_agent.cpp", 65 "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player/dragging_player_agent.cpp", 66 "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player/hiplayer_callback_looper.cpp", 67 "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player/hiplayer_impl.cpp", 68 "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player/live_controller.cpp", 69 "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player/seek_agent.cpp", 70 "$MEDIA_PLAYER_ROOT_DIR/services/utils/media_dfx.cpp", 71 "$MEDIA_PLAYER_ROOT_DIR/services/utils/media_utils.cpp", 72 "hiplayer_callback_looper_unit_test.cpp", 73 "hiplayer_impl_unit_test.cpp", 74 "live_controller_unit_test.cpp", 75 ] 76 77 configs = [ 78 ":hiplayer_impl_unit_test_config", 79 "$MEDIA_PLAYER_ROOT_DIR/services/dfx:media_service_log_dfx_public_config", 80 "$MEDIA_PLAYER_ROOT_DIR/services/utils:media_service_utils_public_config", 81 ] 82 83 sanitize = { 84 integer_overflow = true 85 ubsan = true 86 boundary_sanitize = true 87 cfi = true 88 cfi_cross_dso = true 89 debug = false 90 } 91 92 external_deps = [ 93 "access_token:libaccesstoken_sdk", 94 "access_token:libprivacy_sdk", 95 "audio_framework:audio_client", 96 "audio_framework:audio_renderer", 97 "av_codec:av_codec_client", 98 "av_codec:av_codec_media_engine_filters", 99 "av_codec:av_codec_media_engine_modules", 100 "bundle_framework:appexecfwk_base", 101 "bundle_framework:appexecfwk_core", 102 "c_utils:utils", 103 "googletest:gmock_main", 104 "graphic_surface:surface", 105 "graphic_surface:sync_fence", 106 "hicollie:libhicollie", 107 "hilog:libhilog", 108 "hisysevent:libhisysevent", 109 "hitrace:hitrace_meter", 110 "hitrace:libhitracechain", 111 "init:libbegetutil", 112 "ipc:ipc_single", 113 "libxml2:libxml2", 114 "media_foundation:media_foundation", 115 "os_account:os_account_innerkits", 116 "qos_manager:qos", 117 "safwk:system_ability_fwk", 118 "samgr:samgr_proxy", 119 ] 120 121 if (player_framework_support_drm) { 122 external_deps += [ "drm_framework:drm_framework" ] 123 } 124 125 deps = [ 126 "$MEDIA_PLAYER_ROOT_DIR/services/dfx:media_service_log_dfx", 127 "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player:media_engine_histreamer_player", 128 "$MEDIA_PLAYER_ROOT_DIR/services/utils:media_service_utils", 129 ] 130 131 deps = [] 132} 133