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/communication/netmanager_base/netmanager_base_config.gni") 16 17ohos_unittest("net_client_pac_file_url_test") { 18 module_out_path = 19 "netmanager_base/net_pac_manager_test" 20 sanitize = { 21 cfi = true 22 cfi_cross_dso = true 23 debug = false 24 } 25 26 branch_protector_ret = "pac_ret" 27 28 sources = [ 29 "net_client_pac_file_url_test.cpp", 30 "pac_server.cpp", 31 ] 32 33 include_dirs = [ 34 "$NETCONNMANAGER_SOURCE_DIR/include", 35 ] 36 37 deps = [ 38 "$NETCONNMANAGER_COMMON_DIR:net_service_common", 39 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 40 "$NETCONNMANAGER_SOURCE_DIR:net_conn_manager_static", 41 "$NETMANAGER_BASE_ROOT/interfaces/kits/c/netconnclient:net_connection", 42 ] 43 44 external_deps = [ 45 "jerryscript:jerryscript_shared_not_lite", 46 "c_utils:utils", 47 "eventhandler:libeventhandler", 48 "ffrt:libffrt", 49 "hilog:libhilog", 50 "ability_base:want", 51 "ability_runtime:app_manager", 52 "ability_runtime:wantagent_innerkits", 53 "bundle_framework:appexecfwk_base", 54 "bundle_framework:appexecfwk_core", 55 "cJSON:cjson", 56 "common_event_service:cesfwk_core", 57 "common_event_service:cesfwk_innerkits", 58 "hitrace:hitrace_meter", 59 "ipc:ipc_core", 60 "netmanager_base:net_conn_manager_if", 61 "netmanager_base:net_stats_manager_if", 62 "relational_store:native_rdb", 63 "safwk:system_ability_fwk", 64 "samgr:samgr_proxy", 65 "time_service:time_client", 66 "access_token:libaccesstoken_sdk", 67 "access_token:libnativetoken", 68 "access_token:libtoken_setproc", 69 ] 70 71 defines = [ 72 "NETMGR_LOG_TAG = \"NetPacManagerUT\"", 73 "LOG_DOMAIN = 0xD0015B0", 74 ] 75 76 if (enable_netmgr_debug) { 77 defines += [ "NETMGR_DEBUG" ] 78 } 79 if(netmanager_base_enable_pac_proxy){ 80 defines += [ "NETMANAGER_ENABLE_PAC_PROXY" ] 81 } 82 external_deps += [ "hilog:libhilog" ] 83 84 part_name = "netmanager_base" 85 subsystem_name = "communication" 86} 87 88ohos_unittest("net_pac_manager_test") { 89 module_out_path = 90 "netmanager_base/net_pac_manager_test" 91 sanitize = { 92 cfi = true 93 cfi_cross_dso = true 94 debug = false 95 } 96 97 branch_protector_ret = "pac_ret" 98 99 sources = [ 100 "net_pac_manager_test.cpp", 101 "mock_timer.cpp", 102 "pac_server.cpp", 103 ] 104 105 include_dirs = [ 106 "$NETCONNMANAGER_SOURCE_DIR/include", 107 ] 108 109 deps = [ 110 "$NETCONNMANAGER_COMMON_DIR:net_service_common", 111 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 112 "$NETCONNMANAGER_SOURCE_DIR:net_conn_manager_static", 113 "$NETMANAGER_BASE_ROOT/interfaces/kits/c/netconnclient:net_connection", 114 ] 115 116 external_deps = [ 117 "jerryscript:jerryscript_shared_not_lite", 118 "c_utils:utils", 119 "eventhandler:libeventhandler", 120 "ffrt:libffrt", 121 "hilog:libhilog", 122 "ability_base:want", 123 "ability_runtime:app_manager", 124 "ability_runtime:wantagent_innerkits", 125 "access_token:libaccesstoken_sdk", 126 "access_token:libnativetoken", 127 "access_token:libtoken_setproc", 128 "bundle_framework:appexecfwk_base", 129 "bundle_framework:appexecfwk_core", 130 "cJSON:cjson", 131 "common_event_service:cesfwk_core", 132 "common_event_service:cesfwk_innerkits", 133 "hitrace:hitrace_meter", 134 "ipc:ipc_core", 135 "netmanager_base:net_conn_manager_if", 136 "netmanager_base:net_stats_manager_if", 137 "relational_store:native_rdb", 138 "safwk:system_ability_fwk", 139 "samgr:samgr_proxy", 140 "time_service:time_client", 141 ] 142 143 defines = [ 144 "NETMGR_LOG_TAG = \"NetPacManagerUT\"", 145 "LOG_DOMAIN = 0xD0015B0", 146 ] 147 148 if (enable_netmgr_debug) { 149 defines += [ "NETMGR_DEBUG" ] 150 } 151 if(netmanager_base_enable_pac_proxy){ 152 defines += [ "NETMANAGER_ENABLE_PAC_PROXY" ] 153 } 154 external_deps += [ "hilog:libhilog" ] 155 156 part_name = "netmanager_base" 157 subsystem_name = "communication" 158} 159