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/av_codec/config.gni") 16 17module_output_path = "av_codec/av_codec/unittest" 18dash_test_sources = [ 19 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/base64/base64_utils.cpp", 20 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/dash_mpd_downloader.cpp", 21 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_adpt_set_manager.cpp", 22 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_adpt_set_node.cpp", 23 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_com_attrs_elements.cpp", 24 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_content_comp_node.cpp", 25 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_descriptor_node.cpp", 26 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_manager_util.cpp", 27 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_mpd_manager.cpp", 28 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_mpd_node.cpp", 29 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_mpd_parser.cpp", 30 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_mpd_util.cpp", 31 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_mult_seg_base_node.cpp", 32 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_period_manager.cpp", 33 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_period_node.cpp", 34 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_representation_manager.cpp", 35 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_representation_node.cpp", 36 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_seg_base_node.cpp", 37 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_seg_list_node.cpp", 38 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_seg_template_node.cpp", 39 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_seg_tmline_node.cpp", 40 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_seg_url_node.cpp", 41 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/dash_url_type_node.cpp", 42 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/i_dash_mpd_node.cpp", 43 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/mpd_parser/sidx_box_parser.cpp", 44 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/download/app_client.cpp", 45 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/download/downloader.cpp", 46 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/download/network_client/http_curl_client.cpp", 47 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/xml/xml_element.cpp", 48 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/xml/xml_parser.cpp", 49] 50config("dash_unittest_cfg") { 51 defines = [ 52 "HST_ANY_WITH_NO_RTTI", 53 "MEDIA_OHOS", 54 ] 55 56 cflags = [ 57 "-Wno-sign-compare", 58 "-fno-exceptions", 59 "-fno-common", 60 "-fstack-protector-all", 61 "-Wshadow", 62 "-FPIC", 63 "-FS", 64 "-O2", 65 "-D_FORTIFY_SOURCE=2", 66 "-Wformat=2", 67 "-Wdate-time", 68 "-Dprivate=public", 69 "-Dprotected=public", 70 ] 71 72 cflags_cc = [ 73 "-std=c++17", 74 "-fno-rtti", 75 ] 76 77 include_dirs = [ 78 "$av_codec_root_dir/interfaces", 79 "$av_codec_root_dir/interfaces/inner_api/native", 80 "$av_codec_root_dir/services/media_engine/plugins/source/http_source", 81 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/download", 82 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/xml", 83 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/base64", 84 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash", 85 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/include", 86 "$av_codec_root_dir/services/media_engine/plugins/source/http_source/dash/include/mpd_parser", 87 "$av_codec_root_dir/test/unittest/common", 88 ] 89} 90 91ohos_unittest("dash_seg_template_node_unittest") { 92 module_out_path = module_output_path 93 testonly = true 94 configs = [ 95 ":dash_unittest_cfg", 96 "$av_codec_root_dir/services/dfx:av_codec_service_log_dfx_public_config", 97 ] 98 sources = dash_test_sources + [ "dash_seg_template_node_unittest.cpp" ] 99 deps = [ "$av_codec_root_dir/services/dfx:av_codec_service_dfx" ] 100 101 external_deps = [ 102 "c_utils:utils", 103 "curl:curl_shared", 104 "googletest:gmock", 105 "graphic_surface:surface", 106 "hilog:libhilog", 107 "init:libbegetutil", 108 "ipc:ipc_single", 109 "libxml2:libxml2", 110 "media_foundation:media_foundation", 111 "netmanager_base:net_conn_manager_if", 112 "safwk:system_ability_fwk", 113 "samgr:samgr_proxy", 114 ] 115 116 resource_config_file = 117 "$av_codec_root_dir/test/unittest/resources/ohos_test.xml" 118} 119