blob: d19d8142ab4688e3b6a8759fd725229a75ada88d [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) {
105 net_configs += [ "//build/config/linux:gconf" ]
106}
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
163 if (use_openssl) {
164 sources -= [
165 "base/nss_memio.c",
166 "base/nss_memio.h",
167 "cert/ct_log_verifier_nss.cc",
168 "cert/ct_objects_extractor_nss.cc",
169 "cert/jwk_serializer_nss.cc",
170 "cert/scoped_nss_types.h",
171 "cert/x509_util_nss.cc",
172 "quic/crypto/aead_base_decrypter_nss.cc",
173 "quic/crypto/aead_base_encrypter_nss.cc",
174 "quic/crypto/aes_128_gcm_12_decrypter_nss.cc",
175 "quic/crypto/aes_128_gcm_12_encrypter_nss.cc",
176 "quic/crypto/chacha20_poly1305_rfc7539_decrypter_nss.cc",
177 "quic/crypto/chacha20_poly1305_rfc7539_encrypter_nss.cc",
178 "quic/crypto/channel_id_nss.cc",
179 "quic/crypto/p256_key_exchange_nss.cc",
180 "quic/crypto/proof_source_chromium_nss.cc",
181 "socket/nss_ssl_util.cc",
182 "socket/nss_ssl_util.h",
183 "socket/ssl_client_socket_nss.cc",
184 "socket/ssl_client_socket_nss.h",
185 "socket/ssl_server_socket_nss.cc",
186 "socket/ssl_server_socket_nss.h",
187 "ssl/token_binding_nss.cc",
188 ]
189 if (is_ios) {
190 sources -= [
191 "cert/x509_util_ios.cc",
192 "cert/x509_util_ios.h",
193 ]
194 }
195 } else {
196 sources -= [
197 "cert/ct_log_verifier_openssl.cc",
198 "cert/ct_objects_extractor_openssl.cc",
199 "cert/jwk_serializer_openssl.cc",
200 "cert/x509_util_openssl.cc",
201 "cert/x509_util_openssl.h",
202 "quic/crypto/aead_base_decrypter_openssl.cc",
203 "quic/crypto/aead_base_encrypter_openssl.cc",
204 "quic/crypto/aes_128_gcm_12_decrypter_openssl.cc",
205 "quic/crypto/aes_128_gcm_12_encrypter_openssl.cc",
206 "quic/crypto/chacha20_poly1305_rfc7539_decrypter_openssl.cc",
207 "quic/crypto/chacha20_poly1305_rfc7539_encrypter_openssl.cc",
208 "quic/crypto/channel_id_openssl.cc",
209 "quic/crypto/p256_key_exchange_openssl.cc",
210 "quic/crypto/proof_source_chromium_openssl.cc",
211 "quic/crypto/scoped_evp_aead_ctx.cc",
212 "quic/crypto/scoped_evp_aead_ctx.h",
213 "socket/ssl_client_socket_openssl.cc",
214 "socket/ssl_client_socket_openssl.h",
215 "socket/ssl_server_socket_openssl.cc",
216 "socket/ssl_server_socket_openssl.h",
217 "ssl/openssl_ssl_util.cc",
218 "ssl/openssl_ssl_util.h",
219 "ssl/ssl_client_session_cache_openssl.cc",
220 "ssl/ssl_client_session_cache_openssl.h",
221 "ssl/ssl_key_logger.cc",
222 "ssl/ssl_key_logger.h",
223 "ssl/ssl_platform_key.h",
224 "ssl/ssl_platform_key_task_runner.cc",
225 "ssl/ssl_platform_key_task_runner.h",
226 "ssl/test_ssl_private_key.cc",
227 "ssl/test_ssl_private_key.h",
228 "ssl/threaded_ssl_private_key.cc",
229 "ssl/threaded_ssl_private_key.h",
230 "ssl/token_binding_openssl.cc",
231 ]
232 }
233
234 if (!use_openssl_certs) {
235 sources -= [
236 "base/crypto_module_openssl.cc",
237 "base/keygen_handler_openssl.cc",
238 "base/openssl_private_key_store.h",
239 "base/openssl_private_key_store_memory.cc",
240 "cert/cert_database_openssl.cc",
241 "cert/cert_verify_proc_openssl.cc",
242 "cert/cert_verify_proc_openssl.h",
243 "cert/test_root_certs_openssl.cc",
244 "cert/x509_certificate_openssl.cc",
245 "ssl/openssl_client_key_store.cc",
246 "ssl/openssl_client_key_store.h",
247 ]
248 if (is_android) {
249 sources -= [ "base/openssl_private_key_store_android.cc" ]
250 }
251 } else {
252 if (is_android) {
253 # Android doesn't use these even when using OpenSSL.
254 sources -= [
255 "base/openssl_private_key_store_memory.cc",
256 "cert/cert_database_openssl.cc",
257 "cert/cert_verify_proc_openssl.cc",
258 "cert/test_root_certs_openssl.cc",
259 ]
260 }
261 }
262
263 if (!use_kerberos || is_android) {
264 sources -= [
265 "http/http_auth_gssapi_posix.cc",
266 "http/http_auth_gssapi_posix.h",
267 ]
268 }
269
270 if (use_glib && use_gconf && !is_chromeos) {
271 deps += [ "//build/linux:gio" ]
272 }
273
274 if (!use_nss_certs) {
275 sources -= [
276 "base/crypto_module_nss.cc",
277 "base/keygen_handler_nss.cc",
278 "cert/cert_database_nss.cc",
279 "cert/nss_cert_database.cc",
280 "cert/nss_cert_database.h",
281 "cert/x509_certificate_nss.cc",
282 "ssl/client_cert_store_nss.cc",
283 "ssl/client_cert_store_nss.h",
284 "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
285 "third_party/mozilla_security_manager/nsKeygenHandler.h",
286 "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
287 "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
288 "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
289 "third_party/mozilla_security_manager/nsPKCS12Blob.h",
290 ]
291 if (is_chromeos) {
292 # These were already removed on non-ChromeOS.
293 sources -= [
294 "cert/nss_cert_database_chromeos.cc",
295 "cert/nss_cert_database_chromeos.h",
296 "cert/nss_profile_filter_chromeos.cc",
297 "cert/nss_profile_filter_chromeos.h",
298 ]
299 }
300 sources -= [
301 "ssl/client_key_store.cc",
302 "ssl/client_key_store.h",
303 "ssl/ssl_platform_key_nss.cc",
304 ]
305 } else if (use_openssl) {
306 # client_cert_store_nss.c requires NSS_CmpCertChainWCANames from NSS's
307 # libssl, but our bundled copy is not built in OpenSSL ports. Pull that
308 # file in directly.
309 sources += [ "third_party/nss/ssl/cmpcert.c" ]
310 }
311
312 if (!use_nss_verifier) {
313 # These files are part of the partial implementation of NSS for
314 # cert verification, so keep them in that case.
315 sources -= [
316 "cert/cert_verify_proc_nss.cc",
317 "cert/cert_verify_proc_nss.h",
318 "cert/test_root_certs_nss.cc",
319 "cert/x509_util_nss_certs.cc",
320 "cert_net/nss_ocsp.cc",
321 "cert_net/nss_ocsp.h",
322 ]
323 }
324
325 if (is_ios && use_nss_verifier) {
326 sources -= [
327 "cert/cert_verify_proc_ios.cc",
328 "cert/cert_verify_proc_ios.h",
329 "cert/x509_certificate_openssl_ios.cc",
330 ]
331
332 deps += [
333 "//net/third_party/nss/ssl:libssl",
334 "//third_party/nss",
335 "//third_party/nss:nspr",
336 ]
337 }
338
339 if (is_chromecast && use_nss_certs) {
340 sources += [ "ssl/ssl_platform_key_chromecast.cc" ]
341 sources -= [ "ssl/ssl_platform_key_nss.cc" ]
342 }
343
344 if (!enable_mdns) {
345 sources -= [
346 "dns/mdns_cache.cc",
347 "dns/mdns_cache.h",
348 "dns/mdns_client.cc",
349 "dns/mdns_client.h",
350 "dns/mdns_client_impl.cc",
351 "dns/mdns_client_impl.h",
352 "dns/record_parsed.cc",
353 "dns/record_parsed.h",
354 "dns/record_rdata.cc",
355 "dns/record_rdata.h",
356 ]
357 }
358
359 if (is_win) {
360 sources -= [ "http/http_auth_handler_ntlm_portable.cc" ]
361 } else { # !is_win
362 sources -= [
363 "base/winsock_init.cc",
364 "base/winsock_init.h",
365 "base/winsock_util.cc",
366 "base/winsock_util.h",
367 "proxy/proxy_resolver_winhttp.cc",
368 "proxy/proxy_resolver_winhttp.h",
369 ]
370 }
371
372 if (is_ios) {
373 # Add back some sources that were otherwise filtered out.
374 # iOS needs some Mac files.
375 net_unfiltered_sources += [
376 "base/mac/url_conversions.h",
377 "base/mac/url_conversions.mm",
378 "base/network_change_notifier_mac.cc",
379 "base/network_config_watcher_mac.cc",
380 "base/network_interfaces_mac.cc",
381 "base/network_interfaces_mac.h",
382 "base/platform_mime_util_mac.mm",
383 "proxy/proxy_resolver_mac.cc",
384 "proxy/proxy_server_mac.cc",
385 ]
386
387 sources -= [ "disk_cache/blockfile/file_posix.cc" ]
388 }
389
390 if (is_ios && !use_nss_verifier) {
391 net_unfiltered_sources += [ "cert/test_root_certs_mac.cc" ]
392 sources -= [ "cert/x509_certificate_ios.cc" ]
393 }
394
395 if (is_ios || is_mac) {
396 sources += gypi_values.net_base_mac_ios_sources
397 }
398
399 if (is_android) {
400 deps += [ ":net_jni_headers" ]
401
402 # Add some Linux sources that were excluded by the filter, but which
403 # are needed.
404 net_unfiltered_sources += [
405 "base/address_tracker_linux.cc",
406 "base/address_tracker_linux.h",
407 "base/network_interfaces_linux.cc",
408 "base/network_interfaces_linux.h",
409 "base/platform_mime_util_linux.cc",
410 ]
411 }
412 } else {
413 public_deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
414 }
xunjieli905496a2015-08-31 15:51:17415
416 # Add back some sources that were otherwise filtered out.
417 set_sources_assignment_filter([])
kapishnikovabe280e2016-04-14 19:07:16418 sources += net_unfiltered_sources
xunjieli905496a2015-08-31 15:51:17419 set_sources_assignment_filter(sources_assignment_filter)
420
421 cflags = []
kapishnikovabe280e2016-04-14 19:07:16422 configs += net_configs
xunjieli905496a2015-08-31 15:51:17423 public_configs = [ ":net_config" ]
424
kapishnikovabe280e2016-04-14 19:07:16425 public_deps += [ "//url" ]
[email protected]4625ade2014-04-15 19:26:44426
427 if (is_mac) {
[email protected]4625ade2014-04-15 19:26:44428 libs = [
[email protected]ab9ce6e2014-04-17 20:33:19429 "Foundation.framework",
430 "Security.framework",
431 "SystemConfiguration.framework",
432 "resolv",
[email protected]4625ade2014-04-15 19:26:44433 ]
434 }
435
436 if (is_ios) {
[email protected]4625ade2014-04-15 19:26:44437 libs = [
[email protected]ab9ce6e2014-04-17 20:33:19438 "CFNetwork.framework",
439 "MobileCoreServices.framework",
440 "Security.framework",
441 "SystemConfiguration.framework",
442 "resolv",
[email protected]4625ade2014-04-15 19:26:44443 ]
xunjieli06d93982015-08-27 17:13:02444 }
xunjieli4c8c6922015-08-27 16:02:40445
jam5332a632016-04-01 22:36:05446 if (is_win) {
447 libs = [
448 "crypt32.lib",
449 "dhcpcsvc.lib",
450 "iphlpapi.lib",
451 "rpcrt4.lib",
452 "secur32.lib",
453 "urlmon.lib",
454 "winhttp.lib",
455 ]
456 }
457
sergeyu99d83f92015-09-14 23:03:33458 if (!is_nacl) {
459 if (!disable_file_support) {
460 sources += gypi_values.net_file_support_sources
461 }
xunjieli06d93982015-08-27 17:13:02462
sergeyu99d83f92015-09-14 23:03:33463 if (!disable_ftp_support) {
464 sources += gypi_values.net_ftp_support_sources
465 }
xunjieli905496a2015-08-31 15:51:17466
sergeyu99d83f92015-09-14 23:03:33467 if (enable_websockets) {
468 sources += gypi_values.net_websockets_sources
469 }
xunjieli905496a2015-08-31 15:51:17470
sergeyu99d83f92015-09-14 23:03:33471 # ICU support.
kapishnikovabe280e2016-04-14 19:07:16472 if (use_platform_icu_alternatives) {
473 if (is_android) {
474 # Use ICU alternative on Android.
475 sources += [
476 "base/net_string_util_icu_alternatives_android.cc",
477 "base/net_string_util_icu_alternatives_android.h",
478 ]
479 deps += [ ":net_jni_headers" ]
480 } else if (is_ios) {
481 # Use ICU alternative on iOS.
482 sources += [ "base/net_string_util_icu_alternatives_ios.mm" ]
483 } else {
484 assert(false,
485 "ICU alternative is not implemented for platform: " + target_os)
486 }
487 } else {
488 # Use ICU.
489 deps += [
490 "//base:i18n",
491 "//third_party/icu",
492 ]
493 sources += [
494 "base/filename_util_icu.cc",
495 "base/net_string_util_icu.cc",
496 ]
497 }
eustasfbec9132015-12-30 14:56:51498
499 # Brotli support.
kapishnikovabe280e2016-04-14 19:07:16500 if (!disable_brotli_filter) {
501 sources += [ "filter/brotli_filter.cc" ]
502 deps += [ "//third_party/brotli" ]
503 } else {
504 sources += [ "filter/brotli_filter_disabled.cc" ]
505 }
[email protected]85191ed2014-05-15 00:41:49506 }
[email protected]4625ade2014-04-15 19:26:44507}
508
509grit("net_resources") {
510 source = "base/net_resources.grd"
[email protected]7ae52902014-08-18 22:36:01511 use_qualified_include = true
[email protected]b89c53842014-07-23 16:32:32512 outputs = [
513 "grit/net_resources.h",
514 "net_resources.pak",
[email protected]b89c53842014-07-23 16:32:32515 ]
[email protected]4625ade2014-04-15 19:26:44516}
517
rtennetib6f1c0d2015-04-03 17:52:06518proto_library("net_quic_proto") {
kapishnikovabe280e2016-04-14 19:07:16519 visibility = [ ":net" ]
brettw2e7db0a2015-04-24 22:59:17520
rtennetib6f1c0d2015-04-03 17:52:06521 sources = [
522 "quic/proto/cached_network_parameters.proto",
523 "quic/proto/source_address_token.proto",
524 ]
525 cc_generator_options = "dllexport_decl=NET_EXPORT_PRIVATE:"
526 cc_include = "net/base/net_export.h"
527
528 defines = [ "NET_IMPLEMENTATION" ]
529
530 extra_configs = [ "//build/config/compiler:wexit_time_destructors" ]
531}
532
Brett Wilson83fd4242014-09-02 19:45:33533static_library("extras") {
mef327a8e42014-08-29 17:10:03534 sources = gypi_values.net_extras_sources
535 configs += [ "//build/config/compiler:wexit_time_destructors" ]
536 deps = [
537 ":net",
brettwbc44c0a92015-02-20 22:30:39538 "//base",
mef327a8e42014-08-29 17:10:03539 "//sql:sql",
540 ]
541}
542
[email protected]8a3f8242014-06-05 18:05:12543static_library("http_server") {
[email protected]4625ade2014-04-15 19:26:44544 sources = [
545 "server/http_connection.cc",
546 "server/http_connection.h",
547 "server/http_server.cc",
548 "server/http_server.h",
549 "server/http_server_request_info.cc",
550 "server/http_server_request_info.h",
551 "server/http_server_response_info.cc",
552 "server/http_server_response_info.h",
553 "server/web_socket.cc",
554 "server/web_socket.h",
dgozmana6e70092014-12-12 14:46:21555 "server/web_socket_encoder.cc",
556 "server/web_socket_encoder.h",
[email protected]4625ade2014-04-15 19:26:44557 ]
jambc6cc8e2014-11-14 17:56:29558 configs += [
brettwd1c719a2015-02-19 23:17:04559 "//build/config/compiler:no_size_t_to_int_warning",
jambc6cc8e2014-11-14 17:56:29560 "//build/config/compiler:wexit_time_destructors",
jambc6cc8e2014-11-14 17:56:29561 ]
[email protected]4625ade2014-04-15 19:26:44562 deps = [
563 ":net",
564 "//base",
565 ]
566}
567
sdefresne3001f172016-03-16 10:30:03568if (!is_ios) {
569 executable("dump_cache") {
570 testonly = true
571 sources = [
572 "tools/dump_cache/dump_cache.cc",
573 "tools/dump_cache/dump_files.cc",
574 "tools/dump_cache/dump_files.h",
575 ]
[email protected]4625ade2014-04-15 19:26:44576
sdefresne3001f172016-03-16 10:30:03577 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
578 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31579
sdefresne3001f172016-03-16 10:30:03580 deps = [
581 ":net",
582 ":test_support",
583 "//base",
584 "//build/config/sanitizers:deps",
585 ]
586 }
[email protected]8603c5de2014-04-16 20:34:31587}
588
sdefresneb0a31642016-03-18 11:04:45589bundle_data("test_support_bundle_data") {
590 testonly = true
591 sources = [
592 "data/ssl/certificates",
593 ]
594 outputs = [
595 "{{bundle_resources_dir}}/" +
596 "{{source_root_relative_dir}}/{{source_file_part}}",
597 ]
598}
599
[email protected]b2b2bf52014-05-28 20:26:57600source_set("test_support") {
Brett Wilson8f80ad0b2014-09-08 19:50:24601 testonly = true
[email protected]8603c5de2014-04-16 20:34:31602 sources = [
[email protected]8603c5de2014-04-16 20:34:31603 "base/load_timing_info_test_util.cc",
604 "base/load_timing_info_test_util.h",
605 "base/mock_file_stream.cc",
606 "base/mock_file_stream.h",
607 "base/test_completion_callback.cc",
608 "base/test_completion_callback.h",
609 "base/test_data_directory.cc",
610 "base/test_data_directory.h",
611 "cert/mock_cert_verifier.cc",
612 "cert/mock_cert_verifier.h",
ryanchung987b2ff2016-02-19 00:17:12613 "cert/mock_client_cert_verifier.cc",
614 "cert/mock_client_cert_verifier.h",
[email protected]8603c5de2014-04-16 20:34:31615 "cookies/cookie_monster_store_test.cc",
616 "cookies/cookie_monster_store_test.h",
617 "cookies/cookie_store_test_callbacks.cc",
618 "cookies/cookie_store_test_callbacks.h",
619 "cookies/cookie_store_test_helpers.cc",
620 "cookies/cookie_store_test_helpers.h",
drogerfd8b2772015-12-04 14:34:56621 "cookies/cookie_store_unittest.h",
[email protected]8603c5de2014-04-16 20:34:31622 "disk_cache/disk_cache_test_base.cc",
623 "disk_cache/disk_cache_test_base.h",
624 "disk_cache/disk_cache_test_util.cc",
625 "disk_cache/disk_cache_test_util.h",
626 "dns/dns_test_util.cc",
627 "dns/dns_test_util.h",
628 "dns/mock_host_resolver.cc",
629 "dns/mock_host_resolver.h",
630 "dns/mock_mdns_socket_factory.cc",
631 "dns/mock_mdns_socket_factory.h",
[email protected]8a3f8242014-06-05 18:05:12632 "http/http_transaction_test_util.cc",
633 "http/http_transaction_test_util.h",
vishal.b62985ca92015-04-17 08:45:51634 "log/test_net_log.cc",
635 "log/test_net_log.h",
mmenke43758e62015-05-04 21:09:46636 "log/test_net_log_entry.cc",
637 "log/test_net_log_entry.h",
mmenke0034c542015-05-05 22:34:59638 "log/test_net_log_util.cc",
mmenke43758e62015-05-04 21:09:46639 "log/test_net_log_util.h",
[email protected]8603c5de2014-04-16 20:34:31640 "proxy/mock_proxy_resolver.cc",
641 "proxy/mock_proxy_resolver.h",
642 "proxy/mock_proxy_script_fetcher.cc",
643 "proxy/mock_proxy_script_fetcher.h",
644 "proxy/proxy_config_service_common_unittest.cc",
645 "proxy/proxy_config_service_common_unittest.h",
646 "socket/socket_test_util.cc",
647 "socket/socket_test_util.h",
648 "test/cert_test_util.cc",
649 "test/cert_test_util.h",
[email protected]83e1ae32014-07-18 10:57:07650 "test/cert_test_util_nss.cc",
nharper2e171cf2015-06-01 20:29:23651 "test/channel_id_test_util.cc",
652 "test/channel_id_test_util.h",
[email protected]8603c5de2014-04-16 20:34:31653 "test/ct_test_util.cc",
654 "test/ct_test_util.h",
svaldez7d25c562015-10-30 19:09:45655 "test/embedded_test_server/default_handlers.cc",
656 "test/embedded_test_server/default_handlers.h",
[email protected]8603c5de2014-04-16 20:34:31657 "test/embedded_test_server/embedded_test_server.cc",
658 "test/embedded_test_server/embedded_test_server.h",
659 "test/embedded_test_server/http_connection.cc",
660 "test/embedded_test_server/http_connection.h",
661 "test/embedded_test_server/http_request.cc",
662 "test/embedded_test_server/http_request.h",
663 "test/embedded_test_server/http_response.cc",
664 "test/embedded_test_server/http_response.h",
svaldez6e7e82a22015-10-28 19:39:53665 "test/embedded_test_server/request_handler_util.cc",
666 "test/embedded_test_server/request_handler_util.h",
sammc6ac3fe52015-02-25 06:00:28667 "test/event_waiter.h",
[email protected]8603c5de2014-04-16 20:34:31668 "test/net_test_suite.cc",
669 "test/net_test_suite.h",
670 "test/python_utils.cc",
671 "test/python_utils.h",
brettw6315e032015-11-27 18:38:36672 "test/test_certificate_data.h",
sherouk51b4b098b2015-08-10 09:00:43673 "test/url_request/ssl_certificate_error_job.cc",
674 "test/url_request/ssl_certificate_error_job.h",
Brett Wilson32ce17a2014-11-10 17:45:30675 "test/url_request/url_request_failed_job.cc",
676 "test/url_request/url_request_failed_job.h",
mef3e826cf2014-12-13 18:40:40677 "test/url_request/url_request_mock_data_job.cc",
678 "test/url_request/url_request_mock_data_job.h",
jam8e45cd72015-01-20 16:33:44679 "test/url_request/url_request_slow_download_job.cc",
680 "test/url_request/url_request_slow_download_job.h",
[email protected]8603c5de2014-04-16 20:34:31681 "url_request/test_url_fetcher_factory.cc",
682 "url_request/test_url_fetcher_factory.h",
683 "url_request/url_request_test_util.cc",
684 "url_request/url_request_test_util.h",
685 ]
sherouk3eee4a82015-09-01 10:42:33686 if (!is_ios) {
687 sources += [
688 "test/spawned_test_server/base_test_server.cc",
689 "test/spawned_test_server/base_test_server.h",
690 "test/spawned_test_server/local_test_server.cc",
691 "test/spawned_test_server/local_test_server.h",
692 "test/spawned_test_server/local_test_server_posix.cc",
693 "test/spawned_test_server/local_test_server_win.cc",
694 "test/spawned_test_server/spawned_test_server.h",
695 ]
696 }
[email protected]8603c5de2014-04-16 20:34:31697
brettwbc8b2a22015-07-28 18:24:42698 configs += [
699 "//build/config:precompiled_headers",
700
701 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
702 "//build/config/compiler:no_size_t_to_int_warning",
703 ]
[email protected]8603c5de2014-04-16 20:34:31704
sdefresneb0a31642016-03-18 11:04:45705 deps = [
706 ":test_support_bundle_data",
707 ]
708
Brett Wilsone53895272014-09-23 23:41:46709 public_deps = [
[email protected]8603c5de2014-04-16 20:34:31710 "//base",
711 "//base/test:test_support",
[email protected]22fe91d2014-08-12 17:07:12712 "//crypto",
[email protected]59ff2d42014-04-22 22:25:23713 "//net",
[email protected]8603c5de2014-04-16 20:34:31714 "//net/tools/tld_cleanup",
715 "//testing/gmock",
716 "//testing/gtest",
717 "//url",
718 ]
719
jamb533b7e2015-03-04 17:12:05720 if (!is_ios) {
721 public_deps += [ "//third_party/protobuf:py_proto" ]
722 }
723
svaldeza1714ab2016-03-18 20:47:53724 if (use_nss_verifier) {
scottmg34fb7e52014-12-03 23:27:24725 public_deps += [ "//crypto:platform" ]
[email protected]8603c5de2014-04-16 20:34:31726 }
727
sherouk3eee4a82015-09-01 10:42:33728 if (is_android) {
729 sources += [
[email protected]8603c5de2014-04-16 20:34:31730 "test/spawned_test_server/remote_test_server.cc",
731 "test/spawned_test_server/remote_test_server.h",
732 "test/spawned_test_server/spawner_communicator.cc",
733 "test/spawned_test_server/spawner_communicator.h",
734 ]
735 }
736
737 if (use_v8_in_net) {
Brett Wilsone53895272014-09-23 23:41:46738 public_deps += [ ":net_with_v8" ]
[email protected]8603c5de2014-04-16 20:34:31739 }
740
741 if (!enable_mdns) {
742 sources -= [
743 "dns/mock_mdns_socket_factory.cc",
744 "dns/mock_mdns_socket_factory.h",
745 ]
746 }
747
davidben15d69d482014-09-29 18:24:08748 if (!use_nss_certs) {
scottmg34fb7e52014-12-03 23:27:24749 sources -= [ "test/cert_test_util_nss.cc" ]
[email protected]83e1ae32014-07-18 10:57:07750 }
xunjielia6888202015-04-14 21:34:25751
752 if (!disable_file_support) {
753 sources += [
754 "test/url_request/url_request_mock_http_job.cc",
755 "test/url_request/url_request_mock_http_job.h",
756 "url_request/test_url_request_interceptor.cc",
757 "url_request/test_url_request_interceptor.h",
758 ]
759 }
[email protected]8603c5de2014-04-16 20:34:31760}
761
[email protected]ceeaac792014-06-25 05:14:43762source_set("balsa") {
763 sources = [
764 "tools/balsa/balsa_enums.h",
765 "tools/balsa/balsa_frame.cc",
766 "tools/balsa/balsa_frame.h",
767 "tools/balsa/balsa_headers.cc",
768 "tools/balsa/balsa_headers.h",
769 "tools/balsa/balsa_headers_token_utils.cc",
770 "tools/balsa/balsa_headers_token_utils.h",
771 "tools/balsa/balsa_visitor_interface.h",
772 "tools/balsa/http_message_constants.cc",
773 "tools/balsa/http_message_constants.h",
774 "tools/balsa/noop_balsa_visitor.h",
775 "tools/balsa/simple_buffer.cc",
776 "tools/balsa/simple_buffer.h",
[email protected]ceeaac792014-06-25 05:14:43777 "tools/balsa/string_piece_utils.h",
rtennetie0ee6eb2015-05-01 00:55:09778 "tools/quic/spdy_balsa_utils.cc",
779 "tools/quic/spdy_balsa_utils.h",
[email protected]ceeaac792014-06-25 05:14:43780 ]
781 deps = [
782 ":net",
783 "//base",
[email protected]22fe91d2014-08-12 17:07:12784 "//url",
[email protected]ceeaac792014-06-25 05:14:43785 ]
786}
787
[email protected]8603c5de2014-04-16 20:34:31788if (use_v8_in_net) {
789 component("net_with_v8") {
790 sources = [
791 "proxy/proxy_resolver_v8.cc",
792 "proxy/proxy_resolver_v8.h",
793 "proxy/proxy_resolver_v8_tracing.cc",
794 "proxy/proxy_resolver_v8_tracing.h",
sammcf2d1ea02015-06-29 02:58:47795 "proxy/proxy_resolver_v8_tracing_wrapper.cc",
796 "proxy/proxy_resolver_v8_tracing_wrapper.h",
[email protected]8603c5de2014-04-16 20:34:31797 "proxy/proxy_service_v8.cc",
798 "proxy/proxy_service_v8.h",
799 ]
800
801 defines = [ "NET_IMPLEMENTATION" ]
dprankea22b0732015-10-21 21:15:11802
[email protected]8603c5de2014-04-16 20:34:31803 configs += [
brettwd1c719a2015-02-19 23:17:04804 "//build/config/compiler:no_size_t_to_int_warning",
[email protected]8603c5de2014-04-16 20:34:31805 "//build/config/compiler:wexit_time_destructors",
dprankea22b0732015-10-21 21:15:11806 "//v8:external_startup_data",
[email protected]8603c5de2014-04-16 20:34:31807 ]
808
Brett Wilsone53895272014-09-23 23:41:46809 public_deps = [
[email protected]8603c5de2014-04-16 20:34:31810 ":net",
Brett Wilsone53895272014-09-23 23:41:46811 ]
812 deps = [
[email protected]8603c5de2014-04-16 20:34:31813 "//base",
814 "//gin",
815 "//url",
816 "//v8",
817 ]
818 }
819}
820
amistry7e6ebfdc82015-02-13 04:19:11821if (use_v8_in_net && !is_android) {
822 source_set("net_browser_services") {
823 sources = [
824 "dns/mojo_host_resolver_impl.cc",
825 "dns/mojo_host_resolver_impl.h",
amistry6e1ed1b2015-03-12 05:24:01826 "proxy/in_process_mojo_proxy_resolver_factory.cc",
827 "proxy/in_process_mojo_proxy_resolver_factory.h",
sammc1d5df4d2015-05-05 05:06:17828 "proxy/mojo_proxy_resolver_factory.h",
eromandcacef22015-06-01 19:36:35829 "proxy/proxy_resolver_factory_mojo.cc",
830 "proxy/proxy_resolver_factory_mojo.h",
amistry6e1ed1b2015-03-12 05:24:01831 "proxy/proxy_service_mojo.cc",
832 "proxy/proxy_service_mojo.h",
amistry7e6ebfdc82015-02-13 04:19:11833 ]
834
835 public_deps = [
836 ":mojo_type_converters",
tfarina8ac4d17f2015-12-16 02:11:11837 ":net_with_v8",
brettwbc44c0a92015-02-20 22:30:39838 "//base",
amistry07ff1402015-03-10 07:34:07839 "//mojo/common",
rockot85dce0862015-11-13 01:33:59840 "//mojo/public/cpp/bindings",
amistry7e6ebfdc82015-02-13 04:19:11841 "//net/interfaces",
amistry6e1ed1b2015-03-12 05:24:01842
843 # NOTE(amistry): As long as we support in-process Mojo v8 PAC, we need
844 # this dependency since in_process_mojo_proxy_resolver_factory creates
845 # the utility process side Mojo services in the browser process.
846 # Ultimately, this will go away when we only support out-of-process.
847 ":net_utility_services",
amistry7e6ebfdc82015-02-13 04:19:11848 ]
849 }
850
851 source_set("mojo_type_converters") {
852 sources = [
amistry7ec58112015-02-26 06:03:00853 "dns/mojo_host_type_converters.cc",
854 "dns/mojo_host_type_converters.h",
855 "proxy/mojo_proxy_type_converters.cc",
856 "proxy/mojo_proxy_type_converters.h",
amistry7e6ebfdc82015-02-13 04:19:11857 ]
858
859 public_deps = [
860 ":net",
tfarina8ac4d17f2015-12-16 02:11:11861 "//base",
rockot85dce0862015-11-13 01:33:59862 "//mojo/public/cpp/bindings",
amistry7e6ebfdc82015-02-13 04:19:11863 "//net/interfaces",
amistry7e6ebfdc82015-02-13 04:19:11864 ]
865 }
sammc5403aa1d2015-02-25 04:59:21866
867 source_set("net_utility_services") {
868 sources = [
sammc6ac3fe52015-02-25 06:00:28869 "dns/host_resolver_mojo.cc",
870 "dns/host_resolver_mojo.h",
sammc352f7492015-02-25 09:45:24871 "proxy/mojo_proxy_resolver_factory_impl.cc",
872 "proxy/mojo_proxy_resolver_factory_impl.h",
sammc5403aa1d2015-02-25 04:59:21873 "proxy/mojo_proxy_resolver_impl.cc",
874 "proxy/mojo_proxy_resolver_impl.h",
sammca3242c92015-07-10 02:38:51875 "proxy/mojo_proxy_resolver_v8_tracing_bindings.h",
sammc5403aa1d2015-02-25 04:59:21876 ]
877
rockot9509ec82015-04-14 02:50:56878 deps = [
879 ":net_with_v8",
tfarina8ac4d17f2015-12-16 02:11:11880 "//base",
rockot9509ec82015-04-14 02:50:56881 ]
882
sammc5403aa1d2015-02-25 04:59:21883 public_deps = [
884 ":mojo_type_converters",
885 ":net",
886 "//mojo/common",
rockot85dce0862015-11-13 01:33:59887 "//mojo/public/cpp/bindings",
sammc5403aa1d2015-02-25 04:59:21888 "//net/interfaces",
sammc5403aa1d2015-02-25 04:59:21889 ]
890 }
amistry7e6ebfdc82015-02-13 04:19:11891}
892
[email protected]8603c5de2014-04-16 20:34:31893if (!is_ios && !is_android) {
894 executable("crash_cache") {
Brett Wilson8f80ad0b2014-09-08 19:50:24895 testonly = true
scottmg34fb7e52014-12-03 23:27:24896 sources = [
897 "tools/crash_cache/crash_cache.cc",
898 ]
dpranke43276212015-02-20 02:55:19899
brettwd1c719a2015-02-19 23:17:04900 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
901 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31902 deps = [
903 ":net",
[email protected]b2b2bf52014-05-28 20:26:57904 ":test_support",
[email protected]8603c5de2014-04-16 20:34:31905 "//base",
brettwba7a73d2015-08-31 22:17:39906 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:31907 ]
908 }
909
910 executable("crl_set_dump") {
Brett Wilson8f80ad0b2014-09-08 19:50:24911 testonly = true
scottmg34fb7e52014-12-03 23:27:24912 sources = [
913 "tools/crl_set_dump/crl_set_dump.cc",
914 ]
dpranke43276212015-02-20 02:55:19915
brettwd1c719a2015-02-19 23:17:04916 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
917 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31918 deps = [
919 ":net",
920 "//base",
brettwba7a73d2015-08-31 22:17:39921 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:31922 ]
923 }
924
925 executable("dns_fuzz_stub") {
Brett Wilson8f80ad0b2014-09-08 19:50:24926 testonly = true
scottmg34fb7e52014-12-03 23:27:24927 sources = [
928 "tools/dns_fuzz_stub/dns_fuzz_stub.cc",
929 ]
dpranke43276212015-02-20 02:55:19930
brettwd1c719a2015-02-19 23:17:04931 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
932 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31933 deps = [
934 ":net",
935 "//base",
brettwba7a73d2015-08-31 22:17:39936 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:31937 ]
938 }
939
940 executable("gdig") {
Brett Wilson8f80ad0b2014-09-08 19:50:24941 testonly = true
[email protected]8603c5de2014-04-16 20:34:31942 sources = [
943 "tools/gdig/file_net_log.cc",
944 "tools/gdig/gdig.cc",
945 ]
946 deps = [
947 ":net",
948 "//base",
brettwba7a73d2015-08-31 22:17:39949 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:31950 ]
951 }
952
953 executable("get_server_time") {
Brett Wilson8f80ad0b2014-09-08 19:50:24954 testonly = true
scottmg34fb7e52014-12-03 23:27:24955 sources = [
956 "tools/get_server_time/get_server_time.cc",
957 ]
dpranke43276212015-02-20 02:55:19958
brettwd1c719a2015-02-19 23:17:04959 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
960 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31961 deps = [
962 ":net",
963 "//base",
964 "//base:i18n",
brettwba7a73d2015-08-31 22:17:39965 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:31966 "//url",
967 ]
968 }
969
rockot9c67e5f2015-03-12 20:01:21970 executable("hpack_example_generator") {
971 testonly = true
972 sources = [
973 "spdy/fuzzing/hpack_example_generator.cc",
974 ]
975
976 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
977 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
978 deps = [
rockot9c67e5f2015-03-12 20:01:21979 ":net",
brettwba7a73d2015-08-31 22:17:39980 "//base",
981 "//build/config/sanitizers:deps",
rockot9c67e5f2015-03-12 20:01:21982 ]
983 }
984
985 executable("hpack_fuzz_mutator") {
986 testonly = true
987 sources = [
988 "spdy/fuzzing/hpack_fuzz_mutator.cc",
989 ]
990
991 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
992 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
993 deps = [
rockot9c67e5f2015-03-12 20:01:21994 ":net",
brettwba7a73d2015-08-31 22:17:39995 "//base",
996 "//build/config/sanitizers:deps",
rockot9c67e5f2015-03-12 20:01:21997 ]
998 }
999
1000 executable("hpack_fuzz_wrapper") {
1001 testonly = true
1002 sources = [
1003 "spdy/fuzzing/hpack_fuzz_wrapper.cc",
1004 ]
1005
1006 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1007 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1008 deps = [
rockot9c67e5f2015-03-12 20:01:211009 ":net",
brettwba7a73d2015-08-31 22:17:391010 "//base",
1011 "//build/config/sanitizers:deps",
rockot9c67e5f2015-03-12 20:01:211012 ]
1013 }
1014
[email protected]8603c5de2014-04-16 20:34:311015 if (use_v8_in_net) {
1016 executable("net_watcher") {
Brett Wilson8f80ad0b2014-09-08 19:50:241017 testonly = true
scottmg34fb7e52014-12-03 23:27:241018 sources = [
1019 "tools/net_watcher/net_watcher.cc",
1020 ]
[email protected]8603c5de2014-04-16 20:34:311021 deps = [
1022 ":net",
1023 ":net_with_v8",
1024 "//base",
brettwba7a73d2015-08-31 22:17:391025 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:311026 ]
1027
mostynbbf5e6cc2015-10-21 07:53:311028 if (is_desktop_linux && use_gconf && use_glib) {
xunjieli905496a2015-08-31 15:51:171029 configs += [
1030 "//build/config/linux:gconf",
1031 "//build/config/linux:glib",
1032 ]
dprankead0c1f42015-08-28 21:48:041033 deps += [ "//build/linux:gio" ]
[email protected]8603c5de2014-04-16 20:34:311034 }
1035 }
1036 }
1037
1038 executable("run_testserver") {
Brett Wilson8f80ad0b2014-09-08 19:50:241039 testonly = true
scottmg34fb7e52014-12-03 23:27:241040 sources = [
1041 "tools/testserver/run_testserver.cc",
1042 ]
[email protected]8603c5de2014-04-16 20:34:311043 deps = [
[email protected]b2b2bf52014-05-28 20:26:571044 ":test_support",
[email protected]8603c5de2014-04-16 20:34:311045 "//base",
1046 "//base/test:test_support",
brettwba7a73d2015-08-31 22:17:391047 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:311048 "//testing/gtest",
1049 ]
1050 }
1051
1052 executable("stress_cache") {
Brett Wilson8f80ad0b2014-09-08 19:50:241053 testonly = true
scottmg34fb7e52014-12-03 23:27:241054 sources = [
rvargase23fcf652015-03-04 19:59:221055 "tools/stress_cache/stress_cache.cc",
scottmg34fb7e52014-12-03 23:27:241056 ]
dpranke43276212015-02-20 02:55:191057
brettwd1c719a2015-02-19 23:17:041058 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1059 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:311060 deps = [
1061 ":net",
[email protected]b2b2bf52014-05-28 20:26:571062 ":test_support",
[email protected]8603c5de2014-04-16 20:34:311063 "//base",
brettwba7a73d2015-08-31 22:17:391064 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:311065 ]
1066 }
1067
1068 executable("tld_cleanup") {
scottmg34fb7e52014-12-03 23:27:241069 sources = [
1070 "tools/tld_cleanup/tld_cleanup.cc",
1071 ]
dpranke43276212015-02-20 02:55:191072
brettwd1c719a2015-02-19 23:17:041073 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1074 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:311075 deps = [
1076 "//base",
1077 "//base:i18n",
brettwba7a73d2015-08-31 22:17:391078 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:311079 "//net/tools/tld_cleanup",
1080 ]
1081 }
1082}
1083
rch6983a3f2015-03-30 03:47:281084if (is_linux) {
gabadie64af64a2016-03-29 16:36:421085 executable("cachetool") {
1086 testonly = true
1087 sources = [
1088 "tools/cachetool/cachetool.cc",
1089 ]
1090 deps = [
1091 ":net",
1092 ":test_support",
1093 "//base",
1094 ]
1095 }
1096
1097 executable("content_decoder_tool") {
1098 testonly = true
1099 sources = [
1100 "filter/mock_filter_context.cc",
1101 "filter/mock_filter_context.h",
1102 "tools/content_decoder_tool/content_decoder_tool.cc",
1103 ]
1104 deps = [
1105 ":net",
1106 ":test_support",
1107 "//base",
1108 "//url",
1109 ]
1110 }
1111
[email protected]8a3f8242014-06-05 18:05:121112 static_library("epoll_server") {
[email protected]8603c5de2014-04-16 20:34:311113 sources = [
1114 "tools/epoll_server/epoll_server.cc",
1115 "tools/epoll_server/epoll_server.h",
1116 ]
1117 deps = [
1118 ":net",
1119 "//base",
1120 ]
1121 }
1122
[email protected]8a3f8242014-06-05 18:05:121123 static_library("flip_in_mem_edsm_server_base") {
Brett Wilson8f80ad0b2014-09-08 19:50:241124 testonly = true
[email protected]8603c5de2014-04-16 20:34:311125 sources = [
[email protected]8603c5de2014-04-16 20:34:311126 "tools/flip_server/acceptor_thread.cc",
satorux933fc7a2015-02-13 07:09:101127 "tools/flip_server/acceptor_thread.h",
1128 "tools/flip_server/constants.h",
[email protected]8603c5de2014-04-16 20:34:311129 "tools/flip_server/flip_config.cc",
1130 "tools/flip_server/flip_config.h",
1131 "tools/flip_server/http_interface.cc",
1132 "tools/flip_server/http_interface.h",
[email protected]8603c5de2014-04-16 20:34:311133 "tools/flip_server/mem_cache.cc",
satorux933fc7a2015-02-13 07:09:101134 "tools/flip_server/mem_cache.h",
[email protected]8603c5de2014-04-16 20:34:311135 "tools/flip_server/output_ordering.cc",
1136 "tools/flip_server/output_ordering.h",
1137 "tools/flip_server/ring_buffer.cc",
1138 "tools/flip_server/ring_buffer.h",
1139 "tools/flip_server/sm_connection.cc",
1140 "tools/flip_server/sm_connection.h",
1141 "tools/flip_server/sm_interface.h",
[email protected]8603c5de2014-04-16 20:34:311142 "tools/flip_server/spdy_interface.cc",
1143 "tools/flip_server/spdy_interface.h",
satorux933fc7a2015-02-13 07:09:101144 "tools/flip_server/spdy_ssl.cc",
1145 "tools/flip_server/spdy_ssl.h",
[email protected]8603c5de2014-04-16 20:34:311146 "tools/flip_server/spdy_util.cc",
1147 "tools/flip_server/spdy_util.h",
1148 "tools/flip_server/streamer_interface.cc",
1149 "tools/flip_server/streamer_interface.h",
tfarinafb3c78c2016-02-09 22:13:521150 "tools/flip_server/tcp_socket_util.cc",
1151 "tools/flip_server/tcp_socket_util.h",
rvargas145310f2015-08-14 18:09:041152 "tools/flip_server/url_to_filename_encoder.cc",
1153 "tools/flip_server/url_to_filename_encoder.h",
1154 "tools/flip_server/url_utilities.cc",
1155 "tools/flip_server/url_utilities.h",
[email protected]8603c5de2014-04-16 20:34:311156 ]
1157 deps = [
1158 ":balsa",
1159 ":epoll_server",
1160 ":net",
1161 "//base",
[email protected]edfd0f42014-07-22 18:20:371162 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311163 ]
1164 }
1165
1166 executable("flip_in_mem_edsm_server_unittests") {
Brett Wilson8f80ad0b2014-09-08 19:50:241167 testonly = true
[email protected]8603c5de2014-04-16 20:34:311168 sources = [
1169 "tools/flip_server/flip_test_utils.cc",
1170 "tools/flip_server/flip_test_utils.h",
1171 "tools/flip_server/http_interface_test.cc",
1172 "tools/flip_server/mem_cache_test.cc",
1173 "tools/flip_server/run_all_tests.cc",
1174 "tools/flip_server/spdy_interface_test.cc",
rvargas145310f2015-08-14 18:09:041175 "tools/flip_server/url_to_filename_encoder_unittest.cc",
1176 "tools/flip_server/url_utilities_unittest.cc",
[email protected]8603c5de2014-04-16 20:34:311177 ]
1178 deps = [
brettwbc44c0a92015-02-20 22:30:391179 ":balsa",
[email protected]8603c5de2014-04-16 20:34:311180 ":flip_in_mem_edsm_server_base",
1181 ":net",
[email protected]b2b2bf52014-05-28 20:26:571182 ":test_support",
brettwba7a73d2015-08-31 22:17:391183 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:311184 "//testing/gmock",
agrieved7a71c882015-11-20 19:53:281185 "//testing/gtest",
[email protected]edfd0f42014-07-22 18:20:371186 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311187 ]
1188 }
1189
1190 executable("flip_in_mem_edsm_server") {
Brett Wilson8f80ad0b2014-09-08 19:50:241191 testonly = true
scottmg34fb7e52014-12-03 23:27:241192 sources = [
1193 "tools/flip_server/flip_in_mem_edsm_server.cc",
1194 ]
[email protected]8603c5de2014-04-16 20:34:311195 deps = [
brettwbc44c0a92015-02-20 22:30:391196 ":balsa",
[email protected]8603c5de2014-04-16 20:34:311197 ":flip_in_mem_edsm_server_base",
1198 ":net",
1199 "//base",
brettwba7a73d2015-08-31 22:17:391200 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:311201 ]
1202 }
1203
rch216445c2015-03-27 00:23:281204 source_set("epoll_quic_tools") {
[email protected]8603c5de2014-04-16 20:34:311205 sources = [
1206 "tools/quic/quic_client.cc",
1207 "tools/quic/quic_client.h",
[email protected]8603c5de2014-04-16 20:34:311208 "tools/quic/quic_default_packet_writer.cc",
1209 "tools/quic/quic_default_packet_writer.h",
[email protected]8603c5de2014-04-16 20:34:311210 "tools/quic/quic_epoll_clock.cc",
1211 "tools/quic/quic_epoll_clock.h",
1212 "tools/quic/quic_epoll_connection_helper.cc",
1213 "tools/quic/quic_epoll_connection_helper.h",
rtennetifb3fa6c2015-03-16 23:04:551214 "tools/quic/quic_packet_reader.cc",
1215 "tools/quic/quic_packet_reader.h",
[email protected]8603c5de2014-04-16 20:34:311216 "tools/quic/quic_packet_writer_wrapper.cc",
1217 "tools/quic/quic_packet_writer_wrapper.h",
1218 "tools/quic/quic_server.cc",
1219 "tools/quic/quic_server.h",
[email protected]8603c5de2014-04-16 20:34:311220 "tools/quic/quic_socket_utils.cc",
1221 "tools/quic/quic_socket_utils.h",
[email protected]8603c5de2014-04-16 20:34:311222 ]
1223 deps = [
1224 ":balsa",
1225 ":epoll_server",
1226 ":net",
tfarina8ac4d17f2015-12-16 02:11:111227 ":simple_quic_tools",
[email protected]8603c5de2014-04-16 20:34:311228 "//base",
1229 "//base/third_party/dynamic_annotations",
1230 "//crypto",
[email protected]edfd0f42014-07-22 18:20:371231 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311232 "//url",
1233 ]
1234 }
1235
rch216445c2015-03-27 00:23:281236 executable("epoll_quic_client") {
scottmg34fb7e52014-12-03 23:27:241237 sources = [
1238 "tools/quic/quic_client_bin.cc",
1239 ]
[email protected]8603c5de2014-04-16 20:34:311240 deps = [
brettwbc44c0a92015-02-20 22:30:391241 ":balsa",
rch216445c2015-03-27 00:23:281242 ":epoll_quic_tools",
agrieved7a71c882015-11-20 19:53:281243 ":epoll_server",
rch216445c2015-03-27 00:23:281244 ":net",
1245 ":simple_quic_tools",
1246 "//base",
brettwba7a73d2015-08-31 22:17:391247 "//build/config/sanitizers:deps",
rch216445c2015-03-27 00:23:281248 "//third_party/boringssl",
1249 ]
1250 }
1251
1252 executable("epoll_quic_server") {
1253 sources = [
1254 "tools/quic/quic_server_bin.cc",
1255 ]
1256 deps = [
1257 ":balsa",
rch216445c2015-03-27 00:23:281258 ":epoll_quic_tools",
agrieved7a71c882015-11-20 19:53:281259 ":epoll_server",
[email protected]8603c5de2014-04-16 20:34:311260 ":net",
rchda78df5a2015-03-22 05:16:371261 ":simple_quic_tools",
[email protected]8603c5de2014-04-16 20:34:311262 "//base",
brettwba7a73d2015-08-31 22:17:391263 "//build/config/sanitizers:deps",
[email protected]edfd0f42014-07-22 18:20:371264 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311265 ]
1266 }
[email protected]8603c5de2014-04-16 20:34:311267}
1268
[email protected]ef0eb442014-05-15 09:32:181269if (is_android) {
1270 generate_jni("net_jni_headers") {
1271 sources = [
1272 "android/java/src/org/chromium/net/AndroidCertVerifyResult.java",
1273 "android/java/src/org/chromium/net/AndroidKeyStore.java",
1274 "android/java/src/org/chromium/net/AndroidNetworkLibrary.java",
tbansal59a1ddc2015-09-14 17:35:011275 "android/java/src/org/chromium/net/AndroidTrafficStats.java",
[email protected]ef0eb442014-05-15 09:32:181276 "android/java/src/org/chromium/net/GURLUtils.java",
aberentec894a52015-07-09 14:45:531277 "android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java",
xunjieli905496a2015-08-31 15:51:171278 "android/java/src/org/chromium/net/NetStringUtil.java",
[email protected]ef0eb442014-05-15 09:32:181279 "android/java/src/org/chromium/net/NetworkChangeNotifier.java",
1280 "android/java/src/org/chromium/net/ProxyChangeListener.java",
1281 "android/java/src/org/chromium/net/X509Util.java",
1282 ]
1283 jni_package = "net"
1284 }
cjhopmandad5f4272014-09-05 01:00:551285 generate_jni("net_test_jni_headers") {
1286 sources = [
1287 "android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java",
aberentec894a52015-07-09 14:45:531288 "test/android/javatests/src/org/chromium/net/test/DummySpnegoAuthenticator.java",
jbudorickccffb982015-12-22 01:21:351289 "test/android/javatests/src/org/chromium/net/test/EmbeddedTestServerImpl.java",
cjhopmandad5f4272014-09-05 01:00:551290 ]
brettwcdccaf02015-07-27 16:27:091291 jni_package = "net/test"
cjhopmandad5f4272014-09-05 01:00:551292 }
[email protected]ef0eb442014-05-15 09:32:181293}
[email protected]8603c5de2014-04-16 20:34:311294
1295if (is_android || is_linux) {
1296 executable("disk_cache_memory_test") {
Brett Wilson8f80ad0b2014-09-08 19:50:241297 testonly = true
scottmg34fb7e52014-12-03 23:27:241298 sources = [
1299 "tools/disk_cache_memory_test/disk_cache_memory_test.cc",
1300 ]
[email protected]8603c5de2014-04-16 20:34:311301 deps = [
1302 ":net",
1303 "//base",
brettwba7a73d2015-08-31 22:17:391304 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:311305 ]
1306 }
1307}
[email protected]8a3f8242014-06-05 18:05:121308
rch47ad01f2015-03-20 21:17:231309source_set("simple_quic_tools") {
rcha9d12ce12015-03-19 23:06:491310 sources = [
rtennetid67b3a722015-08-18 05:15:311311 "tools/quic/quic_client_base.cc",
1312 "tools/quic/quic_client_base.h",
rched113b22015-03-26 04:54:051313 "tools/quic/quic_client_session.cc",
1314 "tools/quic/quic_client_session.h",
rchc99f380c2015-03-26 19:50:561315 "tools/quic/quic_dispatcher.cc",
1316 "tools/quic/quic_dispatcher.h",
rch0e945472015-03-26 15:19:211317 "tools/quic/quic_in_memory_cache.cc",
1318 "tools/quic/quic_in_memory_cache.h",
rchc99f380c2015-03-26 19:50:561319 "tools/quic/quic_per_connection_packet_writer.cc",
1320 "tools/quic/quic_per_connection_packet_writer.h",
brettw25ca8922016-03-18 22:59:581321 "tools/quic/quic_process_packet_interface.h",
jokulikc971baf92016-01-06 00:36:391322 "tools/quic/quic_server_session_base.cc",
1323 "tools/quic/quic_server_session_base.h",
rcha9d12ce12015-03-19 23:06:491324 "tools/quic/quic_simple_client.cc",
1325 "tools/quic/quic_simple_client.h",
rch216445c2015-03-27 00:23:281326 "tools/quic/quic_simple_per_connection_packet_writer.cc",
1327 "tools/quic/quic_simple_per_connection_packet_writer.h",
1328 "tools/quic/quic_simple_server.cc",
1329 "tools/quic/quic_simple_server.h",
1330 "tools/quic/quic_simple_server_packet_writer.cc",
1331 "tools/quic/quic_simple_server_packet_writer.h",
jokulikc971baf92016-01-06 00:36:391332 "tools/quic/quic_simple_server_session.cc",
1333 "tools/quic/quic_simple_server_session.h",
danzhb7551342015-12-18 02:06:401334 "tools/quic/quic_simple_server_stream.cc",
1335 "tools/quic/quic_simple_server_stream.h",
rched113b22015-03-26 04:54:051336 "tools/quic/quic_spdy_client_stream.cc",
1337 "tools/quic/quic_spdy_client_stream.h",
rch0e945472015-03-26 15:19:211338 "tools/quic/quic_time_wait_list_manager.cc",
1339 "tools/quic/quic_time_wait_list_manager.h",
rchda78df5a2015-03-22 05:16:371340 "tools/quic/synchronous_host_resolver.cc",
1341 "tools/quic/synchronous_host_resolver.h",
rcha9d12ce12015-03-19 23:06:491342 ]
1343 deps = [
tfarina8ac4d17f2015-12-16 02:11:111344 ":balsa",
rcha9d12ce12015-03-19 23:06:491345 ":net",
1346 "//base",
rch47ad01f2015-03-20 21:17:231347 "//base/third_party/dynamic_annotations",
1348 "//url",
1349 ]
1350}
1351
ricea7afa5232015-12-01 20:55:231352action_foreach("stale_while_revalidate_experiment_domains_dafsa") {
1353 script = "//net/tools/dafsa/make_dafsa.py"
1354 sources = [
1355 "base/stale_while_revalidate_experiment_domains.gperf",
1356 ]
1357 outputs = [
1358 "${target_gen_dir}/base/{{source_name_part}}-inc.cc",
1359 ]
1360 args = [
1361 "{{source}}",
1362 rebase_path("${target_gen_dir}/base/{{source_name_part}}-inc.cc",
1363 root_build_dir),
1364 ]
1365}
1366
1367source_set("stale_while_revalidate_experiment_domains") {
1368 sources = [
1369 "base/stale_while_revalidate_experiment_domains.cc",
1370 "base/stale_while_revalidate_experiment_domains.h",
1371 ]
1372 deps = [
1373 ":net",
1374 ":stale_while_revalidate_experiment_domains_dafsa",
1375 "//base",
1376 ]
kapishnikovabe280e2016-04-14 19:07:161377 configs += net_configs
ricea7afa5232015-12-01 20:55:231378}
1379
sherouk51b4b098b2015-08-10 09:00:431380if (!is_ios) {
1381 executable("quic_client") {
1382 sources = [
1383 "tools/quic/quic_simple_client_bin.cc",
1384 ]
1385 deps = [
1386 ":net",
1387 ":simple_quic_tools",
1388 "//base",
brettwba7a73d2015-08-31 22:17:391389 "//build/config/sanitizers:deps",
sherouk51b4b098b2015-08-10 09:00:431390 "//url",
1391 ]
1392 }
1393 executable("quic_server") {
1394 sources = [
1395 "tools/quic/quic_simple_server_bin.cc",
1396 ]
1397 deps = [
1398 ":net",
1399 ":simple_quic_tools",
1400 "//base",
brettwba7a73d2015-08-31 22:17:391401 "//build/config/sanitizers:deps",
sherouk51b4b098b2015-08-10 09:00:431402 "//third_party/boringssl",
1403 "//third_party/protobuf:protobuf_lite",
1404 ]
1405 }
rch216445c2015-03-27 00:23:281406}
1407
sdefresneb0a31642016-03-18 11:04:451408bundle_data("net_unittests_bundle_data") {
1409 testonly = true
1410 sources = [
1411 "data/certificate_policies_unittest",
1412 "data/name_constraints_unittest",
1413 "data/parse_certificate_unittest",
svaldez666b3cfb2016-04-01 20:45:241414 "data/parse_ocsp_unittest",
sdefresneb0a31642016-03-18 11:04:451415 "data/test.html",
1416 "data/url_request_unittest",
1417 "data/verify_certificate_chain_unittest",
1418 "data/verify_name_match_unittest/names",
svaldezb7f886b32016-04-12 21:56:061419 "third_party/nist-pkits/certs",
1420 "third_party/nist-pkits/crls",
sdefresneb0a31642016-03-18 11:04:451421 ]
1422 outputs = [
1423 "{{bundle_resources_dir}}/" +
1424 "{{source_root_relative_dir}}/{{source_file_part}}",
1425 ]
1426}
1427
dpranke64df2832015-07-31 22:33:361428test("net_unittests") {
1429 sources = gypi_values.net_test_sources
1430
1431 configs += [
1432 "//build/config:precompiled_headers",
1433
1434 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1435 "//build/config/compiler:no_size_t_to_int_warning",
1436 ]
1437 defines = []
1438
1439 deps = [
1440 ":balsa",
1441 ":extras",
dpranke64df2832015-07-31 22:33:361442 ":net",
sdefresneb0a31642016-03-18 11:04:451443 ":net_unittests_bundle_data",
dpranke64df2832015-07-31 22:33:361444 ":simple_quic_tools",
ricea7afa5232015-12-01 20:55:231445 ":stale_while_revalidate_experiment_domains",
dpranke64df2832015-07-31 22:33:361446 ":test_support",
1447 "//base",
1448 "//base:i18n",
dpranke64df2832015-07-31 22:33:361449 "//base/third_party/dynamic_annotations",
1450 "//crypto",
1451 "//crypto:platform",
1452 "//crypto:test_support",
dpranke64df2832015-07-31 22:33:361453 "//net/base/registry_controlled_domains",
1454 "//sql",
1455 "//testing/gmock",
1456 "//testing/gtest",
1457 "//third_party/zlib",
1458 "//url",
kapishnikovabe280e2016-04-14 19:07:161459 "//url:url_features",
dpranke64df2832015-07-31 22:33:361460 ]
1461
1462 data = [
1463 "data/",
1464 ]
mattm6586b432016-02-12 04:52:391465 data_deps = []
1466
svaldezb7f886b32016-04-12 21:56:061467 if (use_openssl) {
mattm6586b432016-02-12 04:52:391468 data_deps += [ "third_party/nist-pkits/" ]
1469 }
dpranke64df2832015-07-31 22:33:361470
1471 if (is_linux || is_mac || is_win) {
1472 deps += [
1473 "//third_party/pyftpdlib/",
1474 "//third_party/pywebsocket/",
1475 "//third_party/tlslite/",
1476 ]
mattm6586b432016-02-12 04:52:391477 data_deps += [
dpranke64df2832015-07-31 22:33:361478 "//third_party/pyftpdlib/",
1479 "//third_party/pywebsocket/",
1480 "//third_party/tlslite/",
1481 ]
1482 data += [
1483 "tools/testserver/",
1484 "//third_party/pyftpdlib/",
1485 "//third_party/pywebsocket/",
1486 "//third_party/tlslite/",
1487 "$root_out_dir/pyproto/google/",
dprankef497c7962015-07-31 19:46:231488 ]
1489 }
1490
dpranke64df2832015-07-31 22:33:361491 if (is_desktop_linux) {
1492 deps += [ ":epoll_quic_tools" ]
1493 }
1494 if (is_linux) {
1495 sources += gypi_values.net_linux_test_sources
1496 deps += [
1497 ":epoll_quic_tools",
1498 ":epoll_server",
1499 ":flip_in_mem_edsm_server_base",
brettwbc8b2a22015-07-28 18:24:421500 ]
dpranke64df2832015-07-31 22:33:361501 }
[email protected]8a3f8242014-06-05 18:05:121502
dpranke64df2832015-07-31 22:33:361503 if (is_mac || is_ios) {
1504 sources += gypi_values.net_base_test_mac_ios_sources
1505 }
1506
1507 if (is_chromeos) {
1508 sources -= [ "proxy/proxy_config_service_linux_unittest.cc" ]
1509 }
1510
1511 if (v8_use_external_startup_data) {
1512 deps += [ "//gin" ]
1513 }
1514
1515 if (!use_nss_certs) {
1516 sources -= [
1517 "cert/nss_cert_database_unittest.cc",
1518 "ssl/client_cert_store_nss_unittest.cc",
[email protected]8a3f8242014-06-05 18:05:121519 ]
dpranke64df2832015-07-31 22:33:361520 if (is_chromeos) { # Already removed for all non-ChromeOS builds.
davidben2bcbc6b2015-04-22 02:36:411521 sources -= [
dpranke64df2832015-07-31 22:33:361522 "cert/nss_cert_database_chromeos_unittest.cc",
1523 "cert/nss_profile_filter_chromeos_unittest.cc",
davidben2bcbc6b2015-04-22 02:36:411524 ]
brettw43ae0e12015-07-14 22:12:361525 }
[email protected]8a3f8242014-06-05 18:05:121526 }
dpranke64df2832015-07-31 22:33:361527
1528 if (use_openssl) {
dpranke64df2832015-07-31 22:33:361529 sources -= [ "quic/test_tools/crypto_test_utils_nss.cc" ]
1530 } else {
1531 sources -= [
dpranke64df2832015-07-31 22:33:361532 "quic/test_tools/crypto_test_utils_openssl.cc",
dpranke64df2832015-07-31 22:33:361533 "ssl/ssl_client_session_cache_openssl_unittest.cc",
1534 ]
1535 }
1536
1537 if (use_kerberos) {
1538 defines += [ "USE_KERBEROS" ]
1539 }
1540
1541 # These are excluded on Android, because the actual Kerberos support, which
1542 # these test, is in a separate app on Android.
1543 if (!use_kerberos || is_android) {
1544 sources -= [
1545 "http/http_auth_gssapi_posix_unittest.cc",
1546 "http/mock_gssapi_library_posix.cc",
1547 "http/mock_gssapi_library_posix.h",
1548 ]
1549 }
1550 if (!use_kerberos) {
1551 sources -= [ "http/http_auth_handler_negotiate_unittest.cc" ]
1552 }
1553
svaldeza1714ab2016-03-18 20:47:531554 if (!use_nss_verifier) {
1555 # Only include this test when using NSS for cert verification.
dpranke64df2832015-07-31 22:33:361556 sources -= [ "cert_net/nss_ocsp_unittest.cc" ]
1557 }
1558
1559 if (!use_openssl_certs) {
1560 sources -= [ "ssl/openssl_client_key_store_unittest.cc" ]
1561 }
1562
jbudorick1273a842016-04-01 19:50:051563 if (enable_websockets) {
1564 sources += gypi_values.net_websockets_test_sources
1565 deps += [ ":http_server" ]
dpranke64df2832015-07-31 22:33:361566 }
1567
1568 if (disable_file_support) {
1569 sources -= [
1570 "base/directory_lister_unittest.cc",
Thiago Farinad673bb122016-01-06 23:18:161571 "base/directory_listing_unittest.cc",
shahriar.rostamia8c06daf2016-02-12 00:07:041572 "url_request/url_request_file_dir_job_unittest.cc",
dpranke64df2832015-07-31 22:33:361573 "url_request/url_request_file_job_unittest.cc",
1574 ]
1575 }
1576
1577 if (disable_ftp_support) {
1578 sources -= [
1579 "ftp/ftp_auth_cache_unittest.cc",
1580 "ftp/ftp_ctrl_response_buffer_unittest.cc",
1581 "ftp/ftp_directory_listing_parser_ls_unittest.cc",
dpranke64df2832015-07-31 22:33:361582 "ftp/ftp_directory_listing_parser_unittest.cc",
1583 "ftp/ftp_directory_listing_parser_unittest.h",
1584 "ftp/ftp_directory_listing_parser_vms_unittest.cc",
1585 "ftp/ftp_directory_listing_parser_windows_unittest.cc",
1586 "ftp/ftp_network_transaction_unittest.cc",
1587 "ftp/ftp_util_unittest.cc",
1588 "url_request/url_request_ftp_job_unittest.cc",
1589 ]
1590 }
1591
1592 if (!enable_built_in_dns) {
1593 sources -= [
1594 "dns/address_sorter_posix_unittest.cc",
1595 "dns/address_sorter_unittest.cc",
1596 ]
1597 }
1598
xunjieli905496a2015-08-31 15:51:171599 if (use_v8_in_net) {
dpranke64df2832015-07-31 22:33:361600 deps += [ ":net_with_v8" ]
1601 } else {
1602 sources -= [
1603 "proxy/proxy_resolver_v8_tracing_unittest.cc",
1604 "proxy/proxy_resolver_v8_tracing_wrapper_unittest.cc",
1605 "proxy/proxy_resolver_v8_unittest.cc",
1606 ]
1607 }
1608
1609 if (use_v8_in_net && !is_android) {
1610 deps += [
1611 ":net_browser_services",
1612 ":net_utility_services",
rockotc637caf9b2016-02-10 09:57:081613 "//mojo/edk/system",
dpranke64df2832015-07-31 22:33:361614 ]
1615 } else {
1616 sources -= [
1617 "dns/host_resolver_mojo_unittest.cc",
1618 "dns/mojo_host_resolver_impl_unittest.cc",
1619 "proxy/mojo_proxy_resolver_factory_impl_unittest.cc",
1620 "proxy/mojo_proxy_resolver_impl_unittest.cc",
1621 "proxy/mojo_proxy_resolver_v8_tracing_bindings_unittest.cc",
1622 "proxy/proxy_resolver_factory_mojo_unittest.cc",
1623 "proxy/proxy_service_mojo_unittest.cc",
1624 ]
1625 }
1626
1627 if (!enable_mdns) {
1628 sources -= [
1629 "dns/mdns_cache_unittest.cc",
1630 "dns/mdns_client_unittest.cc",
1631 "dns/record_parsed_unittest.cc",
1632 "dns/record_rdata_unittest.cc",
1633 ]
1634 }
1635
1636 if (is_ios) {
dpranke64df2832015-07-31 22:33:361637 sources -= [
1638 # TODO(droger): The following tests are disabled because the
1639 # implementation is missing or incomplete.
1640 # KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS.
1641 "base/keygen_handler_unittest.cc",
1642 "disk_cache/backend_unittest.cc",
1643 "disk_cache/blockfile/block_files_unittest.cc",
1644
1645 # Need to read input data files.
1646 "filter/gzip_filter_unittest.cc",
1647 "socket/ssl_server_socket_unittest.cc",
1648 "spdy/fuzzing/hpack_fuzz_util_test.cc",
1649
1650 # Need TestServer.
1651 "cert_net/cert_net_fetcher_impl_unittest.cc",
1652 "proxy/proxy_script_fetcher_impl_unittest.cc",
1653 "socket/ssl_client_socket_unittest.cc",
1654 "url_request/url_fetcher_impl_unittest.cc",
1655 "url_request/url_request_context_builder_unittest.cc",
1656
1657 # Needs GetAppOutput().
1658 "test/python_utils_unittest.cc",
1659
1660 # The following tests are disabled because they don't apply to
1661 # iOS.
1662 # OS is not "linux" or "freebsd" or "openbsd".
1663 "socket/unix_domain_client_socket_posix_unittest.cc",
1664 "socket/unix_domain_server_socket_posix_unittest.cc",
1665
1666 # See bug http://crbug.com/344533.
1667 "disk_cache/blockfile/index_table_v3_unittest.cc",
1668 ]
1669 }
1670
kapishnikovabe280e2016-04-14 19:07:161671 # Unit tests that aren't supported by the current ICU alternatives on Android.
1672 if (is_android && use_platform_icu_alternatives) {
1673 sources -= [
1674 "base/filename_util_unittest.cc",
1675 "base/url_util_unittest.cc",
1676 "cert/x509_certificate_unittest.cc",
1677 "proxy/proxy_resolver_v8_unittest.cc",
1678 "url_request/url_request_job_unittest.cc",
1679 ]
1680 }
1681
1682 # Unit tests that are not supported by the current ICU alternatives on iOS.
1683 if (is_ios && use_platform_icu_alternatives) {
1684 sources -= [
1685 "base/filename_util_unittest.cc",
1686 "base/url_util_unittest.cc",
1687 "cert/x509_certificate_unittest.cc",
1688 "http/http_auth_handler_basic_unittest.cc",
1689 "http/http_auth_handler_digest_unittest.cc",
1690 "http/http_auth_handler_factory_unittest.cc",
1691 "http/http_auth_unittest.cc",
1692 "http/http_content_disposition_unittest.cc",
1693 "http/http_network_transaction_unittest.cc",
1694 "http/http_proxy_client_socket_pool_unittest.cc",
1695 "socket/ssl_client_socket_pool_unittest.cc",
1696 "spdy/spdy_network_transaction_unittest.cc",
1697 "spdy/spdy_proxy_client_socket_unittest.cc",
1698 "url_request/url_request_job_unittest.cc",
1699 "url_request/url_request_unittest.cc",
1700 ]
1701 }
1702
1703 # Exclude brotli test if the support for brotli is disabled.
1704 # Also, exclude the test from iOS for now (needs to read input data files).
1705 if (disable_brotli_filter || is_ios) {
1706 sources -= [ "filter/brotli_filter_unittest.cc" ]
1707 }
1708
dpranke64df2832015-07-31 22:33:361709 if (is_android) {
agrieve97176362015-12-01 16:36:191710 deps += [
1711 ":net_test_jni_headers",
agrievea5517aa2015-10-23 03:03:451712 "//base:base_java_unittest_support",
1713 "//net/android:net_java",
agrievea5517aa2015-10-23 03:03:451714 "//net/android:net_java_test_support",
agrieve97176362015-12-01 16:36:191715 "//net/android:net_javatests",
agrievea5517aa2015-10-23 03:03:451716 "//net/android:net_unittests_apk_resources",
agrieve97176362015-12-01 16:36:191717
1718 # TODO(mmenke): This depends on test_support_base, which depends on
1719 # icu. Figure out a way to remove that dependency.
1720 "//testing/android/native_test:native_test_native_code",
pkotwicz8c7027d2015-11-11 06:30:071721 "//v8:v8_external_startup_data_assets",
agrievea5517aa2015-10-23 03:03:451722 ]
1723 android_manifest = "//net/android/unittest_support/AndroidManifest.xml"
dpranke64df2832015-07-31 22:33:361724 sources -= [
1725 # See bug http://crbug.com/344533.
1726 "disk_cache/blockfile/index_table_v3_unittest.cc",
dpranke64df2832015-07-31 22:33:361727 ]
dpranke64df2832015-07-31 22:33:361728 set_sources_assignment_filter([])
1729 sources += [ "base/address_tracker_linux_unittest.cc" ]
1730 set_sources_assignment_filter(sources_assignment_filter)
1731 isolate_file = "net_unittests.isolate"
agrieve3ac557f02016-04-12 15:52:001732 shard_timeout = 300
dpranke64df2832015-07-31 22:33:361733 }
1734
dpranke64df2832015-07-31 22:33:361735 # Symbols for crashes when running tests on swarming.
1736 if (symbol_level > 0) {
1737 if (is_win) {
1738 data += [ "$root_out_dir/net_unittests.exe.pdb" ]
1739 } else if (is_mac) {
1740 data += [ "$root_out_dir/net_unittests.dSYM/" ]
1741 }
1742 }
1743}
1744
1745# !is_android && !is_win && !is_mac
sdefresne3001f172016-03-16 10:30:031746if (!is_ios) {
1747 # TODO(crbug.com/594965): this should be converted to "app" template and
1748 # enabled on iOS too.
1749 executable("net_perftests") {
1750 testonly = true
1751 sources = [
1752 "base/mime_sniffer_perftest.cc",
1753 "cookies/cookie_monster_perftest.cc",
1754 "disk_cache/blockfile/disk_cache_perftest.cc",
1755 "extras/sqlite/sqlite_persistent_cookie_store_perftest.cc",
1756 "proxy/proxy_resolver_perftest.cc",
1757 "udp/udp_socket_perftest.cc",
1758 ]
[email protected]8a3f8242014-06-05 18:05:121759
sdefresne3001f172016-03-16 10:30:031760 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1761 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1762 deps = [
1763 ":extras",
1764 ":net",
1765 ":test_support",
1766 "//base",
1767 "//base:i18n",
1768 "//base/test:test_support_perf",
1769 "//build/config/sanitizers:deps",
1770 "//testing/gtest",
1771 "//url",
1772 ]
rockot9c67e5f2015-03-12 20:01:211773
sdefresne3001f172016-03-16 10:30:031774 if (enable_websockets) {
1775 sources += [ "websockets/websocket_frame_perftest.cc" ]
1776 }
rockot9c67e5f2015-03-12 20:01:211777
sdefresne3001f172016-03-16 10:30:031778 if (use_v8_in_net) {
1779 deps += [ ":net_with_v8" ]
1780 } else {
1781 sources -= [ "proxy/proxy_resolver_perftest.cc" ]
1782 }
rockot9c67e5f2015-03-12 20:01:211783 }
rockot9c67e5f2015-03-12 20:01:211784}
mefff34b822016-01-11 15:28:081785
eromanfe8659e2016-03-02 23:47:021786# Fuzzers
1787
eroman02b4fe562016-03-04 12:15:161788source_set("net_fuzzer_test_support") {
1789 testonly = true
1790
1791 sources = [
1792 "base/fuzzer_test_support.cc",
mmenke99b57172016-04-14 20:44:331793 "socket/fuzzed_socket.cc",
1794 "socket/fuzzed_socket.h",
eroman02b4fe562016-03-04 12:15:161795 ]
1796 deps = [
1797 "//base",
1798 "//base:i18n",
mmenke99b57172016-04-14 20:44:331799 "//net",
eroman02b4fe562016-03-04 12:15:161800 ]
1801}
1802
mmenke5552a6a2016-03-28 23:11:591803fuzzer_test("net_mime_sniffer_fuzzer") {
1804 sources = [
1805 "base/mime_sniffer_fuzzer.cc",
1806 ]
1807 deps = [
1808 ":net_fuzzer_test_support",
1809 "//base",
1810 "//net",
1811 ]
1812}
1813
mmoroz565e8df22016-03-04 18:17:201814fuzzer_test("net_parse_proxy_list_pac_fuzzer") {
eromane6264fd2016-03-02 22:46:301815 sources = [
1816 "proxy/parse_proxy_list_pac_fuzzer.cc",
1817 ]
1818 deps = [
eroman02b4fe562016-03-04 12:15:161819 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301820 "//net",
1821 ]
1822}
1823
mmoroz565e8df22016-03-04 18:17:201824fuzzer_test("net_parse_proxy_list_fuzzer") {
eromane6264fd2016-03-02 22:46:301825 sources = [
1826 "proxy/parse_proxy_list_fuzzer.cc",
1827 ]
1828 deps = [
eroman02b4fe562016-03-04 12:15:161829 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301830 "//net",
1831 ]
1832}
1833
mmoroz565e8df22016-03-04 18:17:201834fuzzer_test("net_parse_proxy_bypass_rules_fuzzer") {
eromane6264fd2016-03-02 22:46:301835 sources = [
1836 "proxy/parse_proxy_bypass_rules_fuzzer.cc",
1837 ]
1838 deps = [
eroman02b4fe562016-03-04 12:15:161839 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301840 "//net",
1841 ]
1842}
1843
mmoroz565e8df22016-03-04 18:17:201844fuzzer_test("net_parse_proxy_rules_fuzzer") {
eromane6264fd2016-03-02 22:46:301845 sources = [
1846 "proxy/parse_proxy_rules_fuzzer.cc",
1847 ]
1848 deps = [
eroman02b4fe562016-03-04 12:15:161849 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301850 "//net",
1851 ]
1852}
1853
mmoroz565e8df22016-03-04 18:17:201854fuzzer_test("net_parse_data_url_fuzzer") {
eromane6264fd2016-03-02 22:46:301855 sources = [
1856 "base/parse_data_url_fuzzer.cc",
1857 ]
1858 deps = [
eroman02b4fe562016-03-04 12:15:161859 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301860 "//base",
1861 "//net",
1862 ]
1863}
1864
mmoroz565e8df22016-03-04 18:17:201865fuzzer_test("net_parse_ip_pattern_fuzzer") {
eromane6264fd2016-03-02 22:46:301866 sources = [
1867 "base/parse_ip_pattern_fuzzer.cc",
1868 ]
1869 deps = [
eroman02b4fe562016-03-04 12:15:161870 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301871 "//net",
1872 ]
1873}
1874
mmoroz565e8df22016-03-04 18:17:201875fuzzer_test("net_get_domain_and_registry_fuzzer") {
eromane6264fd2016-03-02 22:46:301876 sources = [
1877 "base/registry_controlled_domains/get_domain_and_registry_fuzzer.cc",
1878 ]
1879 deps = [
eroman02b4fe562016-03-04 12:15:161880 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301881 "//base",
eromane6264fd2016-03-02 22:46:301882 "//net",
1883 ]
1884}
1885
mmoroz565e8df22016-03-04 18:17:201886fuzzer_test("net_parse_cookie_line_fuzzer") {
eromane6264fd2016-03-02 22:46:301887 sources = [
1888 "cookies/parse_cookie_line_fuzzer.cc",
1889 ]
1890 deps = [
eroman02b4fe562016-03-04 12:15:161891 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301892 "//net",
1893 ]
1894}
1895
mmoroz565e8df22016-03-04 18:17:201896fuzzer_test("net_dns_record_fuzzer") {
eromanfe8659e2016-03-02 23:47:021897 sources = [
1898 "dns/dns_record_fuzzer.cc",
1899 ]
1900 deps = [
eroman02b4fe562016-03-04 12:15:161901 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021902 "//base",
1903 "//net",
1904 ]
1905}
1906
mmenke44e8e9c2016-03-29 18:38:571907fuzzer_test("net_http_stream_parser_fuzzer") {
1908 sources = [
1909 "http/http_stream_parser_fuzzer.cc",
1910 ]
1911 deps = [
1912 ":net_fuzzer_test_support",
1913 ":test_support",
1914 "//base",
1915 "//net",
1916 ]
1917}
1918
mmoroz565e8df22016-03-04 18:17:201919fuzzer_test("net_ftp_ctrl_response_fuzzer") {
eromanfe8659e2016-03-02 23:47:021920 sources = [
1921 "ftp/ftp_ctrl_response_fuzzer.cc",
1922 ]
1923 deps = [
eroman02b4fe562016-03-04 12:15:161924 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021925 "//base",
1926 "//net",
1927 ]
1928}
1929
mmoroz565e8df22016-03-04 18:17:201930fuzzer_test("net_ftp_directory_listing_fuzzer") {
eromanfe8659e2016-03-02 23:47:021931 sources = [
1932 "ftp/ftp_directory_listing_fuzzer.cc",
1933 ]
1934 deps = [
eroman02b4fe562016-03-04 12:15:161935 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021936 "//base",
eromanfe8659e2016-03-02 23:47:021937 "//net",
1938 ]
1939}
1940
mmoroz565e8df22016-03-04 18:17:201941fuzzer_test("net_unescape_url_component_fuzzer") {
eromanfe8659e2016-03-02 23:47:021942 sources = [
1943 "base/unescape_url_component_fuzzer.cc",
1944 ]
1945 deps = [
eroman02b4fe562016-03-04 12:15:161946 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021947 "//base",
1948 "//net",
1949 ]
mmoroz34eb0082016-03-11 14:32:011950 dict = "base/unescape_url_component_fuzzer.dict"
mmoroz062a4a62016-04-12 09:02:331951 libfuzzer_options = [ "max_len = 2048" ]
eromanfe8659e2016-03-02 23:47:021952}
1953
mmoroz565e8df22016-03-04 18:17:201954fuzzer_test("net_websocket_frame_parser_fuzzer") {
eromanfe8659e2016-03-02 23:47:021955 sources = [
1956 "websockets/websocket_frame_parser_fuzzer.cc",
1957 ]
1958 deps = [
eroman02b4fe562016-03-04 12:15:161959 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021960 "//net",
1961 ]
1962}
1963
mmoroz565e8df22016-03-04 18:17:201964fuzzer_test("net_http_chunked_decoder_fuzzer") {
eromanfe8659e2016-03-02 23:47:021965 sources = [
1966 "http/http_chunked_decoder_fuzzer.cc",
1967 ]
1968 deps = [
eroman02b4fe562016-03-04 12:15:161969 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021970 "//net",
1971 ]
mmoroz5fa27922016-03-22 19:42:191972 dict = "http/http_chunked_decoder_fuzzer.dict"
eromanfe8659e2016-03-02 23:47:021973}
1974
mmenke8e9314bc2016-04-15 21:45:021975fuzzer_test("net_http_proxy_client_socket_fuzzer") {
1976 sources = [
1977 "http/http_proxy_client_socket_fuzzer.cc",
1978 ]
1979 deps = [
1980 ":net_fuzzer_test_support",
1981 ":test_support",
1982 "//base",
1983 "//net",
1984 ]
1985}
1986
mmoroz565e8df22016-03-04 18:17:201987fuzzer_test("net_quic_crypto_framer_parse_message_fuzzer") {
eromanfe8659e2016-03-02 23:47:021988 sources = [
1989 "quic/quic_crypto_framer_parse_message_fuzzer.cc",
1990 ]
1991 deps = [
eroman02b4fe562016-03-04 12:15:161992 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021993 "//base",
1994 "//net",
1995 ]
1996}
mmenke99b57172016-04-14 20:44:331997
1998fuzzer_test("net_socks_client_socket_fuzzer") {
1999 sources = [
2000 "socket/socks_client_socket_fuzzer.cc",
2001 ]
2002 deps = [
2003 ":net_fuzzer_test_support",
2004 ":test_support",
2005 "//base",
2006 "//net",
2007 ]
2008}
2009
2010fuzzer_test("net_socks5_client_socket_fuzzer") {
2011 sources = [
2012 "socket/socks5_client_socket_fuzzer.cc",
2013 ]
2014 deps = [
2015 ":net_fuzzer_test_support",
2016 ":test_support",
2017 "//base",
2018 "//net",
2019 ]
2020}