• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/ohos.gni")
15import("//build/test.gni")
16import("//foundation/communication/netmanager_base/netmanager_base_config.gni")
17
18common_external_deps = [
19    "hilog:libhilog",
20    "napi:ace_napi",
21]
22
23ohos_unittest("local_proxy_server_test") {
24    module_out_path = "netmanager_base/local_proxy_server_test"
25
26    sources = [
27        "local_proxy_server_test.cpp",
28    ]
29    cflags = ["-w"]
30    deps = [
31        "//foundation/communication/netmanager_base/interfaces/kits/c/netconnclient:net_connection",
32        "$NETCONNMANAGER_SOURCE_DIR:net_conn_manager_static",
33        "$INNERKITS_ROOT/netconnclient:net_conn_manager_if",
34    ]
35
36    include_dirs = [
37        "$NETCONNMANAGER_SOURCE_DIR/include",
38    ]
39    external_deps = common_external_deps
40    external_deps += [
41        "curl:curl_shared",
42        "googletest:gmock_main",
43        "googletest:gtest_main",
44        "googletest:gmock",
45        "json:nlohmann_json_static",
46        "access_token:libaccesstoken_sdk",
47        "access_token:libnativetoken",
48        "access_token:libtoken_setproc",
49    ]
50    if(netmanager_base_enable_pac_proxy){
51        defines = [ "NETMANAGER_ENABLE_PAC_PROXY" ]
52    }
53    part_name = "netstack"
54    subsystem_name = "communication"
55}
56
57ohos_unittest("pac_http_test") {
58    module_out_path = "netmanager_base/pac_http_test"
59
60    sources = [
61        "proxy_server.cpp",
62        "pac_http_test.cpp",
63        "pac_server.cpp",
64        "security_config.cpp",
65    ]
66    cflags = ["-w"]
67    deps = [
68        "$NETCONNMANAGER_COMMON_DIR:net_service_common",
69        "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
70        "$NETCONNMANAGER_SOURCE_DIR:net_conn_manager_static",
71        "$NETMANAGER_BASE_ROOT/interfaces/kits/c/netconnclient:net_connection",
72        "$INNERKITS_ROOT/netconnclient:net_conn_manager_if",
73    ]
74
75    include_dirs = [
76        "$NETCONNMANAGER_SOURCE_DIR/include",
77    ]
78    external_deps = common_external_deps
79    external_deps += [
80        "curl:curl_shared",
81        "googletest:gmock_main",
82        "googletest:gtest_main",
83        "googletest:gmock",
84        "access_token:libaccesstoken_sdk",
85        "access_token:libnativetoken",
86        "access_token:libtoken_setproc",
87    ]
88    if(netmanager_base_enable_pac_proxy){
89        defines = [ "NETMANAGER_ENABLE_PAC_PROXY" ]
90    }
91    part_name = "netstack"
92    subsystem_name = "communication"
93}
94
95ohos_unittest("proxy_switch_mode_test") {
96    module_out_path = "netmanager_base/proxy_switch_mode_test"
97
98    sources = [
99        "proxy_server.cpp",
100        "proxy_mode_switch_test.cpp",
101        "pac_server.cpp",
102        "security_config.cpp",
103    ]
104    cflags = ["-w"]
105
106    deps = [
107        "$NETCONNMANAGER_COMMON_DIR:net_service_common",
108        "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
109        "$NETCONNMANAGER_SOURCE_DIR:net_conn_manager_static",
110        "$NETMANAGER_BASE_ROOT/interfaces/kits/c/netconnclient:net_connection",
111        "$INNERKITS_ROOT/netconnclient:net_conn_manager_if",
112    ]
113
114    include_dirs = [
115        "$NETCONNMANAGER_SOURCE_DIR/include",
116    ]
117
118    external_deps = common_external_deps
119    external_deps += [
120        "curl:curl_shared",
121        "googletest:gmock_main",
122        "googletest:gtest_main",
123        "googletest:gmock",
124        "access_token:libaccesstoken_sdk",
125        "access_token:libnativetoken",
126        "access_token:libtoken_setproc",
127    ]
128    if(netmanager_base_enable_pac_proxy){
129        defines = [ "NETMANAGER_ENABLE_PAC_PROXY" ]
130    }
131    part_name = "netstack"
132    subsystem_name = "communication"
133}
134
135ohos_unittest("proxy_switch_server_tool") {
136    module_out_path = "netmanager_base/proxy_switch_server_tool"
137
138    sources = [
139        "proxy_server.cpp",
140        "proxy_switch_server_tool.cpp",
141        "pac_server.cpp",
142        "security_config.cpp",
143    ]
144    cflags = ["-w"]
145
146    deps = [
147        "$NETCONNMANAGER_COMMON_DIR:net_service_common",
148        "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
149        "$NETCONNMANAGER_SOURCE_DIR:net_conn_manager_static",
150        "$NETMANAGER_BASE_ROOT/interfaces/kits/c/netconnclient:net_connection",
151        "$INNERKITS_ROOT/netconnclient:net_conn_manager_if",
152    ]
153
154    include_dirs = [
155        "$NETCONNMANAGER_SOURCE_DIR/include",
156    ]
157
158    external_deps = common_external_deps
159    external_deps += [
160        "curl:curl_shared",
161        "googletest:gmock_main",
162        "googletest:gtest_main",
163        "googletest:gmock",
164        "access_token:libaccesstoken_sdk",
165        "access_token:libnativetoken",
166        "access_token:libtoken_setproc",
167    ]
168    if(netmanager_base_enable_pac_proxy){
169        defines = [ "NETMANAGER_ENABLE_PAC_PROXY" ]
170    }
171    part_name = "netstack"
172    subsystem_name = "communication"
173}
174