blob: 3db0094bd0adfb3beac407b1520674d7433f1727 [file] [log] [blame]
[email protected]4625ade2014-04-15 19:26:441# Copyright (c) 2013 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
mefff34b822016-01-11 15:28:085import("//build/buildflag_header.gni")
slan77bdc2e62015-09-21 17:56:266import("//build/config/chromecast_build.gni")
brettw4cab0f12015-09-14 21:40:017import("//build/config/compiler/compiler.gni")
[email protected]4625ade2014-04-15 19:26:448import("//build/config/crypto.gni")
9import("//build/config/features.gni")
10import("//build/config/ui.gni")
dpranked4da5ab42015-10-13 06:20:3311import("//build_overrides/v8.gni")
eromane6264fd2016-03-02 22:46:3012import("//testing/libfuzzer/fuzzer_test.gni")
qsrfb5251d12015-01-21 15:57:2213import("//testing/test.gni")
rockot9c67e5f2015-03-12 20:01:2114import("//third_party/icu/config.gni")
rtennetib6f1c0d2015-04-03 17:52:0615import("//third_party/protobuf/proto_library.gni")
tfarinae597851a2015-10-06 23:14:4116import("//tools/grit/grit_rule.gni")
kapishnikovabe280e2016-04-14 19:07:1617import("//url/features.gni")
[email protected]26046b52014-07-16 00:11:0318
[email protected]4625ade2014-04-15 19:26:4419if (is_android) {
20 import("//build/config/android/config.gni")
[email protected]ef0eb442014-05-15 09:32:1821 import("//build/config/android/rules.gni")
[email protected]4625ade2014-04-15 19:26:4422} else if (is_mac) {
23 import("//build/config/mac/mac_sdk.gni")
24}
25
26# The list of net files is kept in net.gypi. Read it.
scottmg34fb7e52014-12-03 23:27:2427gypi_values = exec_script("//build/gypi_to_gn.py",
28 [ rebase_path("net.gypi") ],
29 "scope",
30 [ "net.gypi" ])
[email protected]4625ade2014-04-15 19:26:4431
[email protected]4625ade2014-04-15 19:26:4432# The way the cache uses mmap() is inefficient on some Android devices. If
33# this flag is set, we hackily avoid using mmap() in the disk cache. We are
34# pretty confident that mmap-ing the index would not hurt any existing x86
35# android devices, but we cannot be so sure about the variety of ARM devices.
36# So enable it for x86 only for now.
dpranke43276212015-02-20 02:55:1937posix_avoid_mmap = is_android && current_cpu != "x86"
[email protected]4625ade2014-04-15 19:26:4438
[email protected]8a3f8242014-06-05 18:05:1239use_v8_in_net = !is_ios
[email protected]4625ade2014-04-15 19:26:4440enable_built_in_dns = !is_ios
41
[email protected]384dab92014-06-04 20:26:0842declare_args() {
43 # Disables support for file URLs. File URL support requires use of icu.
44 disable_file_support = false
mefff34b822016-01-11 15:28:0845
agrieve56240df2015-12-22 22:20:2146 # WebSockets and socket stream code are not used on iOS and are optional in
47 # cronet.
48 enable_websockets = !is_ios
49 disable_ftp_support = is_ios
skyostil2df951b2016-04-01 11:33:4350
51 # Enable Kerberos authentication. It is disabled by default on ChromeOS, iOS,
52 # Chromecast, at least for now. This feature needs configuration (krb5.conf
53 # and so on).
54 use_kerberos = !is_chromeos && !is_ios && !is_chromecast
kapishnikovabe280e2016-04-14 19:07:1655
56 # Do not disable brotli filter by default.
57 disable_brotli_filter = false
[email protected]384dab92014-06-04 20:26:0858}
[email protected]02494ec2014-05-07 15:05:2959
[email protected]4625ade2014-04-15 19:26:4460config("net_config") {
61 defines = []
62 if (posix_avoid_mmap) {
63 defines += [ "POSIX_AVOID_MMAP" ]
64 }
[email protected]02494ec2014-05-07 15:05:2965 if (disable_file_support) {
66 defines += [ "DISABLE_FILE_SUPPORT" ]
67 }
tfarinae7c8c3c2015-11-04 15:09:5568 if (disable_ftp_support) {
69 defines += [ "DISABLE_FTP_SUPPORT=1" ]
70 }
[email protected]4625ade2014-04-15 19:26:4471}
72
xunjieli905496a2015-08-31 15:51:1773config("net_internal_config") {
[email protected]8603c5de2014-04-16 20:34:3174 defines = [
ellyjonesc7a5c502015-06-26 18:55:2075 # TODO(GYP) Note that the GYP file supports linux_link_kerberos (defaults to
[email protected]8603c5de2014-04-16 20:34:3176 # 0) which implies that we run pkg_config on kerberos and link to that
77 # rather than setting this define which will dynamically open it. That
78 # doesn't seem to be set in the regular builds, so we're skipping this
79 # capability here.
80 "DLOPEN_KERBEROS",
scottmg34fb7e52014-12-03 23:27:2481 "NET_IMPLEMENTATION",
[email protected]8603c5de2014-04-16 20:34:3182 ]
dpranke43276212015-02-20 02:55:1983
[email protected]4625ade2014-04-15 19:26:4484 if (use_kerberos) {
85 defines += [ "USE_KERBEROS" ]
86 if (is_android) {
xunjieli905496a2015-08-31 15:51:1787 include_dirs = [ "/usr/include/kerberosV" ]
[email protected]4625ade2014-04-15 19:26:4488 }
[email protected]4625ade2014-04-15 19:26:4489 }
90
91 if (enable_built_in_dns) {
92 defines += [ "ENABLE_BUILT_IN_DNS" ]
xunjieli905496a2015-08-31 15:51:1793 }
94}
95
kapishnikovabe280e2016-04-14 19:07:1696net_configs = [
xunjieli905496a2015-08-31 15:51:1797 ":net_internal_config",
98 "//build/config:precompiled_headers",
99
100 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
101 "//build/config/compiler:no_size_t_to_int_warning",
102]
103
kapishnikovabe280e2016-04-14 19:07:16104if (use_glib && use_gconf && !is_chromeos) {
agrieve95ba4442016-04-25 15:47:13105 net_configs += [ "//build/config/linux/gconf" ]
kapishnikovabe280e2016-04-14 19:07:16106}
xunjieli905496a2015-08-31 15:51:17107
kapishnikovabe280e2016-04-14 19:07:16108if (is_linux) {
109 net_configs += [ "//build/config/linux:libresolv" ]
xunjieli905496a2015-08-31 15:51:17110}
111
112component("net") {
kapishnikovabe280e2016-04-14 19:07:16113 sources = gypi_values.net_nacl_common_sources
114 net_unfiltered_sources = []
115
116 deps = [
117 ":net_resources",
118 "//base",
119 "//net/base/registry_controlled_domains",
120 "//third_party/protobuf:protobuf_lite",
121 "//url:url_features",
122 ]
123
124 public_deps = [
125 ":net_quic_proto",
126 "//crypto",
127 "//crypto:platform",
128 ]
129
130 if (!is_nacl) {
131 sources += gypi_values.net_non_nacl_sources
132
133 deps += [
134 "//base/third_party/dynamic_annotations",
135 "//components/prefs",
136 "//sdch",
137 "//third_party/zlib",
138 ]
139
140 if (!use_kerberos) {
141 sources -= [
142 "http/http_auth_handler_negotiate.cc",
143 "http/http_auth_handler_negotiate.h",
144 ]
145 }
146
147 if (is_posix) {
148 if (posix_avoid_mmap) {
149 sources -= [ "disk_cache/blockfile/mapped_file_posix.cc" ]
150 } else {
151 sources -= [ "disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc" ]
152 }
153 }
154
155 if (!enable_built_in_dns) {
156 sources -= [
157 "dns/address_sorter_posix.cc",
158 "dns/address_sorter_posix.h",
159 "dns/dns_client.cc",
160 ]
161 }
162
kapishnikovabe280e2016-04-14 19:07:16163 if (!use_openssl_certs) {
164 sources -= [
165 "base/crypto_module_openssl.cc",
166 "base/keygen_handler_openssl.cc",
167 "base/openssl_private_key_store.h",
168 "base/openssl_private_key_store_memory.cc",
169 "cert/cert_database_openssl.cc",
170 "cert/cert_verify_proc_openssl.cc",
171 "cert/cert_verify_proc_openssl.h",
172 "cert/test_root_certs_openssl.cc",
173 "cert/x509_certificate_openssl.cc",
174 "ssl/openssl_client_key_store.cc",
175 "ssl/openssl_client_key_store.h",
176 ]
177 if (is_android) {
178 sources -= [ "base/openssl_private_key_store_android.cc" ]
179 }
180 } else {
181 if (is_android) {
182 # Android doesn't use these even when using OpenSSL.
183 sources -= [
184 "base/openssl_private_key_store_memory.cc",
185 "cert/cert_database_openssl.cc",
186 "cert/cert_verify_proc_openssl.cc",
187 "cert/test_root_certs_openssl.cc",
188 ]
189 }
190 }
191
192 if (!use_kerberos || is_android) {
193 sources -= [
194 "http/http_auth_gssapi_posix.cc",
195 "http/http_auth_gssapi_posix.h",
196 ]
197 }
198
199 if (use_glib && use_gconf && !is_chromeos) {
200 deps += [ "//build/linux:gio" ]
201 }
202
203 if (!use_nss_certs) {
204 sources -= [
205 "base/crypto_module_nss.cc",
206 "base/keygen_handler_nss.cc",
207 "cert/cert_database_nss.cc",
208 "cert/nss_cert_database.cc",
209 "cert/nss_cert_database.h",
210 "cert/x509_certificate_nss.cc",
211 "ssl/client_cert_store_nss.cc",
212 "ssl/client_cert_store_nss.h",
213 "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
214 "third_party/mozilla_security_manager/nsKeygenHandler.h",
215 "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
216 "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
217 "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
218 "third_party/mozilla_security_manager/nsPKCS12Blob.h",
219 ]
220 if (is_chromeos) {
221 # These were already removed on non-ChromeOS.
222 sources -= [
223 "cert/nss_cert_database_chromeos.cc",
224 "cert/nss_cert_database_chromeos.h",
225 "cert/nss_profile_filter_chromeos.cc",
226 "cert/nss_profile_filter_chromeos.h",
227 ]
228 }
229 sources -= [
230 "ssl/client_key_store.cc",
231 "ssl/client_key_store.h",
232 "ssl/ssl_platform_key_nss.cc",
233 ]
svaldez2135be52016-04-20 16:34:53234 } else {
kapishnikovabe280e2016-04-14 19:07:16235 # client_cert_store_nss.c requires NSS_CmpCertChainWCANames from NSS's
236 # libssl, but our bundled copy is not built in OpenSSL ports. Pull that
237 # file in directly.
238 sources += [ "third_party/nss/ssl/cmpcert.c" ]
239 }
240
svaldez2135be52016-04-20 16:34:53241 if (!use_nss_certs) {
kapishnikovabe280e2016-04-14 19:07:16242 # These files are part of the partial implementation of NSS for
243 # cert verification, so keep them in that case.
244 sources -= [
245 "cert/cert_verify_proc_nss.cc",
246 "cert/cert_verify_proc_nss.h",
247 "cert/test_root_certs_nss.cc",
svaldez2135be52016-04-20 16:34:53248 "cert/x509_util_nss.cc",
kapishnikovabe280e2016-04-14 19:07:16249 "cert_net/nss_ocsp.cc",
250 "cert_net/nss_ocsp.h",
251 ]
252 }
253
kapishnikovabe280e2016-04-14 19:07:16254 if (is_chromecast && use_nss_certs) {
255 sources += [ "ssl/ssl_platform_key_chromecast.cc" ]
256 sources -= [ "ssl/ssl_platform_key_nss.cc" ]
257 }
258
259 if (!enable_mdns) {
260 sources -= [
261 "dns/mdns_cache.cc",
262 "dns/mdns_cache.h",
263 "dns/mdns_client.cc",
264 "dns/mdns_client.h",
265 "dns/mdns_client_impl.cc",
266 "dns/mdns_client_impl.h",
267 "dns/record_parsed.cc",
268 "dns/record_parsed.h",
269 "dns/record_rdata.cc",
270 "dns/record_rdata.h",
271 ]
272 }
273
274 if (is_win) {
275 sources -= [ "http/http_auth_handler_ntlm_portable.cc" ]
276 } else { # !is_win
277 sources -= [
278 "base/winsock_init.cc",
279 "base/winsock_init.h",
280 "base/winsock_util.cc",
281 "base/winsock_util.h",
282 "proxy/proxy_resolver_winhttp.cc",
283 "proxy/proxy_resolver_winhttp.h",
284 ]
285 }
286
287 if (is_ios) {
288 # Add back some sources that were otherwise filtered out.
289 # iOS needs some Mac files.
290 net_unfiltered_sources += [
291 "base/mac/url_conversions.h",
292 "base/mac/url_conversions.mm",
293 "base/network_change_notifier_mac.cc",
294 "base/network_config_watcher_mac.cc",
295 "base/network_interfaces_mac.cc",
296 "base/network_interfaces_mac.h",
297 "base/platform_mime_util_mac.mm",
svaldez2135be52016-04-20 16:34:53298 "cert/test_root_certs_mac.cc",
kapishnikovabe280e2016-04-14 19:07:16299 "proxy/proxy_resolver_mac.cc",
300 "proxy/proxy_server_mac.cc",
301 ]
302
303 sources -= [ "disk_cache/blockfile/file_posix.cc" ]
304 }
305
kapishnikovabe280e2016-04-14 19:07:16306 if (is_ios || is_mac) {
307 sources += gypi_values.net_base_mac_ios_sources
308 }
309
310 if (is_android) {
311 deps += [ ":net_jni_headers" ]
312
313 # Add some Linux sources that were excluded by the filter, but which
314 # are needed.
315 net_unfiltered_sources += [
316 "base/address_tracker_linux.cc",
317 "base/address_tracker_linux.h",
318 "base/network_interfaces_linux.cc",
319 "base/network_interfaces_linux.h",
320 "base/platform_mime_util_linux.cc",
321 ]
322 }
323 } else {
324 public_deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
325 }
xunjieli905496a2015-08-31 15:51:17326
327 # Add back some sources that were otherwise filtered out.
328 set_sources_assignment_filter([])
kapishnikovabe280e2016-04-14 19:07:16329 sources += net_unfiltered_sources
xunjieli905496a2015-08-31 15:51:17330 set_sources_assignment_filter(sources_assignment_filter)
331
332 cflags = []
kapishnikovabe280e2016-04-14 19:07:16333 configs += net_configs
xunjieli905496a2015-08-31 15:51:17334 public_configs = [ ":net_config" ]
335
kapishnikovabe280e2016-04-14 19:07:16336 public_deps += [ "//url" ]
[email protected]4625ade2014-04-15 19:26:44337
338 if (is_mac) {
[email protected]4625ade2014-04-15 19:26:44339 libs = [
[email protected]ab9ce6e2014-04-17 20:33:19340 "Foundation.framework",
341 "Security.framework",
342 "SystemConfiguration.framework",
343 "resolv",
[email protected]4625ade2014-04-15 19:26:44344 ]
345 }
346
347 if (is_ios) {
[email protected]4625ade2014-04-15 19:26:44348 libs = [
[email protected]ab9ce6e2014-04-17 20:33:19349 "CFNetwork.framework",
350 "MobileCoreServices.framework",
351 "Security.framework",
352 "SystemConfiguration.framework",
353 "resolv",
[email protected]4625ade2014-04-15 19:26:44354 ]
xunjieli06d93982015-08-27 17:13:02355 }
xunjieli4c8c6922015-08-27 16:02:40356
jam5332a632016-04-01 22:36:05357 if (is_win) {
358 libs = [
359 "crypt32.lib",
360 "dhcpcsvc.lib",
361 "iphlpapi.lib",
362 "rpcrt4.lib",
363 "secur32.lib",
364 "urlmon.lib",
365 "winhttp.lib",
366 ]
367 }
368
sergeyu99d83f92015-09-14 23:03:33369 if (!is_nacl) {
370 if (!disable_file_support) {
371 sources += gypi_values.net_file_support_sources
372 }
xunjieli06d93982015-08-27 17:13:02373
sergeyu99d83f92015-09-14 23:03:33374 if (!disable_ftp_support) {
375 sources += gypi_values.net_ftp_support_sources
376 }
xunjieli905496a2015-08-31 15:51:17377
sergeyu99d83f92015-09-14 23:03:33378 if (enable_websockets) {
379 sources += gypi_values.net_websockets_sources
380 }
xunjieli905496a2015-08-31 15:51:17381
sergeyu99d83f92015-09-14 23:03:33382 # ICU support.
kapishnikovabe280e2016-04-14 19:07:16383 if (use_platform_icu_alternatives) {
384 if (is_android) {
385 # Use ICU alternative on Android.
386 sources += [
387 "base/net_string_util_icu_alternatives_android.cc",
388 "base/net_string_util_icu_alternatives_android.h",
389 ]
390 deps += [ ":net_jni_headers" ]
391 } else if (is_ios) {
392 # Use ICU alternative on iOS.
393 sources += [ "base/net_string_util_icu_alternatives_ios.mm" ]
394 } else {
395 assert(false,
396 "ICU alternative is not implemented for platform: " + target_os)
397 }
398 } else {
399 # Use ICU.
400 deps += [
401 "//base:i18n",
402 "//third_party/icu",
403 ]
404 sources += [
405 "base/filename_util_icu.cc",
406 "base/net_string_util_icu.cc",
407 ]
408 }
eustasfbec9132015-12-30 14:56:51409
410 # Brotli support.
kapishnikovabe280e2016-04-14 19:07:16411 if (!disable_brotli_filter) {
412 sources += [ "filter/brotli_filter.cc" ]
413 deps += [ "//third_party/brotli" ]
414 } else {
415 sources += [ "filter/brotli_filter_disabled.cc" ]
416 }
[email protected]85191ed2014-05-15 00:41:49417 }
[email protected]4625ade2014-04-15 19:26:44418}
419
420grit("net_resources") {
421 source = "base/net_resources.grd"
[email protected]7ae52902014-08-18 22:36:01422 use_qualified_include = true
[email protected]b89c53842014-07-23 16:32:32423 outputs = [
424 "grit/net_resources.h",
425 "net_resources.pak",
[email protected]b89c53842014-07-23 16:32:32426 ]
[email protected]4625ade2014-04-15 19:26:44427}
428
rtennetib6f1c0d2015-04-03 17:52:06429proto_library("net_quic_proto") {
kapishnikovabe280e2016-04-14 19:07:16430 visibility = [ ":net" ]
brettw2e7db0a2015-04-24 22:59:17431
rtennetib6f1c0d2015-04-03 17:52:06432 sources = [
433 "quic/proto/cached_network_parameters.proto",
434 "quic/proto/source_address_token.proto",
435 ]
436 cc_generator_options = "dllexport_decl=NET_EXPORT_PRIVATE:"
437 cc_include = "net/base/net_export.h"
438
439 defines = [ "NET_IMPLEMENTATION" ]
440
441 extra_configs = [ "//build/config/compiler:wexit_time_destructors" ]
442}
443
Brett Wilson83fd4242014-09-02 19:45:33444static_library("extras") {
mef327a8e42014-08-29 17:10:03445 sources = gypi_values.net_extras_sources
446 configs += [ "//build/config/compiler:wexit_time_destructors" ]
447 deps = [
448 ":net",
brettwbc44c0a92015-02-20 22:30:39449 "//base",
mef327a8e42014-08-29 17:10:03450 "//sql:sql",
451 ]
452}
453
[email protected]8a3f8242014-06-05 18:05:12454static_library("http_server") {
[email protected]4625ade2014-04-15 19:26:44455 sources = [
456 "server/http_connection.cc",
457 "server/http_connection.h",
458 "server/http_server.cc",
459 "server/http_server.h",
460 "server/http_server_request_info.cc",
461 "server/http_server_request_info.h",
462 "server/http_server_response_info.cc",
463 "server/http_server_response_info.h",
464 "server/web_socket.cc",
465 "server/web_socket.h",
dgozmana6e70092014-12-12 14:46:21466 "server/web_socket_encoder.cc",
467 "server/web_socket_encoder.h",
[email protected]4625ade2014-04-15 19:26:44468 ]
jambc6cc8e2014-11-14 17:56:29469 configs += [
brettwd1c719a2015-02-19 23:17:04470 "//build/config/compiler:no_size_t_to_int_warning",
jambc6cc8e2014-11-14 17:56:29471 "//build/config/compiler:wexit_time_destructors",
jambc6cc8e2014-11-14 17:56:29472 ]
[email protected]4625ade2014-04-15 19:26:44473 deps = [
474 ":net",
475 "//base",
476 ]
477}
478
sdefresne3001f172016-03-16 10:30:03479if (!is_ios) {
480 executable("dump_cache") {
481 testonly = true
482 sources = [
483 "tools/dump_cache/dump_cache.cc",
484 "tools/dump_cache/dump_files.cc",
485 "tools/dump_cache/dump_files.h",
486 ]
[email protected]4625ade2014-04-15 19:26:44487
sdefresne3001f172016-03-16 10:30:03488 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
489 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31490
sdefresne3001f172016-03-16 10:30:03491 deps = [
492 ":net",
493 ":test_support",
494 "//base",
495 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:07496 "//build/win:default_exe_manifest",
sdefresne3001f172016-03-16 10:30:03497 ]
498 }
[email protected]8603c5de2014-04-16 20:34:31499}
500
sdefresneb0a31642016-03-18 11:04:45501bundle_data("test_support_bundle_data") {
sdefresne04f91142016-04-21 08:41:59502 visibility = [ ":test_support" ]
sdefresneb0a31642016-03-18 11:04:45503 testonly = true
sdefresne04f91142016-04-21 08:41:59504 sources = gypi_values.net_test_support_data_sources
sdefresneb0a31642016-03-18 11:04:45505 outputs = [
506 "{{bundle_resources_dir}}/" +
507 "{{source_root_relative_dir}}/{{source_file_part}}",
508 ]
509}
510
[email protected]b2b2bf52014-05-28 20:26:57511source_set("test_support") {
Brett Wilson8f80ad0b2014-09-08 19:50:24512 testonly = true
[email protected]8603c5de2014-04-16 20:34:31513 sources = [
[email protected]8603c5de2014-04-16 20:34:31514 "base/load_timing_info_test_util.cc",
515 "base/load_timing_info_test_util.h",
516 "base/mock_file_stream.cc",
517 "base/mock_file_stream.h",
518 "base/test_completion_callback.cc",
519 "base/test_completion_callback.h",
520 "base/test_data_directory.cc",
521 "base/test_data_directory.h",
522 "cert/mock_cert_verifier.cc",
523 "cert/mock_cert_verifier.h",
ryanchung987b2ff2016-02-19 00:17:12524 "cert/mock_client_cert_verifier.cc",
525 "cert/mock_client_cert_verifier.h",
[email protected]8603c5de2014-04-16 20:34:31526 "cookies/cookie_monster_store_test.cc",
527 "cookies/cookie_monster_store_test.h",
528 "cookies/cookie_store_test_callbacks.cc",
529 "cookies/cookie_store_test_callbacks.h",
530 "cookies/cookie_store_test_helpers.cc",
531 "cookies/cookie_store_test_helpers.h",
drogerfd8b2772015-12-04 14:34:56532 "cookies/cookie_store_unittest.h",
[email protected]8603c5de2014-04-16 20:34:31533 "disk_cache/disk_cache_test_base.cc",
534 "disk_cache/disk_cache_test_base.h",
535 "disk_cache/disk_cache_test_util.cc",
536 "disk_cache/disk_cache_test_util.h",
537 "dns/dns_test_util.cc",
538 "dns/dns_test_util.h",
539 "dns/mock_host_resolver.cc",
540 "dns/mock_host_resolver.h",
541 "dns/mock_mdns_socket_factory.cc",
542 "dns/mock_mdns_socket_factory.h",
[email protected]8a3f8242014-06-05 18:05:12543 "http/http_transaction_test_util.cc",
544 "http/http_transaction_test_util.h",
vishal.b62985ca92015-04-17 08:45:51545 "log/test_net_log.cc",
546 "log/test_net_log.h",
mmenke43758e62015-05-04 21:09:46547 "log/test_net_log_entry.cc",
548 "log/test_net_log_entry.h",
mmenke0034c542015-05-05 22:34:59549 "log/test_net_log_util.cc",
mmenke43758e62015-05-04 21:09:46550 "log/test_net_log_util.h",
[email protected]8603c5de2014-04-16 20:34:31551 "proxy/mock_proxy_resolver.cc",
552 "proxy/mock_proxy_resolver.h",
553 "proxy/mock_proxy_script_fetcher.cc",
554 "proxy/mock_proxy_script_fetcher.h",
555 "proxy/proxy_config_service_common_unittest.cc",
556 "proxy/proxy_config_service_common_unittest.h",
557 "socket/socket_test_util.cc",
558 "socket/socket_test_util.h",
559 "test/cert_test_util.cc",
560 "test/cert_test_util.h",
[email protected]83e1ae32014-07-18 10:57:07561 "test/cert_test_util_nss.cc",
nharper2e171cf2015-06-01 20:29:23562 "test/channel_id_test_util.cc",
563 "test/channel_id_test_util.h",
[email protected]8603c5de2014-04-16 20:34:31564 "test/ct_test_util.cc",
565 "test/ct_test_util.h",
svaldez7d25c562015-10-30 19:09:45566 "test/embedded_test_server/default_handlers.cc",
567 "test/embedded_test_server/default_handlers.h",
[email protected]8603c5de2014-04-16 20:34:31568 "test/embedded_test_server/embedded_test_server.cc",
569 "test/embedded_test_server/embedded_test_server.h",
570 "test/embedded_test_server/http_connection.cc",
571 "test/embedded_test_server/http_connection.h",
572 "test/embedded_test_server/http_request.cc",
573 "test/embedded_test_server/http_request.h",
574 "test/embedded_test_server/http_response.cc",
575 "test/embedded_test_server/http_response.h",
svaldez6e7e82a22015-10-28 19:39:53576 "test/embedded_test_server/request_handler_util.cc",
577 "test/embedded_test_server/request_handler_util.h",
sammc6ac3fe52015-02-25 06:00:28578 "test/event_waiter.h",
[email protected]8603c5de2014-04-16 20:34:31579 "test/net_test_suite.cc",
580 "test/net_test_suite.h",
581 "test/python_utils.cc",
582 "test/python_utils.h",
brettw6315e032015-11-27 18:38:36583 "test/test_certificate_data.h",
sherouk51b4b098b2015-08-10 09:00:43584 "test/url_request/ssl_certificate_error_job.cc",
585 "test/url_request/ssl_certificate_error_job.h",
Brett Wilson32ce17a2014-11-10 17:45:30586 "test/url_request/url_request_failed_job.cc",
587 "test/url_request/url_request_failed_job.h",
mef3e826cf2014-12-13 18:40:40588 "test/url_request/url_request_mock_data_job.cc",
589 "test/url_request/url_request_mock_data_job.h",
jam8e45cd72015-01-20 16:33:44590 "test/url_request/url_request_slow_download_job.cc",
591 "test/url_request/url_request_slow_download_job.h",
[email protected]8603c5de2014-04-16 20:34:31592 "url_request/test_url_fetcher_factory.cc",
593 "url_request/test_url_fetcher_factory.h",
594 "url_request/url_request_test_util.cc",
595 "url_request/url_request_test_util.h",
596 ]
sherouk3eee4a82015-09-01 10:42:33597 if (!is_ios) {
598 sources += [
599 "test/spawned_test_server/base_test_server.cc",
600 "test/spawned_test_server/base_test_server.h",
601 "test/spawned_test_server/local_test_server.cc",
602 "test/spawned_test_server/local_test_server.h",
603 "test/spawned_test_server/local_test_server_posix.cc",
604 "test/spawned_test_server/local_test_server_win.cc",
605 "test/spawned_test_server/spawned_test_server.h",
606 ]
607 }
[email protected]8603c5de2014-04-16 20:34:31608
brettwbc8b2a22015-07-28 18:24:42609 configs += [
610 "//build/config:precompiled_headers",
611
612 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
613 "//build/config/compiler:no_size_t_to_int_warning",
614 ]
[email protected]8603c5de2014-04-16 20:34:31615
Brett Wilsone53895272014-09-23 23:41:46616 public_deps = [
[email protected]8603c5de2014-04-16 20:34:31617 "//base",
618 "//base/test:test_support",
[email protected]22fe91d2014-08-12 17:07:12619 "//crypto",
[email protected]59ff2d42014-04-22 22:25:23620 "//net",
[email protected]8603c5de2014-04-16 20:34:31621 "//net/tools/tld_cleanup",
622 "//testing/gmock",
623 "//testing/gtest",
624 "//url",
625 ]
626
sdefresne04f91142016-04-21 08:41:59627 deps = [
628 ":test_support_bundle_data",
629 ]
630
jamb533b7e2015-03-04 17:12:05631 if (!is_ios) {
632 public_deps += [ "//third_party/protobuf:py_proto" ]
633 }
634
svaldez2135be52016-04-20 16:34:53635 if (use_nss_certs) {
scottmg34fb7e52014-12-03 23:27:24636 public_deps += [ "//crypto:platform" ]
[email protected]8603c5de2014-04-16 20:34:31637 }
638
sherouk3eee4a82015-09-01 10:42:33639 if (is_android) {
640 sources += [
[email protected]8603c5de2014-04-16 20:34:31641 "test/spawned_test_server/remote_test_server.cc",
642 "test/spawned_test_server/remote_test_server.h",
643 "test/spawned_test_server/spawner_communicator.cc",
644 "test/spawned_test_server/spawner_communicator.h",
645 ]
646 }
647
648 if (use_v8_in_net) {
Brett Wilsone53895272014-09-23 23:41:46649 public_deps += [ ":net_with_v8" ]
[email protected]8603c5de2014-04-16 20:34:31650 }
651
652 if (!enable_mdns) {
653 sources -= [
654 "dns/mock_mdns_socket_factory.cc",
655 "dns/mock_mdns_socket_factory.h",
656 ]
657 }
658
davidben15d69d482014-09-29 18:24:08659 if (!use_nss_certs) {
scottmg34fb7e52014-12-03 23:27:24660 sources -= [ "test/cert_test_util_nss.cc" ]
[email protected]83e1ae32014-07-18 10:57:07661 }
xunjielia6888202015-04-14 21:34:25662
663 if (!disable_file_support) {
664 sources += [
665 "test/url_request/url_request_mock_http_job.cc",
666 "test/url_request/url_request_mock_http_job.h",
667 "url_request/test_url_request_interceptor.cc",
668 "url_request/test_url_request_interceptor.h",
669 ]
670 }
[email protected]8603c5de2014-04-16 20:34:31671}
672
[email protected]ceeaac792014-06-25 05:14:43673source_set("balsa") {
674 sources = [
675 "tools/balsa/balsa_enums.h",
676 "tools/balsa/balsa_frame.cc",
677 "tools/balsa/balsa_frame.h",
678 "tools/balsa/balsa_headers.cc",
679 "tools/balsa/balsa_headers.h",
680 "tools/balsa/balsa_headers_token_utils.cc",
681 "tools/balsa/balsa_headers_token_utils.h",
682 "tools/balsa/balsa_visitor_interface.h",
683 "tools/balsa/http_message_constants.cc",
684 "tools/balsa/http_message_constants.h",
685 "tools/balsa/noop_balsa_visitor.h",
686 "tools/balsa/simple_buffer.cc",
687 "tools/balsa/simple_buffer.h",
[email protected]ceeaac792014-06-25 05:14:43688 "tools/balsa/string_piece_utils.h",
rtennetie0ee6eb2015-05-01 00:55:09689 "tools/quic/spdy_balsa_utils.cc",
690 "tools/quic/spdy_balsa_utils.h",
[email protected]ceeaac792014-06-25 05:14:43691 ]
692 deps = [
693 ":net",
694 "//base",
[email protected]22fe91d2014-08-12 17:07:12695 "//url",
[email protected]ceeaac792014-06-25 05:14:43696 ]
697}
698
[email protected]8603c5de2014-04-16 20:34:31699if (use_v8_in_net) {
700 component("net_with_v8") {
701 sources = [
702 "proxy/proxy_resolver_v8.cc",
703 "proxy/proxy_resolver_v8.h",
704 "proxy/proxy_resolver_v8_tracing.cc",
705 "proxy/proxy_resolver_v8_tracing.h",
sammcf2d1ea02015-06-29 02:58:47706 "proxy/proxy_resolver_v8_tracing_wrapper.cc",
707 "proxy/proxy_resolver_v8_tracing_wrapper.h",
[email protected]8603c5de2014-04-16 20:34:31708 "proxy/proxy_service_v8.cc",
709 "proxy/proxy_service_v8.h",
710 ]
711
712 defines = [ "NET_IMPLEMENTATION" ]
dprankea22b0732015-10-21 21:15:11713
[email protected]8603c5de2014-04-16 20:34:31714 configs += [
brettwd1c719a2015-02-19 23:17:04715 "//build/config/compiler:no_size_t_to_int_warning",
[email protected]8603c5de2014-04-16 20:34:31716 "//build/config/compiler:wexit_time_destructors",
dprankea22b0732015-10-21 21:15:11717 "//v8:external_startup_data",
[email protected]8603c5de2014-04-16 20:34:31718 ]
719
Brett Wilsone53895272014-09-23 23:41:46720 public_deps = [
[email protected]8603c5de2014-04-16 20:34:31721 ":net",
Brett Wilsone53895272014-09-23 23:41:46722 ]
723 deps = [
[email protected]8603c5de2014-04-16 20:34:31724 "//base",
725 "//gin",
726 "//url",
727 "//v8",
728 ]
729 }
730}
731
amistry7e6ebfdc82015-02-13 04:19:11732if (use_v8_in_net && !is_android) {
733 source_set("net_browser_services") {
734 sources = [
735 "dns/mojo_host_resolver_impl.cc",
736 "dns/mojo_host_resolver_impl.h",
amistry6e1ed1b2015-03-12 05:24:01737 "proxy/in_process_mojo_proxy_resolver_factory.cc",
738 "proxy/in_process_mojo_proxy_resolver_factory.h",
sammc1d5df4d2015-05-05 05:06:17739 "proxy/mojo_proxy_resolver_factory.h",
eromandcacef22015-06-01 19:36:35740 "proxy/proxy_resolver_factory_mojo.cc",
741 "proxy/proxy_resolver_factory_mojo.h",
amistry6e1ed1b2015-03-12 05:24:01742 "proxy/proxy_service_mojo.cc",
743 "proxy/proxy_service_mojo.h",
amistry7e6ebfdc82015-02-13 04:19:11744 ]
745
746 public_deps = [
747 ":mojo_type_converters",
tfarina8ac4d17f2015-12-16 02:11:11748 ":net_with_v8",
brettwbc44c0a92015-02-20 22:30:39749 "//base",
amistry07ff1402015-03-10 07:34:07750 "//mojo/common",
rockot85dce0862015-11-13 01:33:59751 "//mojo/public/cpp/bindings",
amistry7e6ebfdc82015-02-13 04:19:11752 "//net/interfaces",
amistry6e1ed1b2015-03-12 05:24:01753
754 # NOTE(amistry): As long as we support in-process Mojo v8 PAC, we need
755 # this dependency since in_process_mojo_proxy_resolver_factory creates
756 # the utility process side Mojo services in the browser process.
757 # Ultimately, this will go away when we only support out-of-process.
758 ":net_utility_services",
amistry7e6ebfdc82015-02-13 04:19:11759 ]
760 }
761
762 source_set("mojo_type_converters") {
763 sources = [
amistry7ec58112015-02-26 06:03:00764 "dns/mojo_host_type_converters.cc",
765 "dns/mojo_host_type_converters.h",
766 "proxy/mojo_proxy_type_converters.cc",
767 "proxy/mojo_proxy_type_converters.h",
amistry7e6ebfdc82015-02-13 04:19:11768 ]
769
770 public_deps = [
771 ":net",
tfarina8ac4d17f2015-12-16 02:11:11772 "//base",
rockot85dce0862015-11-13 01:33:59773 "//mojo/public/cpp/bindings",
amistry7e6ebfdc82015-02-13 04:19:11774 "//net/interfaces",
amistry7e6ebfdc82015-02-13 04:19:11775 ]
776 }
sammc5403aa1d2015-02-25 04:59:21777
778 source_set("net_utility_services") {
779 sources = [
sammc6ac3fe52015-02-25 06:00:28780 "dns/host_resolver_mojo.cc",
781 "dns/host_resolver_mojo.h",
sammc352f7492015-02-25 09:45:24782 "proxy/mojo_proxy_resolver_factory_impl.cc",
783 "proxy/mojo_proxy_resolver_factory_impl.h",
sammc5403aa1d2015-02-25 04:59:21784 "proxy/mojo_proxy_resolver_impl.cc",
785 "proxy/mojo_proxy_resolver_impl.h",
sammca3242c92015-07-10 02:38:51786 "proxy/mojo_proxy_resolver_v8_tracing_bindings.h",
sammc5403aa1d2015-02-25 04:59:21787 ]
788
rockot9509ec82015-04-14 02:50:56789 deps = [
790 ":net_with_v8",
tfarina8ac4d17f2015-12-16 02:11:11791 "//base",
rockot9509ec82015-04-14 02:50:56792 ]
793
sammc5403aa1d2015-02-25 04:59:21794 public_deps = [
795 ":mojo_type_converters",
796 ":net",
797 "//mojo/common",
rockot85dce0862015-11-13 01:33:59798 "//mojo/public/cpp/bindings",
sammc5403aa1d2015-02-25 04:59:21799 "//net/interfaces",
sammc5403aa1d2015-02-25 04:59:21800 ]
801 }
amistry7e6ebfdc82015-02-13 04:19:11802}
803
[email protected]8603c5de2014-04-16 20:34:31804if (!is_ios && !is_android) {
805 executable("crash_cache") {
Brett Wilson8f80ad0b2014-09-08 19:50:24806 testonly = true
scottmg34fb7e52014-12-03 23:27:24807 sources = [
808 "tools/crash_cache/crash_cache.cc",
809 ]
dpranke43276212015-02-20 02:55:19810
brettwd1c719a2015-02-19 23:17:04811 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
812 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31813 deps = [
814 ":net",
[email protected]b2b2bf52014-05-28 20:26:57815 ":test_support",
[email protected]8603c5de2014-04-16 20:34:31816 "//base",
brettwba7a73d2015-08-31 22:17:39817 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:07818 "//build/win:default_exe_manifest",
[email protected]8603c5de2014-04-16 20:34:31819 ]
820 }
821
822 executable("crl_set_dump") {
Brett Wilson8f80ad0b2014-09-08 19:50:24823 testonly = true
scottmg34fb7e52014-12-03 23:27:24824 sources = [
825 "tools/crl_set_dump/crl_set_dump.cc",
826 ]
dpranke43276212015-02-20 02:55:19827
brettwd1c719a2015-02-19 23:17:04828 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
829 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31830 deps = [
831 ":net",
832 "//base",
brettwba7a73d2015-08-31 22:17:39833 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:07834 "//build/win:default_exe_manifest",
[email protected]8603c5de2014-04-16 20:34:31835 ]
836 }
837
838 executable("dns_fuzz_stub") {
Brett Wilson8f80ad0b2014-09-08 19:50:24839 testonly = true
scottmg34fb7e52014-12-03 23:27:24840 sources = [
841 "tools/dns_fuzz_stub/dns_fuzz_stub.cc",
842 ]
dpranke43276212015-02-20 02:55:19843
brettwd1c719a2015-02-19 23:17:04844 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
845 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31846 deps = [
847 ":net",
848 "//base",
brettwba7a73d2015-08-31 22:17:39849 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:07850 "//build/win:default_exe_manifest",
[email protected]8603c5de2014-04-16 20:34:31851 ]
852 }
853
854 executable("gdig") {
Brett Wilson8f80ad0b2014-09-08 19:50:24855 testonly = true
[email protected]8603c5de2014-04-16 20:34:31856 sources = [
857 "tools/gdig/file_net_log.cc",
858 "tools/gdig/gdig.cc",
859 ]
860 deps = [
861 ":net",
862 "//base",
brettwba7a73d2015-08-31 22:17:39863 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:07864 "//build/win:default_exe_manifest",
[email protected]8603c5de2014-04-16 20:34:31865 ]
866 }
867
868 executable("get_server_time") {
Brett Wilson8f80ad0b2014-09-08 19:50:24869 testonly = true
scottmg34fb7e52014-12-03 23:27:24870 sources = [
871 "tools/get_server_time/get_server_time.cc",
872 ]
dpranke43276212015-02-20 02:55:19873
brettwd1c719a2015-02-19 23:17:04874 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
875 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31876 deps = [
877 ":net",
878 "//base",
879 "//base:i18n",
brettwba7a73d2015-08-31 22:17:39880 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:07881 "//build/win:default_exe_manifest",
[email protected]8603c5de2014-04-16 20:34:31882 "//url",
883 ]
884 }
885
rockot9c67e5f2015-03-12 20:01:21886 executable("hpack_example_generator") {
887 testonly = true
888 sources = [
889 "spdy/fuzzing/hpack_example_generator.cc",
890 ]
891
892 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
893 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
894 deps = [
rockot9c67e5f2015-03-12 20:01:21895 ":net",
brettwba7a73d2015-08-31 22:17:39896 "//base",
897 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:07898 "//build/win:default_exe_manifest",
rockot9c67e5f2015-03-12 20:01:21899 ]
900 }
901
902 executable("hpack_fuzz_mutator") {
903 testonly = true
904 sources = [
905 "spdy/fuzzing/hpack_fuzz_mutator.cc",
906 ]
907
908 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
909 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
910 deps = [
rockot9c67e5f2015-03-12 20:01:21911 ":net",
brettwba7a73d2015-08-31 22:17:39912 "//base",
913 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:07914 "//build/win:default_exe_manifest",
rockot9c67e5f2015-03-12 20:01:21915 ]
916 }
917
918 executable("hpack_fuzz_wrapper") {
919 testonly = true
920 sources = [
921 "spdy/fuzzing/hpack_fuzz_wrapper.cc",
922 ]
923
924 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
925 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
926 deps = [
rockot9c67e5f2015-03-12 20:01:21927 ":net",
brettwba7a73d2015-08-31 22:17:39928 "//base",
929 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:07930 "//build/win:default_exe_manifest",
rockot9c67e5f2015-03-12 20:01:21931 ]
932 }
933
[email protected]8603c5de2014-04-16 20:34:31934 if (use_v8_in_net) {
935 executable("net_watcher") {
Brett Wilson8f80ad0b2014-09-08 19:50:24936 testonly = true
scottmg34fb7e52014-12-03 23:27:24937 sources = [
938 "tools/net_watcher/net_watcher.cc",
939 ]
[email protected]8603c5de2014-04-16 20:34:31940 deps = [
941 ":net",
942 ":net_with_v8",
943 "//base",
brettwba7a73d2015-08-31 22:17:39944 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:07945 "//build/win:default_exe_manifest",
[email protected]8603c5de2014-04-16 20:34:31946 ]
947
mostynbbf5e6cc2015-10-21 07:53:31948 if (is_desktop_linux && use_gconf && use_glib) {
xunjieli905496a2015-08-31 15:51:17949 configs += [
agrieve95ba4442016-04-25 15:47:13950 "//build/config/linux/gconf",
xunjieli905496a2015-08-31 15:51:17951 "//build/config/linux:glib",
952 ]
dprankead0c1f42015-08-28 21:48:04953 deps += [ "//build/linux:gio" ]
[email protected]8603c5de2014-04-16 20:34:31954 }
955 }
956 }
957
958 executable("run_testserver") {
Brett Wilson8f80ad0b2014-09-08 19:50:24959 testonly = true
scottmg34fb7e52014-12-03 23:27:24960 sources = [
961 "tools/testserver/run_testserver.cc",
962 ]
[email protected]8603c5de2014-04-16 20:34:31963 deps = [
[email protected]b2b2bf52014-05-28 20:26:57964 ":test_support",
[email protected]8603c5de2014-04-16 20:34:31965 "//base",
966 "//base/test:test_support",
brettwba7a73d2015-08-31 22:17:39967 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:07968 "//build/win:default_exe_manifest",
[email protected]8603c5de2014-04-16 20:34:31969 "//testing/gtest",
970 ]
971 }
972
973 executable("stress_cache") {
Brett Wilson8f80ad0b2014-09-08 19:50:24974 testonly = true
scottmg34fb7e52014-12-03 23:27:24975 sources = [
rvargase23fcf652015-03-04 19:59:22976 "tools/stress_cache/stress_cache.cc",
scottmg34fb7e52014-12-03 23:27:24977 ]
dpranke43276212015-02-20 02:55:19978
brettwd1c719a2015-02-19 23:17:04979 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
980 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31981 deps = [
982 ":net",
[email protected]b2b2bf52014-05-28 20:26:57983 ":test_support",
[email protected]8603c5de2014-04-16 20:34:31984 "//base",
brettwba7a73d2015-08-31 22:17:39985 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:07986 "//build/win:default_exe_manifest",
[email protected]8603c5de2014-04-16 20:34:31987 ]
988 }
989
990 executable("tld_cleanup") {
scottmg34fb7e52014-12-03 23:27:24991 sources = [
992 "tools/tld_cleanup/tld_cleanup.cc",
993 ]
dpranke43276212015-02-20 02:55:19994
brettwd1c719a2015-02-19 23:17:04995 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
996 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31997 deps = [
998 "//base",
999 "//base:i18n",
brettwba7a73d2015-08-31 22:17:391000 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:071001 "//build/win:default_exe_manifest",
[email protected]8603c5de2014-04-16 20:34:311002 "//net/tools/tld_cleanup",
1003 ]
1004 }
1005}
1006
rch6983a3f2015-03-30 03:47:281007if (is_linux) {
gabadie64af64a2016-03-29 16:36:421008 executable("cachetool") {
1009 testonly = true
1010 sources = [
1011 "tools/cachetool/cachetool.cc",
1012 ]
1013 deps = [
1014 ":net",
1015 ":test_support",
1016 "//base",
1017 ]
1018 }
1019
1020 executable("content_decoder_tool") {
1021 testonly = true
1022 sources = [
1023 "filter/mock_filter_context.cc",
1024 "filter/mock_filter_context.h",
1025 "tools/content_decoder_tool/content_decoder_tool.cc",
1026 ]
1027 deps = [
1028 ":net",
1029 ":test_support",
1030 "//base",
1031 "//url",
1032 ]
1033 }
1034
[email protected]8a3f8242014-06-05 18:05:121035 static_library("epoll_server") {
[email protected]8603c5de2014-04-16 20:34:311036 sources = [
1037 "tools/epoll_server/epoll_server.cc",
1038 "tools/epoll_server/epoll_server.h",
1039 ]
1040 deps = [
1041 ":net",
1042 "//base",
1043 ]
1044 }
1045
[email protected]8a3f8242014-06-05 18:05:121046 static_library("flip_in_mem_edsm_server_base") {
Brett Wilson8f80ad0b2014-09-08 19:50:241047 testonly = true
[email protected]8603c5de2014-04-16 20:34:311048 sources = [
[email protected]8603c5de2014-04-16 20:34:311049 "tools/flip_server/acceptor_thread.cc",
satorux933fc7a2015-02-13 07:09:101050 "tools/flip_server/acceptor_thread.h",
1051 "tools/flip_server/constants.h",
[email protected]8603c5de2014-04-16 20:34:311052 "tools/flip_server/flip_config.cc",
1053 "tools/flip_server/flip_config.h",
1054 "tools/flip_server/http_interface.cc",
1055 "tools/flip_server/http_interface.h",
[email protected]8603c5de2014-04-16 20:34:311056 "tools/flip_server/mem_cache.cc",
satorux933fc7a2015-02-13 07:09:101057 "tools/flip_server/mem_cache.h",
[email protected]8603c5de2014-04-16 20:34:311058 "tools/flip_server/output_ordering.cc",
1059 "tools/flip_server/output_ordering.h",
1060 "tools/flip_server/ring_buffer.cc",
1061 "tools/flip_server/ring_buffer.h",
1062 "tools/flip_server/sm_connection.cc",
1063 "tools/flip_server/sm_connection.h",
1064 "tools/flip_server/sm_interface.h",
[email protected]8603c5de2014-04-16 20:34:311065 "tools/flip_server/spdy_interface.cc",
1066 "tools/flip_server/spdy_interface.h",
satorux933fc7a2015-02-13 07:09:101067 "tools/flip_server/spdy_ssl.cc",
1068 "tools/flip_server/spdy_ssl.h",
[email protected]8603c5de2014-04-16 20:34:311069 "tools/flip_server/spdy_util.cc",
1070 "tools/flip_server/spdy_util.h",
1071 "tools/flip_server/streamer_interface.cc",
1072 "tools/flip_server/streamer_interface.h",
tfarinafb3c78c2016-02-09 22:13:521073 "tools/flip_server/tcp_socket_util.cc",
1074 "tools/flip_server/tcp_socket_util.h",
rvargas145310f2015-08-14 18:09:041075 "tools/flip_server/url_to_filename_encoder.cc",
1076 "tools/flip_server/url_to_filename_encoder.h",
1077 "tools/flip_server/url_utilities.cc",
1078 "tools/flip_server/url_utilities.h",
[email protected]8603c5de2014-04-16 20:34:311079 ]
1080 deps = [
1081 ":balsa",
1082 ":epoll_server",
1083 ":net",
1084 "//base",
[email protected]edfd0f42014-07-22 18:20:371085 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311086 ]
1087 }
1088
1089 executable("flip_in_mem_edsm_server_unittests") {
Brett Wilson8f80ad0b2014-09-08 19:50:241090 testonly = true
[email protected]8603c5de2014-04-16 20:34:311091 sources = [
1092 "tools/flip_server/flip_test_utils.cc",
1093 "tools/flip_server/flip_test_utils.h",
1094 "tools/flip_server/http_interface_test.cc",
1095 "tools/flip_server/mem_cache_test.cc",
1096 "tools/flip_server/run_all_tests.cc",
1097 "tools/flip_server/spdy_interface_test.cc",
rvargas145310f2015-08-14 18:09:041098 "tools/flip_server/url_to_filename_encoder_unittest.cc",
1099 "tools/flip_server/url_utilities_unittest.cc",
[email protected]8603c5de2014-04-16 20:34:311100 ]
1101 deps = [
brettwbc44c0a92015-02-20 22:30:391102 ":balsa",
[email protected]8603c5de2014-04-16 20:34:311103 ":flip_in_mem_edsm_server_base",
1104 ":net",
[email protected]b2b2bf52014-05-28 20:26:571105 ":test_support",
brettwba7a73d2015-08-31 22:17:391106 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:311107 "//testing/gmock",
agrieved7a71c882015-11-20 19:53:281108 "//testing/gtest",
[email protected]edfd0f42014-07-22 18:20:371109 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311110 ]
1111 }
1112
1113 executable("flip_in_mem_edsm_server") {
Brett Wilson8f80ad0b2014-09-08 19:50:241114 testonly = true
scottmg34fb7e52014-12-03 23:27:241115 sources = [
1116 "tools/flip_server/flip_in_mem_edsm_server.cc",
1117 ]
[email protected]8603c5de2014-04-16 20:34:311118 deps = [
brettwbc44c0a92015-02-20 22:30:391119 ":balsa",
[email protected]8603c5de2014-04-16 20:34:311120 ":flip_in_mem_edsm_server_base",
1121 ":net",
1122 "//base",
brettwba7a73d2015-08-31 22:17:391123 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:311124 ]
1125 }
1126
rch216445c2015-03-27 00:23:281127 source_set("epoll_quic_tools") {
[email protected]8603c5de2014-04-16 20:34:311128 sources = [
1129 "tools/quic/quic_client.cc",
1130 "tools/quic/quic_client.h",
[email protected]8603c5de2014-04-16 20:34:311131 "tools/quic/quic_default_packet_writer.cc",
1132 "tools/quic/quic_default_packet_writer.h",
rch16c74d1d2016-04-22 06:14:071133 "tools/quic/quic_epoll_alarm_factory.cc",
1134 "tools/quic/quic_epoll_alarm_factory.h",
[email protected]8603c5de2014-04-16 20:34:311135 "tools/quic/quic_epoll_clock.cc",
1136 "tools/quic/quic_epoll_clock.h",
1137 "tools/quic/quic_epoll_connection_helper.cc",
1138 "tools/quic/quic_epoll_connection_helper.h",
rtennetifb3fa6c2015-03-16 23:04:551139 "tools/quic/quic_packet_reader.cc",
1140 "tools/quic/quic_packet_reader.h",
[email protected]8603c5de2014-04-16 20:34:311141 "tools/quic/quic_packet_writer_wrapper.cc",
1142 "tools/quic/quic_packet_writer_wrapper.h",
1143 "tools/quic/quic_server.cc",
1144 "tools/quic/quic_server.h",
[email protected]8603c5de2014-04-16 20:34:311145 "tools/quic/quic_socket_utils.cc",
1146 "tools/quic/quic_socket_utils.h",
[email protected]8603c5de2014-04-16 20:34:311147 ]
1148 deps = [
1149 ":balsa",
1150 ":epoll_server",
1151 ":net",
tfarina8ac4d17f2015-12-16 02:11:111152 ":simple_quic_tools",
[email protected]8603c5de2014-04-16 20:34:311153 "//base",
1154 "//base/third_party/dynamic_annotations",
1155 "//crypto",
[email protected]edfd0f42014-07-22 18:20:371156 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311157 "//url",
1158 ]
1159 }
1160
rch216445c2015-03-27 00:23:281161 executable("epoll_quic_client") {
scottmg34fb7e52014-12-03 23:27:241162 sources = [
1163 "tools/quic/quic_client_bin.cc",
1164 ]
[email protected]8603c5de2014-04-16 20:34:311165 deps = [
brettwbc44c0a92015-02-20 22:30:391166 ":balsa",
rch216445c2015-03-27 00:23:281167 ":epoll_quic_tools",
agrieved7a71c882015-11-20 19:53:281168 ":epoll_server",
rch216445c2015-03-27 00:23:281169 ":net",
1170 ":simple_quic_tools",
1171 "//base",
brettwba7a73d2015-08-31 22:17:391172 "//build/config/sanitizers:deps",
rch216445c2015-03-27 00:23:281173 "//third_party/boringssl",
1174 ]
1175 }
1176
1177 executable("epoll_quic_server") {
1178 sources = [
1179 "tools/quic/quic_server_bin.cc",
1180 ]
1181 deps = [
1182 ":balsa",
rch216445c2015-03-27 00:23:281183 ":epoll_quic_tools",
agrieved7a71c882015-11-20 19:53:281184 ":epoll_server",
[email protected]8603c5de2014-04-16 20:34:311185 ":net",
rchda78df5a2015-03-22 05:16:371186 ":simple_quic_tools",
[email protected]8603c5de2014-04-16 20:34:311187 "//base",
brettwba7a73d2015-08-31 22:17:391188 "//build/config/sanitizers:deps",
[email protected]edfd0f42014-07-22 18:20:371189 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311190 ]
1191 }
[email protected]8603c5de2014-04-16 20:34:311192}
1193
[email protected]ef0eb442014-05-15 09:32:181194if (is_android) {
1195 generate_jni("net_jni_headers") {
1196 sources = [
1197 "android/java/src/org/chromium/net/AndroidCertVerifyResult.java",
1198 "android/java/src/org/chromium/net/AndroidKeyStore.java",
1199 "android/java/src/org/chromium/net/AndroidNetworkLibrary.java",
tbansal59a1ddc2015-09-14 17:35:011200 "android/java/src/org/chromium/net/AndroidTrafficStats.java",
[email protected]ef0eb442014-05-15 09:32:181201 "android/java/src/org/chromium/net/GURLUtils.java",
aberentec894a52015-07-09 14:45:531202 "android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java",
xunjieli905496a2015-08-31 15:51:171203 "android/java/src/org/chromium/net/NetStringUtil.java",
[email protected]ef0eb442014-05-15 09:32:181204 "android/java/src/org/chromium/net/NetworkChangeNotifier.java",
1205 "android/java/src/org/chromium/net/ProxyChangeListener.java",
1206 "android/java/src/org/chromium/net/X509Util.java",
1207 ]
1208 jni_package = "net"
1209 }
cjhopmandad5f4272014-09-05 01:00:551210 generate_jni("net_test_jni_headers") {
1211 sources = [
1212 "android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java",
aberentec894a52015-07-09 14:45:531213 "test/android/javatests/src/org/chromium/net/test/DummySpnegoAuthenticator.java",
jbudorickccffb982015-12-22 01:21:351214 "test/android/javatests/src/org/chromium/net/test/EmbeddedTestServerImpl.java",
cjhopmandad5f4272014-09-05 01:00:551215 ]
brettwcdccaf02015-07-27 16:27:091216 jni_package = "net/test"
cjhopmandad5f4272014-09-05 01:00:551217 }
[email protected]ef0eb442014-05-15 09:32:181218}
[email protected]8603c5de2014-04-16 20:34:311219
1220if (is_android || is_linux) {
1221 executable("disk_cache_memory_test") {
Brett Wilson8f80ad0b2014-09-08 19:50:241222 testonly = true
scottmg34fb7e52014-12-03 23:27:241223 sources = [
1224 "tools/disk_cache_memory_test/disk_cache_memory_test.cc",
1225 ]
[email protected]8603c5de2014-04-16 20:34:311226 deps = [
1227 ":net",
1228 "//base",
brettwba7a73d2015-08-31 22:17:391229 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:311230 ]
1231 }
1232}
[email protected]8a3f8242014-06-05 18:05:121233
rch47ad01f2015-03-20 21:17:231234source_set("simple_quic_tools") {
rcha9d12ce12015-03-19 23:06:491235 sources = [
rtennetid67b3a722015-08-18 05:15:311236 "tools/quic/quic_client_base.cc",
1237 "tools/quic/quic_client_base.h",
rched113b22015-03-26 04:54:051238 "tools/quic/quic_client_session.cc",
1239 "tools/quic/quic_client_session.h",
rchc99f380c2015-03-26 19:50:561240 "tools/quic/quic_dispatcher.cc",
1241 "tools/quic/quic_dispatcher.h",
rch0e945472015-03-26 15:19:211242 "tools/quic/quic_in_memory_cache.cc",
1243 "tools/quic/quic_in_memory_cache.h",
rchc99f380c2015-03-26 19:50:561244 "tools/quic/quic_per_connection_packet_writer.cc",
1245 "tools/quic/quic_per_connection_packet_writer.h",
brettw25ca8922016-03-18 22:59:581246 "tools/quic/quic_process_packet_interface.h",
jokulikc971baf92016-01-06 00:36:391247 "tools/quic/quic_server_session_base.cc",
1248 "tools/quic/quic_server_session_base.h",
rcha9d12ce12015-03-19 23:06:491249 "tools/quic/quic_simple_client.cc",
1250 "tools/quic/quic_simple_client.h",
rch216445c2015-03-27 00:23:281251 "tools/quic/quic_simple_per_connection_packet_writer.cc",
1252 "tools/quic/quic_simple_per_connection_packet_writer.h",
1253 "tools/quic/quic_simple_server.cc",
1254 "tools/quic/quic_simple_server.h",
1255 "tools/quic/quic_simple_server_packet_writer.cc",
1256 "tools/quic/quic_simple_server_packet_writer.h",
jokulikc971baf92016-01-06 00:36:391257 "tools/quic/quic_simple_server_session.cc",
1258 "tools/quic/quic_simple_server_session.h",
danzhb7551342015-12-18 02:06:401259 "tools/quic/quic_simple_server_stream.cc",
1260 "tools/quic/quic_simple_server_stream.h",
rched113b22015-03-26 04:54:051261 "tools/quic/quic_spdy_client_stream.cc",
1262 "tools/quic/quic_spdy_client_stream.h",
rch0e945472015-03-26 15:19:211263 "tools/quic/quic_time_wait_list_manager.cc",
1264 "tools/quic/quic_time_wait_list_manager.h",
rchda78df5a2015-03-22 05:16:371265 "tools/quic/synchronous_host_resolver.cc",
1266 "tools/quic/synchronous_host_resolver.h",
rcha9d12ce12015-03-19 23:06:491267 ]
1268 deps = [
tfarina8ac4d17f2015-12-16 02:11:111269 ":balsa",
rcha9d12ce12015-03-19 23:06:491270 ":net",
1271 "//base",
rch47ad01f2015-03-20 21:17:231272 "//base/third_party/dynamic_annotations",
1273 "//url",
1274 ]
1275}
1276
ricea7afa5232015-12-01 20:55:231277action_foreach("stale_while_revalidate_experiment_domains_dafsa") {
1278 script = "//net/tools/dafsa/make_dafsa.py"
1279 sources = [
1280 "base/stale_while_revalidate_experiment_domains.gperf",
1281 ]
1282 outputs = [
1283 "${target_gen_dir}/base/{{source_name_part}}-inc.cc",
1284 ]
1285 args = [
1286 "{{source}}",
1287 rebase_path("${target_gen_dir}/base/{{source_name_part}}-inc.cc",
1288 root_build_dir),
1289 ]
1290}
1291
1292source_set("stale_while_revalidate_experiment_domains") {
1293 sources = [
1294 "base/stale_while_revalidate_experiment_domains.cc",
1295 "base/stale_while_revalidate_experiment_domains.h",
1296 ]
1297 deps = [
1298 ":net",
1299 ":stale_while_revalidate_experiment_domains_dafsa",
1300 "//base",
1301 ]
kapishnikovabe280e2016-04-14 19:07:161302 configs += net_configs
ricea7afa5232015-12-01 20:55:231303}
1304
sherouk51b4b098b2015-08-10 09:00:431305if (!is_ios) {
1306 executable("quic_client") {
1307 sources = [
1308 "tools/quic/quic_simple_client_bin.cc",
1309 ]
1310 deps = [
1311 ":net",
1312 ":simple_quic_tools",
1313 "//base",
brettwba7a73d2015-08-31 22:17:391314 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:071315 "//build/win:default_exe_manifest",
sherouk51b4b098b2015-08-10 09:00:431316 "//url",
1317 ]
1318 }
1319 executable("quic_server") {
1320 sources = [
1321 "tools/quic/quic_simple_server_bin.cc",
1322 ]
1323 deps = [
1324 ":net",
1325 ":simple_quic_tools",
1326 "//base",
brettwba7a73d2015-08-31 22:17:391327 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:071328 "//build/win:default_exe_manifest",
sherouk51b4b098b2015-08-10 09:00:431329 "//third_party/boringssl",
1330 "//third_party/protobuf:protobuf_lite",
1331 ]
1332 }
rch216445c2015-03-27 00:23:281333}
1334
sdefresneb0a31642016-03-18 11:04:451335bundle_data("net_unittests_bundle_data") {
1336 testonly = true
sdefresne04f91142016-04-21 08:41:591337 sources = gypi_values.net_unittests_data_sources
sdefresneb0a31642016-03-18 11:04:451338 outputs = [
1339 "{{bundle_resources_dir}}/" +
1340 "{{source_root_relative_dir}}/{{source_file_part}}",
1341 ]
1342}
1343
dpranke64df2832015-07-31 22:33:361344test("net_unittests") {
1345 sources = gypi_values.net_test_sources
1346
1347 configs += [
1348 "//build/config:precompiled_headers",
1349
1350 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1351 "//build/config/compiler:no_size_t_to_int_warning",
1352 ]
1353 defines = []
1354
1355 deps = [
1356 ":balsa",
1357 ":extras",
dpranke64df2832015-07-31 22:33:361358 ":net",
sdefresneb0a31642016-03-18 11:04:451359 ":net_unittests_bundle_data",
dpranke64df2832015-07-31 22:33:361360 ":simple_quic_tools",
ricea7afa5232015-12-01 20:55:231361 ":stale_while_revalidate_experiment_domains",
dpranke64df2832015-07-31 22:33:361362 ":test_support",
1363 "//base",
1364 "//base:i18n",
dpranke64df2832015-07-31 22:33:361365 "//base/third_party/dynamic_annotations",
1366 "//crypto",
1367 "//crypto:platform",
1368 "//crypto:test_support",
dpranke64df2832015-07-31 22:33:361369 "//net/base/registry_controlled_domains",
1370 "//sql",
1371 "//testing/gmock",
1372 "//testing/gtest",
1373 "//third_party/zlib",
1374 "//url",
kapishnikovabe280e2016-04-14 19:07:161375 "//url:url_features",
dpranke64df2832015-07-31 22:33:361376 ]
1377
1378 data = [
1379 "data/",
1380 ]
svaldez2135be52016-04-20 16:34:531381 data_deps = [
1382 "third_party/nist-pkits/",
1383 ]
dpranke64df2832015-07-31 22:33:361384
1385 if (is_linux || is_mac || is_win) {
1386 deps += [
1387 "//third_party/pyftpdlib/",
1388 "//third_party/pywebsocket/",
1389 "//third_party/tlslite/",
1390 ]
mattm6586b432016-02-12 04:52:391391 data_deps += [
dpranke64df2832015-07-31 22:33:361392 "//third_party/pyftpdlib/",
1393 "//third_party/pywebsocket/",
1394 "//third_party/tlslite/",
1395 ]
1396 data += [
1397 "tools/testserver/",
1398 "//third_party/pyftpdlib/",
1399 "//third_party/pywebsocket/",
1400 "//third_party/tlslite/",
1401 "$root_out_dir/pyproto/google/",
dprankef497c7962015-07-31 19:46:231402 ]
1403 }
1404
dpranke64df2832015-07-31 22:33:361405 if (is_desktop_linux) {
1406 deps += [ ":epoll_quic_tools" ]
1407 }
1408 if (is_linux) {
1409 sources += gypi_values.net_linux_test_sources
1410 deps += [
1411 ":epoll_quic_tools",
1412 ":epoll_server",
1413 ":flip_in_mem_edsm_server_base",
brettwbc8b2a22015-07-28 18:24:421414 ]
dpranke64df2832015-07-31 22:33:361415 }
[email protected]8a3f8242014-06-05 18:05:121416
dpranke64df2832015-07-31 22:33:361417 if (is_mac || is_ios) {
1418 sources += gypi_values.net_base_test_mac_ios_sources
1419 }
1420
1421 if (is_chromeos) {
1422 sources -= [ "proxy/proxy_config_service_linux_unittest.cc" ]
1423 }
1424
1425 if (v8_use_external_startup_data) {
1426 deps += [ "//gin" ]
1427 }
1428
1429 if (!use_nss_certs) {
1430 sources -= [
1431 "cert/nss_cert_database_unittest.cc",
1432 "ssl/client_cert_store_nss_unittest.cc",
[email protected]8a3f8242014-06-05 18:05:121433 ]
dpranke64df2832015-07-31 22:33:361434 if (is_chromeos) { # Already removed for all non-ChromeOS builds.
davidben2bcbc6b2015-04-22 02:36:411435 sources -= [
dpranke64df2832015-07-31 22:33:361436 "cert/nss_cert_database_chromeos_unittest.cc",
1437 "cert/nss_profile_filter_chromeos_unittest.cc",
davidben2bcbc6b2015-04-22 02:36:411438 ]
brettw43ae0e12015-07-14 22:12:361439 }
[email protected]8a3f8242014-06-05 18:05:121440 }
dpranke64df2832015-07-31 22:33:361441
dpranke64df2832015-07-31 22:33:361442 if (use_kerberos) {
1443 defines += [ "USE_KERBEROS" ]
1444 }
1445
1446 # These are excluded on Android, because the actual Kerberos support, which
1447 # these test, is in a separate app on Android.
1448 if (!use_kerberos || is_android) {
1449 sources -= [
1450 "http/http_auth_gssapi_posix_unittest.cc",
1451 "http/mock_gssapi_library_posix.cc",
1452 "http/mock_gssapi_library_posix.h",
1453 ]
1454 }
1455 if (!use_kerberos) {
1456 sources -= [ "http/http_auth_handler_negotiate_unittest.cc" ]
1457 }
1458
svaldez2135be52016-04-20 16:34:531459 if (!use_nss_certs) {
svaldeza1714ab2016-03-18 20:47:531460 # Only include this test when using NSS for cert verification.
dpranke64df2832015-07-31 22:33:361461 sources -= [ "cert_net/nss_ocsp_unittest.cc" ]
1462 }
1463
1464 if (!use_openssl_certs) {
1465 sources -= [ "ssl/openssl_client_key_store_unittest.cc" ]
1466 }
1467
jbudorick1273a842016-04-01 19:50:051468 if (enable_websockets) {
1469 sources += gypi_values.net_websockets_test_sources
1470 deps += [ ":http_server" ]
dpranke64df2832015-07-31 22:33:361471 }
1472
1473 if (disable_file_support) {
1474 sources -= [
1475 "base/directory_lister_unittest.cc",
Thiago Farinad673bb122016-01-06 23:18:161476 "base/directory_listing_unittest.cc",
shahriar.rostamia8c06daf2016-02-12 00:07:041477 "url_request/url_request_file_dir_job_unittest.cc",
dpranke64df2832015-07-31 22:33:361478 "url_request/url_request_file_job_unittest.cc",
1479 ]
1480 }
1481
1482 if (disable_ftp_support) {
1483 sources -= [
1484 "ftp/ftp_auth_cache_unittest.cc",
1485 "ftp/ftp_ctrl_response_buffer_unittest.cc",
1486 "ftp/ftp_directory_listing_parser_ls_unittest.cc",
dpranke64df2832015-07-31 22:33:361487 "ftp/ftp_directory_listing_parser_unittest.cc",
1488 "ftp/ftp_directory_listing_parser_unittest.h",
1489 "ftp/ftp_directory_listing_parser_vms_unittest.cc",
1490 "ftp/ftp_directory_listing_parser_windows_unittest.cc",
1491 "ftp/ftp_network_transaction_unittest.cc",
1492 "ftp/ftp_util_unittest.cc",
1493 "url_request/url_request_ftp_job_unittest.cc",
1494 ]
1495 }
1496
1497 if (!enable_built_in_dns) {
1498 sources -= [
1499 "dns/address_sorter_posix_unittest.cc",
1500 "dns/address_sorter_unittest.cc",
1501 ]
1502 }
1503
xunjieli905496a2015-08-31 15:51:171504 if (use_v8_in_net) {
dpranke64df2832015-07-31 22:33:361505 deps += [ ":net_with_v8" ]
1506 } else {
1507 sources -= [
1508 "proxy/proxy_resolver_v8_tracing_unittest.cc",
1509 "proxy/proxy_resolver_v8_tracing_wrapper_unittest.cc",
1510 "proxy/proxy_resolver_v8_unittest.cc",
1511 ]
1512 }
1513
1514 if (use_v8_in_net && !is_android) {
1515 deps += [
1516 ":net_browser_services",
1517 ":net_utility_services",
rockotc637caf9b2016-02-10 09:57:081518 "//mojo/edk/system",
dpranke64df2832015-07-31 22:33:361519 ]
1520 } else {
1521 sources -= [
1522 "dns/host_resolver_mojo_unittest.cc",
1523 "dns/mojo_host_resolver_impl_unittest.cc",
1524 "proxy/mojo_proxy_resolver_factory_impl_unittest.cc",
1525 "proxy/mojo_proxy_resolver_impl_unittest.cc",
1526 "proxy/mojo_proxy_resolver_v8_tracing_bindings_unittest.cc",
1527 "proxy/proxy_resolver_factory_mojo_unittest.cc",
1528 "proxy/proxy_service_mojo_unittest.cc",
1529 ]
1530 }
1531
1532 if (!enable_mdns) {
1533 sources -= [
1534 "dns/mdns_cache_unittest.cc",
1535 "dns/mdns_client_unittest.cc",
1536 "dns/record_parsed_unittest.cc",
1537 "dns/record_rdata_unittest.cc",
1538 ]
1539 }
1540
1541 if (is_ios) {
dpranke64df2832015-07-31 22:33:361542 sources -= [
1543 # TODO(droger): The following tests are disabled because the
1544 # implementation is missing or incomplete.
1545 # KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS.
1546 "base/keygen_handler_unittest.cc",
1547 "disk_cache/backend_unittest.cc",
1548 "disk_cache/blockfile/block_files_unittest.cc",
1549
1550 # Need to read input data files.
1551 "filter/gzip_filter_unittest.cc",
1552 "socket/ssl_server_socket_unittest.cc",
1553 "spdy/fuzzing/hpack_fuzz_util_test.cc",
1554
1555 # Need TestServer.
1556 "cert_net/cert_net_fetcher_impl_unittest.cc",
1557 "proxy/proxy_script_fetcher_impl_unittest.cc",
1558 "socket/ssl_client_socket_unittest.cc",
1559 "url_request/url_fetcher_impl_unittest.cc",
1560 "url_request/url_request_context_builder_unittest.cc",
1561
1562 # Needs GetAppOutput().
1563 "test/python_utils_unittest.cc",
1564
1565 # The following tests are disabled because they don't apply to
1566 # iOS.
1567 # OS is not "linux" or "freebsd" or "openbsd".
1568 "socket/unix_domain_client_socket_posix_unittest.cc",
1569 "socket/unix_domain_server_socket_posix_unittest.cc",
dpranke64df2832015-07-31 22:33:361570 ]
1571 }
1572
kapishnikovabe280e2016-04-14 19:07:161573 # Unit tests that aren't supported by the current ICU alternatives on Android.
1574 if (is_android && use_platform_icu_alternatives) {
1575 sources -= [
1576 "base/filename_util_unittest.cc",
1577 "base/url_util_unittest.cc",
1578 "cert/x509_certificate_unittest.cc",
1579 "proxy/proxy_resolver_v8_unittest.cc",
1580 "url_request/url_request_job_unittest.cc",
1581 ]
1582 }
1583
1584 # Unit tests that are not supported by the current ICU alternatives on iOS.
1585 if (is_ios && use_platform_icu_alternatives) {
1586 sources -= [
1587 "base/filename_util_unittest.cc",
1588 "base/url_util_unittest.cc",
1589 "cert/x509_certificate_unittest.cc",
1590 "http/http_auth_handler_basic_unittest.cc",
1591 "http/http_auth_handler_digest_unittest.cc",
1592 "http/http_auth_handler_factory_unittest.cc",
1593 "http/http_auth_unittest.cc",
1594 "http/http_content_disposition_unittest.cc",
1595 "http/http_network_transaction_unittest.cc",
1596 "http/http_proxy_client_socket_pool_unittest.cc",
1597 "socket/ssl_client_socket_pool_unittest.cc",
1598 "spdy/spdy_network_transaction_unittest.cc",
1599 "spdy/spdy_proxy_client_socket_unittest.cc",
1600 "url_request/url_request_job_unittest.cc",
1601 "url_request/url_request_unittest.cc",
1602 ]
1603 }
1604
1605 # Exclude brotli test if the support for brotli is disabled.
1606 # Also, exclude the test from iOS for now (needs to read input data files).
1607 if (disable_brotli_filter || is_ios) {
1608 sources -= [ "filter/brotli_filter_unittest.cc" ]
1609 }
1610
dpranke64df2832015-07-31 22:33:361611 if (is_android) {
agrieve732db3a2016-04-26 19:18:191612 data_deps += [ "//net/tools/testserver:testserver_py" ]
agrieve97176362015-12-01 16:36:191613 deps += [
1614 ":net_test_jni_headers",
agrievea5517aa2015-10-23 03:03:451615 "//base:base_java_unittest_support",
1616 "//net/android:net_java",
agrievea5517aa2015-10-23 03:03:451617 "//net/android:net_java_test_support",
agrieve97176362015-12-01 16:36:191618 "//net/android:net_javatests",
agrievea5517aa2015-10-23 03:03:451619 "//net/android:net_unittests_apk_resources",
agrieve97176362015-12-01 16:36:191620
1621 # TODO(mmenke): This depends on test_support_base, which depends on
1622 # icu. Figure out a way to remove that dependency.
1623 "//testing/android/native_test:native_test_native_code",
pkotwicz8c7027d2015-11-11 06:30:071624 "//v8:v8_external_startup_data_assets",
agrievea5517aa2015-10-23 03:03:451625 ]
1626 android_manifest = "//net/android/unittest_support/AndroidManifest.xml"
dpranke64df2832015-07-31 22:33:361627 set_sources_assignment_filter([])
1628 sources += [ "base/address_tracker_linux_unittest.cc" ]
1629 set_sources_assignment_filter(sources_assignment_filter)
agrieve3ac557f02016-04-12 15:52:001630 shard_timeout = 300
dpranke64df2832015-07-31 22:33:361631 }
1632
dpranke64df2832015-07-31 22:33:361633 # Symbols for crashes when running tests on swarming.
1634 if (symbol_level > 0) {
1635 if (is_win) {
1636 data += [ "$root_out_dir/net_unittests.exe.pdb" ]
1637 } else if (is_mac) {
dprankede2945b82016-04-15 22:14:131638 # TODO(crbug.com/330301): make this conditional on mac_strip_release.
1639 # data += [ "$root_out_dir/net_unittests.dSYM/" ]
dpranke64df2832015-07-31 22:33:361640 }
1641 }
1642}
1643
1644# !is_android && !is_win && !is_mac
sdefresne3001f172016-03-16 10:30:031645if (!is_ios) {
1646 # TODO(crbug.com/594965): this should be converted to "app" template and
1647 # enabled on iOS too.
1648 executable("net_perftests") {
1649 testonly = true
1650 sources = [
1651 "base/mime_sniffer_perftest.cc",
1652 "cookies/cookie_monster_perftest.cc",
1653 "disk_cache/blockfile/disk_cache_perftest.cc",
1654 "extras/sqlite/sqlite_persistent_cookie_store_perftest.cc",
1655 "proxy/proxy_resolver_perftest.cc",
1656 "udp/udp_socket_perftest.cc",
1657 ]
[email protected]8a3f8242014-06-05 18:05:121658
sdefresne3001f172016-03-16 10:30:031659 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1660 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1661 deps = [
1662 ":extras",
1663 ":net",
1664 ":test_support",
1665 "//base",
1666 "//base:i18n",
1667 "//base/test:test_support_perf",
1668 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:071669 "//build/win:default_exe_manifest",
sdefresne3001f172016-03-16 10:30:031670 "//testing/gtest",
1671 "//url",
1672 ]
rockot9c67e5f2015-03-12 20:01:211673
sdefresne3001f172016-03-16 10:30:031674 if (enable_websockets) {
1675 sources += [ "websockets/websocket_frame_perftest.cc" ]
1676 }
rockot9c67e5f2015-03-12 20:01:211677
sdefresne3001f172016-03-16 10:30:031678 if (use_v8_in_net) {
1679 deps += [ ":net_with_v8" ]
1680 } else {
1681 sources -= [ "proxy/proxy_resolver_perftest.cc" ]
1682 }
rockot9c67e5f2015-03-12 20:01:211683 }
rockot9c67e5f2015-03-12 20:01:211684}
mefff34b822016-01-11 15:28:081685
eromanfe8659e2016-03-02 23:47:021686# Fuzzers
1687
eroman02b4fe562016-03-04 12:15:161688source_set("net_fuzzer_test_support") {
1689 testonly = true
1690
1691 sources = [
mmenkec951d412016-04-28 19:05:221692 "base/fuzzed_data_provider.cc",
1693 "base/fuzzed_data_provider.h",
eroman02b4fe562016-03-04 12:15:161694 "base/fuzzer_test_support.cc",
mmenke99b57172016-04-14 20:44:331695 "socket/fuzzed_socket.cc",
1696 "socket/fuzzed_socket.h",
mmenkec951d412016-04-28 19:05:221697 "socket/fuzzed_socket_factory.cc",
1698 "socket/fuzzed_socket_factory.h",
eroman02b4fe562016-03-04 12:15:161699 ]
1700 deps = [
1701 "//base",
1702 "//base:i18n",
mmenke99b57172016-04-14 20:44:331703 "//net",
eroman02b4fe562016-03-04 12:15:161704 ]
1705}
1706
mmenke5552a6a2016-03-28 23:11:591707fuzzer_test("net_mime_sniffer_fuzzer") {
1708 sources = [
1709 "base/mime_sniffer_fuzzer.cc",
1710 ]
1711 deps = [
1712 ":net_fuzzer_test_support",
1713 "//base",
1714 "//net",
1715 ]
1716}
1717
mmoroz565e8df22016-03-04 18:17:201718fuzzer_test("net_parse_proxy_list_pac_fuzzer") {
eromane6264fd2016-03-02 22:46:301719 sources = [
1720 "proxy/parse_proxy_list_pac_fuzzer.cc",
1721 ]
1722 deps = [
eroman02b4fe562016-03-04 12:15:161723 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301724 "//net",
1725 ]
1726}
1727
mmoroz565e8df22016-03-04 18:17:201728fuzzer_test("net_parse_proxy_list_fuzzer") {
eromane6264fd2016-03-02 22:46:301729 sources = [
1730 "proxy/parse_proxy_list_fuzzer.cc",
1731 ]
1732 deps = [
eroman02b4fe562016-03-04 12:15:161733 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301734 "//net",
1735 ]
1736}
1737
mmoroz565e8df22016-03-04 18:17:201738fuzzer_test("net_parse_proxy_bypass_rules_fuzzer") {
eromane6264fd2016-03-02 22:46:301739 sources = [
1740 "proxy/parse_proxy_bypass_rules_fuzzer.cc",
1741 ]
1742 deps = [
eroman02b4fe562016-03-04 12:15:161743 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301744 "//net",
1745 ]
1746}
1747
mmoroz565e8df22016-03-04 18:17:201748fuzzer_test("net_parse_proxy_rules_fuzzer") {
eromane6264fd2016-03-02 22:46:301749 sources = [
1750 "proxy/parse_proxy_rules_fuzzer.cc",
1751 ]
1752 deps = [
eroman02b4fe562016-03-04 12:15:161753 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301754 "//net",
1755 ]
1756}
1757
mmoroz565e8df22016-03-04 18:17:201758fuzzer_test("net_parse_data_url_fuzzer") {
eromane6264fd2016-03-02 22:46:301759 sources = [
1760 "base/parse_data_url_fuzzer.cc",
1761 ]
1762 deps = [
eroman02b4fe562016-03-04 12:15:161763 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301764 "//base",
1765 "//net",
1766 ]
1767}
1768
mmoroz565e8df22016-03-04 18:17:201769fuzzer_test("net_parse_ip_pattern_fuzzer") {
eromane6264fd2016-03-02 22:46:301770 sources = [
1771 "base/parse_ip_pattern_fuzzer.cc",
1772 ]
1773 deps = [
eroman02b4fe562016-03-04 12:15:161774 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301775 "//net",
1776 ]
1777}
1778
mmoroz565e8df22016-03-04 18:17:201779fuzzer_test("net_get_domain_and_registry_fuzzer") {
eromane6264fd2016-03-02 22:46:301780 sources = [
1781 "base/registry_controlled_domains/get_domain_and_registry_fuzzer.cc",
1782 ]
1783 deps = [
eroman02b4fe562016-03-04 12:15:161784 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301785 "//base",
eromane6264fd2016-03-02 22:46:301786 "//net",
1787 ]
1788}
1789
mattmafe43b82016-04-28 20:40:541790fuzzer_test("net_cert_verify_name_match_fuzzer") {
1791 sources = [
1792 "cert/internal/verify_name_match_fuzzer.cc",
1793 ]
1794 deps = [
1795 ":net_fuzzer_test_support",
1796 "//base",
1797 "//net",
1798 ]
1799}
1800
mattm2c637da42016-04-28 02:55:591801fuzzer_test("net_cert_normalize_name_fuzzer") {
1802 sources = [
1803 "cert/internal/verify_name_match_normalizename_fuzzer.cc",
1804 ]
1805 deps = [
1806 "//base",
1807 "//net",
1808 ]
1809}
1810
mattmafe43b82016-04-28 20:40:541811fuzzer_test("net_cert_verify_name_in_subtree_fuzzer") {
1812 sources = [
1813 "cert/internal/verify_name_match_verifynameinsubtree_fuzzer.cc",
1814 ]
1815 deps = [
1816 ":net_fuzzer_test_support",
1817 "//base",
1818 "//net",
1819 ]
1820}
1821
mmoroz565e8df22016-03-04 18:17:201822fuzzer_test("net_parse_cookie_line_fuzzer") {
eromane6264fd2016-03-02 22:46:301823 sources = [
1824 "cookies/parse_cookie_line_fuzzer.cc",
1825 ]
1826 deps = [
eroman02b4fe562016-03-04 12:15:161827 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301828 "//net",
1829 ]
1830}
1831
mmoroz565e8df22016-03-04 18:17:201832fuzzer_test("net_dns_record_fuzzer") {
eromanfe8659e2016-03-02 23:47:021833 sources = [
1834 "dns/dns_record_fuzzer.cc",
1835 ]
1836 deps = [
eroman02b4fe562016-03-04 12:15:161837 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021838 "//base",
1839 "//net",
1840 ]
1841}
1842
zhongyi273af9f2016-04-28 18:46:341843fuzzer_test("net_dns_hosts_parse_fuzzer") {
1844 sources = [
1845 "dns/dns_hosts_parse_fuzzer.cc",
1846 ]
1847 deps = [
1848 ":net_fuzzer_test_support",
1849 "//base",
1850 "//net",
1851 ]
1852}
1853
mmenke44e8e9c2016-03-29 18:38:571854fuzzer_test("net_http_stream_parser_fuzzer") {
1855 sources = [
1856 "http/http_stream_parser_fuzzer.cc",
1857 ]
1858 deps = [
1859 ":net_fuzzer_test_support",
1860 ":test_support",
1861 "//base",
1862 "//net",
1863 ]
mmenkee15732f2016-04-18 18:47:491864 dict = "data/http/http.dict"
mmenke44e8e9c2016-03-29 18:38:571865}
1866
mmoroz565e8df22016-03-04 18:17:201867fuzzer_test("net_ftp_ctrl_response_fuzzer") {
eromanfe8659e2016-03-02 23:47:021868 sources = [
1869 "ftp/ftp_ctrl_response_fuzzer.cc",
1870 ]
1871 deps = [
eroman02b4fe562016-03-04 12:15:161872 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021873 "//base",
1874 "//net",
1875 ]
1876}
1877
mmoroz565e8df22016-03-04 18:17:201878fuzzer_test("net_ftp_directory_listing_fuzzer") {
eromanfe8659e2016-03-02 23:47:021879 sources = [
1880 "ftp/ftp_directory_listing_fuzzer.cc",
1881 ]
1882 deps = [
eroman02b4fe562016-03-04 12:15:161883 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021884 "//base",
eromanfe8659e2016-03-02 23:47:021885 "//net",
1886 ]
1887}
1888
mmoroz565e8df22016-03-04 18:17:201889fuzzer_test("net_unescape_url_component_fuzzer") {
eromanfe8659e2016-03-02 23:47:021890 sources = [
1891 "base/unescape_url_component_fuzzer.cc",
1892 ]
1893 deps = [
eroman02b4fe562016-03-04 12:15:161894 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021895 "//base",
1896 "//net",
1897 ]
mmoroz34eb0082016-03-11 14:32:011898 dict = "base/unescape_url_component_fuzzer.dict"
mmoroz062a4a62016-04-12 09:02:331899 libfuzzer_options = [ "max_len = 2048" ]
eromanfe8659e2016-03-02 23:47:021900}
1901
mmoroz565e8df22016-03-04 18:17:201902fuzzer_test("net_websocket_frame_parser_fuzzer") {
eromanfe8659e2016-03-02 23:47:021903 sources = [
1904 "websockets/websocket_frame_parser_fuzzer.cc",
1905 ]
1906 deps = [
eroman02b4fe562016-03-04 12:15:161907 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021908 "//net",
1909 ]
1910}
1911
mmoroz565e8df22016-03-04 18:17:201912fuzzer_test("net_http_chunked_decoder_fuzzer") {
eromanfe8659e2016-03-02 23:47:021913 sources = [
1914 "http/http_chunked_decoder_fuzzer.cc",
1915 ]
1916 deps = [
eroman02b4fe562016-03-04 12:15:161917 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021918 "//net",
1919 ]
mmoroz5fa27922016-03-22 19:42:191920 dict = "http/http_chunked_decoder_fuzzer.dict"
eromanfe8659e2016-03-02 23:47:021921}
1922
mmenke8e9314bc2016-04-15 21:45:021923fuzzer_test("net_http_proxy_client_socket_fuzzer") {
1924 sources = [
1925 "http/http_proxy_client_socket_fuzzer.cc",
1926 ]
1927 deps = [
1928 ":net_fuzzer_test_support",
1929 ":test_support",
1930 "//base",
1931 "//net",
1932 ]
mmenkee15732f2016-04-18 18:47:491933 dict = "data/http/http.dict"
mmenke8e9314bc2016-04-15 21:45:021934}
1935
mmoroz565e8df22016-03-04 18:17:201936fuzzer_test("net_quic_crypto_framer_parse_message_fuzzer") {
eromanfe8659e2016-03-02 23:47:021937 sources = [
1938 "quic/quic_crypto_framer_parse_message_fuzzer.cc",
1939 ]
1940 deps = [
eroman02b4fe562016-03-04 12:15:161941 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021942 "//base",
1943 "//net",
1944 ]
1945}
mmenke99b57172016-04-14 20:44:331946
1947fuzzer_test("net_socks_client_socket_fuzzer") {
1948 sources = [
1949 "socket/socks_client_socket_fuzzer.cc",
1950 ]
1951 deps = [
1952 ":net_fuzzer_test_support",
1953 ":test_support",
1954 "//base",
1955 "//net",
1956 ]
1957}
1958
1959fuzzer_test("net_socks5_client_socket_fuzzer") {
1960 sources = [
1961 "socket/socks5_client_socket_fuzzer.cc",
1962 ]
1963 deps = [
1964 ":net_fuzzer_test_support",
1965 ":test_support",
1966 "//base",
1967 "//net",
1968 ]
1969}
mmenkec951d412016-04-28 19:05:221970
1971fuzzer_test("net_url_request_fuzzer") {
1972 sources = [
1973 "url_request/url_request_fuzzer.cc",
1974 ]
1975 deps = [
1976 ":net_fuzzer_test_support",
1977 ":test_support",
1978 "//base",
1979 "//net",
1980 ]
1981 dict = "data/http/http.dict"
1982}