blob: 471d8b856ce63ed32ed4f81365db33d3f6e33733 [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 = [
[email protected]8603c5de2014-04-16 20:34:3175 "DLOPEN_KERBEROS",
scottmg34fb7e52014-12-03 23:27:2476 "NET_IMPLEMENTATION",
[email protected]8603c5de2014-04-16 20:34:3177 ]
dpranke43276212015-02-20 02:55:1978
[email protected]4625ade2014-04-15 19:26:4479 if (use_kerberos) {
80 defines += [ "USE_KERBEROS" ]
81 if (is_android) {
xunjieli905496a2015-08-31 15:51:1782 include_dirs = [ "/usr/include/kerberosV" ]
[email protected]4625ade2014-04-15 19:26:4483 }
[email protected]4625ade2014-04-15 19:26:4484 }
85
86 if (enable_built_in_dns) {
87 defines += [ "ENABLE_BUILT_IN_DNS" ]
xunjieli905496a2015-08-31 15:51:1788 }
89}
90
kapishnikovabe280e2016-04-14 19:07:1691net_configs = [
xunjieli905496a2015-08-31 15:51:1792 ":net_internal_config",
93 "//build/config:precompiled_headers",
94
95 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
96 "//build/config/compiler:no_size_t_to_int_warning",
97]
98
kapishnikovabe280e2016-04-14 19:07:1699if (use_glib && use_gconf && !is_chromeos) {
agrieve95ba4442016-04-25 15:47:13100 net_configs += [ "//build/config/linux/gconf" ]
kapishnikovabe280e2016-04-14 19:07:16101}
xunjieli905496a2015-08-31 15:51:17102
kapishnikovabe280e2016-04-14 19:07:16103if (is_linux) {
104 net_configs += [ "//build/config/linux:libresolv" ]
xunjieli905496a2015-08-31 15:51:17105}
106
107component("net") {
kapishnikovabe280e2016-04-14 19:07:16108 sources = gypi_values.net_nacl_common_sources
109 net_unfiltered_sources = []
110
111 deps = [
112 ":net_resources",
113 "//base",
114 "//net/base/registry_controlled_domains",
115 "//third_party/protobuf:protobuf_lite",
116 "//url:url_features",
117 ]
118
119 public_deps = [
120 ":net_quic_proto",
121 "//crypto",
122 "//crypto:platform",
123 ]
124
125 if (!is_nacl) {
126 sources += gypi_values.net_non_nacl_sources
127
128 deps += [
129 "//base/third_party/dynamic_annotations",
130 "//components/prefs",
131 "//sdch",
132 "//third_party/zlib",
133 ]
134
135 if (!use_kerberos) {
136 sources -= [
137 "http/http_auth_handler_negotiate.cc",
138 "http/http_auth_handler_negotiate.h",
139 ]
140 }
141
142 if (is_posix) {
143 if (posix_avoid_mmap) {
144 sources -= [ "disk_cache/blockfile/mapped_file_posix.cc" ]
145 } else {
146 sources -= [ "disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc" ]
147 }
148 }
149
150 if (!enable_built_in_dns) {
151 sources -= [
152 "dns/address_sorter_posix.cc",
153 "dns/address_sorter_posix.h",
154 "dns/dns_client.cc",
155 ]
156 }
157
kapishnikovabe280e2016-04-14 19:07:16158 if (!use_openssl_certs) {
159 sources -= [
160 "base/crypto_module_openssl.cc",
161 "base/keygen_handler_openssl.cc",
162 "base/openssl_private_key_store.h",
163 "base/openssl_private_key_store_memory.cc",
164 "cert/cert_database_openssl.cc",
165 "cert/cert_verify_proc_openssl.cc",
166 "cert/cert_verify_proc_openssl.h",
167 "cert/test_root_certs_openssl.cc",
168 "cert/x509_certificate_openssl.cc",
169 "ssl/openssl_client_key_store.cc",
170 "ssl/openssl_client_key_store.h",
171 ]
172 if (is_android) {
173 sources -= [ "base/openssl_private_key_store_android.cc" ]
174 }
175 } else {
176 if (is_android) {
177 # Android doesn't use these even when using OpenSSL.
178 sources -= [
179 "base/openssl_private_key_store_memory.cc",
180 "cert/cert_database_openssl.cc",
181 "cert/cert_verify_proc_openssl.cc",
182 "cert/test_root_certs_openssl.cc",
183 ]
184 }
185 }
186
187 if (!use_kerberos || is_android) {
188 sources -= [
189 "http/http_auth_gssapi_posix.cc",
190 "http/http_auth_gssapi_posix.h",
191 ]
192 }
193
194 if (use_glib && use_gconf && !is_chromeos) {
dsinclair8490e052016-05-04 15:33:33195 deps += [ "//build/linux/libgio" ]
kapishnikovabe280e2016-04-14 19:07:16196 }
197
198 if (!use_nss_certs) {
199 sources -= [
200 "base/crypto_module_nss.cc",
201 "base/keygen_handler_nss.cc",
202 "cert/cert_database_nss.cc",
203 "cert/nss_cert_database.cc",
204 "cert/nss_cert_database.h",
205 "cert/x509_certificate_nss.cc",
206 "ssl/client_cert_store_nss.cc",
207 "ssl/client_cert_store_nss.h",
208 "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
209 "third_party/mozilla_security_manager/nsKeygenHandler.h",
210 "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
211 "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
212 "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
213 "third_party/mozilla_security_manager/nsPKCS12Blob.h",
214 ]
215 if (is_chromeos) {
216 # These were already removed on non-ChromeOS.
217 sources -= [
218 "cert/nss_cert_database_chromeos.cc",
219 "cert/nss_cert_database_chromeos.h",
220 "cert/nss_profile_filter_chromeos.cc",
221 "cert/nss_profile_filter_chromeos.h",
222 ]
223 }
224 sources -= [
225 "ssl/client_key_store.cc",
226 "ssl/client_key_store.h",
227 "ssl/ssl_platform_key_nss.cc",
228 ]
svaldez2135be52016-04-20 16:34:53229 } else {
kapishnikovabe280e2016-04-14 19:07:16230 # client_cert_store_nss.c requires NSS_CmpCertChainWCANames from NSS's
231 # libssl, but our bundled copy is not built in OpenSSL ports. Pull that
232 # file in directly.
233 sources += [ "third_party/nss/ssl/cmpcert.c" ]
234 }
235
svaldez2135be52016-04-20 16:34:53236 if (!use_nss_certs) {
kapishnikovabe280e2016-04-14 19:07:16237 # These files are part of the partial implementation of NSS for
238 # cert verification, so keep them in that case.
239 sources -= [
240 "cert/cert_verify_proc_nss.cc",
241 "cert/cert_verify_proc_nss.h",
242 "cert/test_root_certs_nss.cc",
svaldez2135be52016-04-20 16:34:53243 "cert/x509_util_nss.cc",
kapishnikovabe280e2016-04-14 19:07:16244 "cert_net/nss_ocsp.cc",
245 "cert_net/nss_ocsp.h",
246 ]
247 }
248
kapishnikovabe280e2016-04-14 19:07:16249 if (is_chromecast && use_nss_certs) {
250 sources += [ "ssl/ssl_platform_key_chromecast.cc" ]
251 sources -= [ "ssl/ssl_platform_key_nss.cc" ]
252 }
253
254 if (!enable_mdns) {
255 sources -= [
256 "dns/mdns_cache.cc",
257 "dns/mdns_cache.h",
258 "dns/mdns_client.cc",
259 "dns/mdns_client.h",
260 "dns/mdns_client_impl.cc",
261 "dns/mdns_client_impl.h",
262 "dns/record_parsed.cc",
263 "dns/record_parsed.h",
264 "dns/record_rdata.cc",
265 "dns/record_rdata.h",
266 ]
267 }
268
269 if (is_win) {
270 sources -= [ "http/http_auth_handler_ntlm_portable.cc" ]
271 } else { # !is_win
272 sources -= [
273 "base/winsock_init.cc",
274 "base/winsock_init.h",
275 "base/winsock_util.cc",
276 "base/winsock_util.h",
277 "proxy/proxy_resolver_winhttp.cc",
278 "proxy/proxy_resolver_winhttp.h",
279 ]
280 }
281
282 if (is_ios) {
283 # Add back some sources that were otherwise filtered out.
284 # iOS needs some Mac files.
285 net_unfiltered_sources += [
286 "base/mac/url_conversions.h",
287 "base/mac/url_conversions.mm",
288 "base/network_change_notifier_mac.cc",
289 "base/network_config_watcher_mac.cc",
290 "base/network_interfaces_mac.cc",
291 "base/network_interfaces_mac.h",
292 "base/platform_mime_util_mac.mm",
svaldez2135be52016-04-20 16:34:53293 "cert/test_root_certs_mac.cc",
kapishnikovabe280e2016-04-14 19:07:16294 "proxy/proxy_resolver_mac.cc",
295 "proxy/proxy_server_mac.cc",
296 ]
297
298 sources -= [ "disk_cache/blockfile/file_posix.cc" ]
299 }
300
kapishnikovabe280e2016-04-14 19:07:16301 if (is_ios || is_mac) {
302 sources += gypi_values.net_base_mac_ios_sources
303 }
304
305 if (is_android) {
306 deps += [ ":net_jni_headers" ]
307
308 # Add some Linux sources that were excluded by the filter, but which
309 # are needed.
310 net_unfiltered_sources += [
311 "base/address_tracker_linux.cc",
312 "base/address_tracker_linux.h",
313 "base/network_interfaces_linux.cc",
314 "base/network_interfaces_linux.h",
315 "base/platform_mime_util_linux.cc",
316 ]
317 }
318 } else {
319 public_deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
320 }
xunjieli905496a2015-08-31 15:51:17321
322 # Add back some sources that were otherwise filtered out.
323 set_sources_assignment_filter([])
kapishnikovabe280e2016-04-14 19:07:16324 sources += net_unfiltered_sources
xunjieli905496a2015-08-31 15:51:17325 set_sources_assignment_filter(sources_assignment_filter)
326
327 cflags = []
kapishnikovabe280e2016-04-14 19:07:16328 configs += net_configs
xunjieli905496a2015-08-31 15:51:17329 public_configs = [ ":net_config" ]
330
kapishnikovabe280e2016-04-14 19:07:16331 public_deps += [ "//url" ]
[email protected]4625ade2014-04-15 19:26:44332
333 if (is_mac) {
[email protected]4625ade2014-04-15 19:26:44334 libs = [
rsesek02aa51c2016-05-11 02:13:57335 "CFNetwork.framework",
336 "CoreServices.framework",
[email protected]ab9ce6e2014-04-17 20:33:19337 "Foundation.framework",
338 "Security.framework",
339 "SystemConfiguration.framework",
340 "resolv",
[email protected]4625ade2014-04-15 19:26:44341 ]
342 }
343
344 if (is_ios) {
[email protected]4625ade2014-04-15 19:26:44345 libs = [
[email protected]ab9ce6e2014-04-17 20:33:19346 "CFNetwork.framework",
347 "MobileCoreServices.framework",
348 "Security.framework",
349 "SystemConfiguration.framework",
350 "resolv",
[email protected]4625ade2014-04-15 19:26:44351 ]
xunjieli06d93982015-08-27 17:13:02352 }
xunjieli4c8c6922015-08-27 16:02:40353
jam5332a632016-04-01 22:36:05354 if (is_win) {
355 libs = [
356 "crypt32.lib",
357 "dhcpcsvc.lib",
358 "iphlpapi.lib",
359 "rpcrt4.lib",
360 "secur32.lib",
361 "urlmon.lib",
362 "winhttp.lib",
363 ]
364 }
365
sergeyu99d83f92015-09-14 23:03:33366 if (!is_nacl) {
367 if (!disable_file_support) {
368 sources += gypi_values.net_file_support_sources
369 }
xunjieli06d93982015-08-27 17:13:02370
sergeyu99d83f92015-09-14 23:03:33371 if (!disable_ftp_support) {
372 sources += gypi_values.net_ftp_support_sources
373 }
xunjieli905496a2015-08-31 15:51:17374
sergeyu99d83f92015-09-14 23:03:33375 if (enable_websockets) {
376 sources += gypi_values.net_websockets_sources
377 }
xunjieli905496a2015-08-31 15:51:17378
sergeyu99d83f92015-09-14 23:03:33379 # ICU support.
kapishnikovabe280e2016-04-14 19:07:16380 if (use_platform_icu_alternatives) {
381 if (is_android) {
382 # Use ICU alternative on Android.
383 sources += [
384 "base/net_string_util_icu_alternatives_android.cc",
385 "base/net_string_util_icu_alternatives_android.h",
386 ]
387 deps += [ ":net_jni_headers" ]
388 } else if (is_ios) {
389 # Use ICU alternative on iOS.
390 sources += [ "base/net_string_util_icu_alternatives_ios.mm" ]
391 } else {
392 assert(false,
393 "ICU alternative is not implemented for platform: " + target_os)
394 }
395 } else {
396 # Use ICU.
397 deps += [
398 "//base:i18n",
399 "//third_party/icu",
400 ]
401 sources += [
402 "base/filename_util_icu.cc",
403 "base/net_string_util_icu.cc",
404 ]
405 }
eustasfbec9132015-12-30 14:56:51406
407 # Brotli support.
kapishnikovabe280e2016-04-14 19:07:16408 if (!disable_brotli_filter) {
409 sources += [ "filter/brotli_filter.cc" ]
410 deps += [ "//third_party/brotli" ]
411 } else {
412 sources += [ "filter/brotli_filter_disabled.cc" ]
413 }
[email protected]85191ed2014-05-15 00:41:49414 }
[email protected]4625ade2014-04-15 19:26:44415}
416
417grit("net_resources") {
418 source = "base/net_resources.grd"
[email protected]7ae52902014-08-18 22:36:01419 use_qualified_include = true
[email protected]b89c53842014-07-23 16:32:32420 outputs = [
421 "grit/net_resources.h",
422 "net_resources.pak",
[email protected]b89c53842014-07-23 16:32:32423 ]
[email protected]4625ade2014-04-15 19:26:44424}
425
rtennetib6f1c0d2015-04-03 17:52:06426proto_library("net_quic_proto") {
kapishnikovabe280e2016-04-14 19:07:16427 visibility = [ ":net" ]
brettw2e7db0a2015-04-24 22:59:17428
rtennetib6f1c0d2015-04-03 17:52:06429 sources = [
430 "quic/proto/cached_network_parameters.proto",
431 "quic/proto/source_address_token.proto",
432 ]
433 cc_generator_options = "dllexport_decl=NET_EXPORT_PRIVATE:"
434 cc_include = "net/base/net_export.h"
435
436 defines = [ "NET_IMPLEMENTATION" ]
437
438 extra_configs = [ "//build/config/compiler:wexit_time_destructors" ]
439}
440
Brett Wilson83fd4242014-09-02 19:45:33441static_library("extras") {
mef327a8e42014-08-29 17:10:03442 sources = gypi_values.net_extras_sources
443 configs += [ "//build/config/compiler:wexit_time_destructors" ]
444 deps = [
445 ":net",
brettwbc44c0a92015-02-20 22:30:39446 "//base",
mef327a8e42014-08-29 17:10:03447 "//sql:sql",
448 ]
449}
450
[email protected]8a3f8242014-06-05 18:05:12451static_library("http_server") {
[email protected]4625ade2014-04-15 19:26:44452 sources = [
453 "server/http_connection.cc",
454 "server/http_connection.h",
455 "server/http_server.cc",
456 "server/http_server.h",
457 "server/http_server_request_info.cc",
458 "server/http_server_request_info.h",
459 "server/http_server_response_info.cc",
460 "server/http_server_response_info.h",
461 "server/web_socket.cc",
462 "server/web_socket.h",
dgozmana6e70092014-12-12 14:46:21463 "server/web_socket_encoder.cc",
464 "server/web_socket_encoder.h",
[email protected]4625ade2014-04-15 19:26:44465 ]
jambc6cc8e2014-11-14 17:56:29466 configs += [
brettwd1c719a2015-02-19 23:17:04467 "//build/config/compiler:no_size_t_to_int_warning",
jambc6cc8e2014-11-14 17:56:29468 "//build/config/compiler:wexit_time_destructors",
jambc6cc8e2014-11-14 17:56:29469 ]
[email protected]4625ade2014-04-15 19:26:44470 deps = [
471 ":net",
472 "//base",
473 ]
474}
475
sdefresne3001f172016-03-16 10:30:03476if (!is_ios) {
477 executable("dump_cache") {
478 testonly = true
479 sources = [
480 "tools/dump_cache/dump_cache.cc",
481 "tools/dump_cache/dump_files.cc",
482 "tools/dump_cache/dump_files.h",
483 ]
[email protected]4625ade2014-04-15 19:26:44484
sdefresne3001f172016-03-16 10:30:03485 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
486 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31487
sdefresne3001f172016-03-16 10:30:03488 deps = [
489 ":net",
490 ":test_support",
491 "//base",
492 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:07493 "//build/win:default_exe_manifest",
sdefresne3001f172016-03-16 10:30:03494 ]
495 }
[email protected]8603c5de2014-04-16 20:34:31496}
497
sdefresneb0a31642016-03-18 11:04:45498bundle_data("test_support_bundle_data") {
sdefresne04f91142016-04-21 08:41:59499 visibility = [ ":test_support" ]
sdefresneb0a31642016-03-18 11:04:45500 testonly = true
sdefresne04f91142016-04-21 08:41:59501 sources = gypi_values.net_test_support_data_sources
sdefresneb0a31642016-03-18 11:04:45502 outputs = [
503 "{{bundle_resources_dir}}/" +
504 "{{source_root_relative_dir}}/{{source_file_part}}",
505 ]
506}
507
[email protected]b2b2bf52014-05-28 20:26:57508source_set("test_support") {
Brett Wilson8f80ad0b2014-09-08 19:50:24509 testonly = true
[email protected]8603c5de2014-04-16 20:34:31510 sources = [
[email protected]8603c5de2014-04-16 20:34:31511 "base/load_timing_info_test_util.cc",
512 "base/load_timing_info_test_util.h",
513 "base/mock_file_stream.cc",
514 "base/mock_file_stream.h",
515 "base/test_completion_callback.cc",
516 "base/test_completion_callback.h",
517 "base/test_data_directory.cc",
518 "base/test_data_directory.h",
519 "cert/mock_cert_verifier.cc",
520 "cert/mock_cert_verifier.h",
ryanchung987b2ff2016-02-19 00:17:12521 "cert/mock_client_cert_verifier.cc",
522 "cert/mock_client_cert_verifier.h",
[email protected]8603c5de2014-04-16 20:34:31523 "cookies/cookie_monster_store_test.cc",
524 "cookies/cookie_monster_store_test.h",
525 "cookies/cookie_store_test_callbacks.cc",
526 "cookies/cookie_store_test_callbacks.h",
527 "cookies/cookie_store_test_helpers.cc",
528 "cookies/cookie_store_test_helpers.h",
drogerfd8b2772015-12-04 14:34:56529 "cookies/cookie_store_unittest.h",
[email protected]8603c5de2014-04-16 20:34:31530 "disk_cache/disk_cache_test_base.cc",
531 "disk_cache/disk_cache_test_base.h",
532 "disk_cache/disk_cache_test_util.cc",
533 "disk_cache/disk_cache_test_util.h",
534 "dns/dns_test_util.cc",
535 "dns/dns_test_util.h",
536 "dns/mock_host_resolver.cc",
537 "dns/mock_host_resolver.h",
538 "dns/mock_mdns_socket_factory.cc",
539 "dns/mock_mdns_socket_factory.h",
[email protected]8a3f8242014-06-05 18:05:12540 "http/http_transaction_test_util.cc",
541 "http/http_transaction_test_util.h",
vishal.b62985ca92015-04-17 08:45:51542 "log/test_net_log.cc",
543 "log/test_net_log.h",
mmenke43758e62015-05-04 21:09:46544 "log/test_net_log_entry.cc",
545 "log/test_net_log_entry.h",
mmenke0034c542015-05-05 22:34:59546 "log/test_net_log_util.cc",
mmenke43758e62015-05-04 21:09:46547 "log/test_net_log_util.h",
[email protected]8603c5de2014-04-16 20:34:31548 "proxy/mock_proxy_resolver.cc",
549 "proxy/mock_proxy_resolver.h",
550 "proxy/mock_proxy_script_fetcher.cc",
551 "proxy/mock_proxy_script_fetcher.h",
552 "proxy/proxy_config_service_common_unittest.cc",
553 "proxy/proxy_config_service_common_unittest.h",
554 "socket/socket_test_util.cc",
555 "socket/socket_test_util.h",
556 "test/cert_test_util.cc",
557 "test/cert_test_util.h",
[email protected]83e1ae32014-07-18 10:57:07558 "test/cert_test_util_nss.cc",
nharper2e171cf2015-06-01 20:29:23559 "test/channel_id_test_util.cc",
560 "test/channel_id_test_util.h",
[email protected]8603c5de2014-04-16 20:34:31561 "test/ct_test_util.cc",
562 "test/ct_test_util.h",
svaldez7d25c562015-10-30 19:09:45563 "test/embedded_test_server/default_handlers.cc",
564 "test/embedded_test_server/default_handlers.h",
[email protected]8603c5de2014-04-16 20:34:31565 "test/embedded_test_server/embedded_test_server.cc",
566 "test/embedded_test_server/embedded_test_server.h",
567 "test/embedded_test_server/http_connection.cc",
568 "test/embedded_test_server/http_connection.h",
569 "test/embedded_test_server/http_request.cc",
570 "test/embedded_test_server/http_request.h",
571 "test/embedded_test_server/http_response.cc",
572 "test/embedded_test_server/http_response.h",
svaldez6e7e82a22015-10-28 19:39:53573 "test/embedded_test_server/request_handler_util.cc",
574 "test/embedded_test_server/request_handler_util.h",
sammc6ac3fe52015-02-25 06:00:28575 "test/event_waiter.h",
johnme36ae5802016-05-10 15:46:24576 "test/gtest_util.h",
[email protected]8603c5de2014-04-16 20:34:31577 "test/net_test_suite.cc",
578 "test/net_test_suite.h",
579 "test/python_utils.cc",
580 "test/python_utils.h",
johnme36ae5802016-05-10 15:46:24581 "test/scoped_disable_exit_on_dfatal.cc",
582 "test/scoped_disable_exit_on_dfatal.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 ]
dsinclair8490e052016-05-04 15:33:33953 deps += [ "//build/linux/libgio" ]
[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
gabadie0774bee2016-05-12 14:02:581007if (is_linux || is_mac) {
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 }
gabadie0774bee2016-05-12 14:02:581034}
gabadie64af64a2016-03-29 16:36:421035
gabadie0774bee2016-05-12 14:02:581036if (is_linux) {
[email protected]8a3f8242014-06-05 18:05:121037 static_library("epoll_server") {
[email protected]8603c5de2014-04-16 20:34:311038 sources = [
1039 "tools/epoll_server/epoll_server.cc",
1040 "tools/epoll_server/epoll_server.h",
1041 ]
1042 deps = [
1043 ":net",
1044 "//base",
1045 ]
1046 }
1047
[email protected]8a3f8242014-06-05 18:05:121048 static_library("flip_in_mem_edsm_server_base") {
Brett Wilson8f80ad0b2014-09-08 19:50:241049 testonly = true
[email protected]8603c5de2014-04-16 20:34:311050 sources = [
[email protected]8603c5de2014-04-16 20:34:311051 "tools/flip_server/acceptor_thread.cc",
satorux933fc7a2015-02-13 07:09:101052 "tools/flip_server/acceptor_thread.h",
1053 "tools/flip_server/constants.h",
[email protected]8603c5de2014-04-16 20:34:311054 "tools/flip_server/flip_config.cc",
1055 "tools/flip_server/flip_config.h",
1056 "tools/flip_server/http_interface.cc",
1057 "tools/flip_server/http_interface.h",
[email protected]8603c5de2014-04-16 20:34:311058 "tools/flip_server/mem_cache.cc",
satorux933fc7a2015-02-13 07:09:101059 "tools/flip_server/mem_cache.h",
[email protected]8603c5de2014-04-16 20:34:311060 "tools/flip_server/output_ordering.cc",
1061 "tools/flip_server/output_ordering.h",
1062 "tools/flip_server/ring_buffer.cc",
1063 "tools/flip_server/ring_buffer.h",
1064 "tools/flip_server/sm_connection.cc",
1065 "tools/flip_server/sm_connection.h",
1066 "tools/flip_server/sm_interface.h",
[email protected]8603c5de2014-04-16 20:34:311067 "tools/flip_server/spdy_interface.cc",
1068 "tools/flip_server/spdy_interface.h",
satorux933fc7a2015-02-13 07:09:101069 "tools/flip_server/spdy_ssl.cc",
1070 "tools/flip_server/spdy_ssl.h",
[email protected]8603c5de2014-04-16 20:34:311071 "tools/flip_server/spdy_util.cc",
1072 "tools/flip_server/spdy_util.h",
1073 "tools/flip_server/streamer_interface.cc",
1074 "tools/flip_server/streamer_interface.h",
tfarinafb3c78c2016-02-09 22:13:521075 "tools/flip_server/tcp_socket_util.cc",
1076 "tools/flip_server/tcp_socket_util.h",
rvargas145310f2015-08-14 18:09:041077 "tools/flip_server/url_to_filename_encoder.cc",
1078 "tools/flip_server/url_to_filename_encoder.h",
1079 "tools/flip_server/url_utilities.cc",
1080 "tools/flip_server/url_utilities.h",
[email protected]8603c5de2014-04-16 20:34:311081 ]
1082 deps = [
1083 ":balsa",
1084 ":epoll_server",
1085 ":net",
1086 "//base",
[email protected]edfd0f42014-07-22 18:20:371087 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311088 ]
1089 }
1090
1091 executable("flip_in_mem_edsm_server_unittests") {
Brett Wilson8f80ad0b2014-09-08 19:50:241092 testonly = true
[email protected]8603c5de2014-04-16 20:34:311093 sources = [
1094 "tools/flip_server/flip_test_utils.cc",
1095 "tools/flip_server/flip_test_utils.h",
1096 "tools/flip_server/http_interface_test.cc",
1097 "tools/flip_server/mem_cache_test.cc",
1098 "tools/flip_server/run_all_tests.cc",
1099 "tools/flip_server/spdy_interface_test.cc",
rvargas145310f2015-08-14 18:09:041100 "tools/flip_server/url_to_filename_encoder_unittest.cc",
1101 "tools/flip_server/url_utilities_unittest.cc",
[email protected]8603c5de2014-04-16 20:34:311102 ]
1103 deps = [
brettwbc44c0a92015-02-20 22:30:391104 ":balsa",
[email protected]8603c5de2014-04-16 20:34:311105 ":flip_in_mem_edsm_server_base",
1106 ":net",
[email protected]b2b2bf52014-05-28 20:26:571107 ":test_support",
brettwba7a73d2015-08-31 22:17:391108 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:311109 "//testing/gmock",
agrieved7a71c882015-11-20 19:53:281110 "//testing/gtest",
[email protected]edfd0f42014-07-22 18:20:371111 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311112 ]
1113 }
1114
1115 executable("flip_in_mem_edsm_server") {
Brett Wilson8f80ad0b2014-09-08 19:50:241116 testonly = true
scottmg34fb7e52014-12-03 23:27:241117 sources = [
1118 "tools/flip_server/flip_in_mem_edsm_server.cc",
1119 ]
[email protected]8603c5de2014-04-16 20:34:311120 deps = [
brettwbc44c0a92015-02-20 22:30:391121 ":balsa",
[email protected]8603c5de2014-04-16 20:34:311122 ":flip_in_mem_edsm_server_base",
1123 ":net",
1124 "//base",
brettwba7a73d2015-08-31 22:17:391125 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:311126 ]
1127 }
1128
rch216445c2015-03-27 00:23:281129 source_set("epoll_quic_tools") {
[email protected]8603c5de2014-04-16 20:34:311130 sources = [
1131 "tools/quic/quic_client.cc",
1132 "tools/quic/quic_client.h",
[email protected]8603c5de2014-04-16 20:34:311133 "tools/quic/quic_default_packet_writer.cc",
1134 "tools/quic/quic_default_packet_writer.h",
rch16c74d1d2016-04-22 06:14:071135 "tools/quic/quic_epoll_alarm_factory.cc",
1136 "tools/quic/quic_epoll_alarm_factory.h",
[email protected]8603c5de2014-04-16 20:34:311137 "tools/quic/quic_epoll_clock.cc",
1138 "tools/quic/quic_epoll_clock.h",
1139 "tools/quic/quic_epoll_connection_helper.cc",
1140 "tools/quic/quic_epoll_connection_helper.h",
rtennetifb3fa6c2015-03-16 23:04:551141 "tools/quic/quic_packet_reader.cc",
1142 "tools/quic/quic_packet_reader.h",
[email protected]8603c5de2014-04-16 20:34:311143 "tools/quic/quic_packet_writer_wrapper.cc",
1144 "tools/quic/quic_packet_writer_wrapper.h",
1145 "tools/quic/quic_server.cc",
1146 "tools/quic/quic_server.h",
[email protected]8603c5de2014-04-16 20:34:311147 "tools/quic/quic_socket_utils.cc",
1148 "tools/quic/quic_socket_utils.h",
[email protected]8603c5de2014-04-16 20:34:311149 ]
1150 deps = [
1151 ":balsa",
1152 ":epoll_server",
1153 ":net",
tfarina8ac4d17f2015-12-16 02:11:111154 ":simple_quic_tools",
[email protected]8603c5de2014-04-16 20:34:311155 "//base",
1156 "//base/third_party/dynamic_annotations",
1157 "//crypto",
[email protected]edfd0f42014-07-22 18:20:371158 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311159 "//url",
1160 ]
1161 }
1162
rch216445c2015-03-27 00:23:281163 executable("epoll_quic_client") {
scottmg34fb7e52014-12-03 23:27:241164 sources = [
1165 "tools/quic/quic_client_bin.cc",
1166 ]
[email protected]8603c5de2014-04-16 20:34:311167 deps = [
brettwbc44c0a92015-02-20 22:30:391168 ":balsa",
rch216445c2015-03-27 00:23:281169 ":epoll_quic_tools",
agrieved7a71c882015-11-20 19:53:281170 ":epoll_server",
rch216445c2015-03-27 00:23:281171 ":net",
1172 ":simple_quic_tools",
1173 "//base",
brettwba7a73d2015-08-31 22:17:391174 "//build/config/sanitizers:deps",
rch216445c2015-03-27 00:23:281175 "//third_party/boringssl",
1176 ]
1177 }
1178
1179 executable("epoll_quic_server") {
1180 sources = [
1181 "tools/quic/quic_server_bin.cc",
1182 ]
1183 deps = [
1184 ":balsa",
rch216445c2015-03-27 00:23:281185 ":epoll_quic_tools",
agrieved7a71c882015-11-20 19:53:281186 ":epoll_server",
[email protected]8603c5de2014-04-16 20:34:311187 ":net",
rchda78df5a2015-03-22 05:16:371188 ":simple_quic_tools",
[email protected]8603c5de2014-04-16 20:34:311189 "//base",
brettwba7a73d2015-08-31 22:17:391190 "//build/config/sanitizers:deps",
[email protected]edfd0f42014-07-22 18:20:371191 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311192 ]
1193 }
[email protected]8603c5de2014-04-16 20:34:311194}
1195
[email protected]ef0eb442014-05-15 09:32:181196if (is_android) {
1197 generate_jni("net_jni_headers") {
1198 sources = [
1199 "android/java/src/org/chromium/net/AndroidCertVerifyResult.java",
1200 "android/java/src/org/chromium/net/AndroidKeyStore.java",
1201 "android/java/src/org/chromium/net/AndroidNetworkLibrary.java",
tbansal59a1ddc2015-09-14 17:35:011202 "android/java/src/org/chromium/net/AndroidTrafficStats.java",
[email protected]ef0eb442014-05-15 09:32:181203 "android/java/src/org/chromium/net/GURLUtils.java",
aberentec894a52015-07-09 14:45:531204 "android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java",
xunjieli905496a2015-08-31 15:51:171205 "android/java/src/org/chromium/net/NetStringUtil.java",
[email protected]ef0eb442014-05-15 09:32:181206 "android/java/src/org/chromium/net/NetworkChangeNotifier.java",
1207 "android/java/src/org/chromium/net/ProxyChangeListener.java",
1208 "android/java/src/org/chromium/net/X509Util.java",
1209 ]
1210 jni_package = "net"
1211 }
cjhopmandad5f4272014-09-05 01:00:551212 generate_jni("net_test_jni_headers") {
1213 sources = [
1214 "android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java",
aberentec894a52015-07-09 14:45:531215 "test/android/javatests/src/org/chromium/net/test/DummySpnegoAuthenticator.java",
jbudorickccffb982015-12-22 01:21:351216 "test/android/javatests/src/org/chromium/net/test/EmbeddedTestServerImpl.java",
cjhopmandad5f4272014-09-05 01:00:551217 ]
brettwcdccaf02015-07-27 16:27:091218 jni_package = "net/test"
cjhopmandad5f4272014-09-05 01:00:551219 }
[email protected]ef0eb442014-05-15 09:32:181220}
[email protected]8603c5de2014-04-16 20:34:311221
1222if (is_android || is_linux) {
1223 executable("disk_cache_memory_test") {
Brett Wilson8f80ad0b2014-09-08 19:50:241224 testonly = true
scottmg34fb7e52014-12-03 23:27:241225 sources = [
1226 "tools/disk_cache_memory_test/disk_cache_memory_test.cc",
1227 ]
[email protected]8603c5de2014-04-16 20:34:311228 deps = [
1229 ":net",
1230 "//base",
brettwba7a73d2015-08-31 22:17:391231 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:311232 ]
1233 }
1234}
[email protected]8a3f8242014-06-05 18:05:121235
rch47ad01f2015-03-20 21:17:231236source_set("simple_quic_tools") {
rcha9d12ce12015-03-19 23:06:491237 sources = [
rtennetid67b3a722015-08-18 05:15:311238 "tools/quic/quic_client_base.cc",
1239 "tools/quic/quic_client_base.h",
rched113b22015-03-26 04:54:051240 "tools/quic/quic_client_session.cc",
1241 "tools/quic/quic_client_session.h",
rchc99f380c2015-03-26 19:50:561242 "tools/quic/quic_dispatcher.cc",
1243 "tools/quic/quic_dispatcher.h",
rch0e945472015-03-26 15:19:211244 "tools/quic/quic_in_memory_cache.cc",
1245 "tools/quic/quic_in_memory_cache.h",
rchc99f380c2015-03-26 19:50:561246 "tools/quic/quic_per_connection_packet_writer.cc",
1247 "tools/quic/quic_per_connection_packet_writer.h",
brettw25ca8922016-03-18 22:59:581248 "tools/quic/quic_process_packet_interface.h",
jokulikc971baf92016-01-06 00:36:391249 "tools/quic/quic_server_session_base.cc",
1250 "tools/quic/quic_server_session_base.h",
rcha9d12ce12015-03-19 23:06:491251 "tools/quic/quic_simple_client.cc",
1252 "tools/quic/quic_simple_client.h",
rch216445c2015-03-27 00:23:281253 "tools/quic/quic_simple_per_connection_packet_writer.cc",
1254 "tools/quic/quic_simple_per_connection_packet_writer.h",
1255 "tools/quic/quic_simple_server.cc",
1256 "tools/quic/quic_simple_server.h",
1257 "tools/quic/quic_simple_server_packet_writer.cc",
1258 "tools/quic/quic_simple_server_packet_writer.h",
jokulikc971baf92016-01-06 00:36:391259 "tools/quic/quic_simple_server_session.cc",
1260 "tools/quic/quic_simple_server_session.h",
danzhb7551342015-12-18 02:06:401261 "tools/quic/quic_simple_server_stream.cc",
1262 "tools/quic/quic_simple_server_stream.h",
rched113b22015-03-26 04:54:051263 "tools/quic/quic_spdy_client_stream.cc",
1264 "tools/quic/quic_spdy_client_stream.h",
rch0e945472015-03-26 15:19:211265 "tools/quic/quic_time_wait_list_manager.cc",
1266 "tools/quic/quic_time_wait_list_manager.h",
rchda78df5a2015-03-22 05:16:371267 "tools/quic/synchronous_host_resolver.cc",
1268 "tools/quic/synchronous_host_resolver.h",
rcha9d12ce12015-03-19 23:06:491269 ]
1270 deps = [
tfarina8ac4d17f2015-12-16 02:11:111271 ":balsa",
rcha9d12ce12015-03-19 23:06:491272 ":net",
1273 "//base",
rch47ad01f2015-03-20 21:17:231274 "//base/third_party/dynamic_annotations",
1275 "//url",
1276 ]
1277}
1278
ricea7afa5232015-12-01 20:55:231279action_foreach("stale_while_revalidate_experiment_domains_dafsa") {
1280 script = "//net/tools/dafsa/make_dafsa.py"
1281 sources = [
1282 "base/stale_while_revalidate_experiment_domains.gperf",
1283 ]
1284 outputs = [
1285 "${target_gen_dir}/base/{{source_name_part}}-inc.cc",
1286 ]
1287 args = [
1288 "{{source}}",
1289 rebase_path("${target_gen_dir}/base/{{source_name_part}}-inc.cc",
1290 root_build_dir),
1291 ]
1292}
1293
1294source_set("stale_while_revalidate_experiment_domains") {
1295 sources = [
1296 "base/stale_while_revalidate_experiment_domains.cc",
1297 "base/stale_while_revalidate_experiment_domains.h",
1298 ]
1299 deps = [
1300 ":net",
1301 ":stale_while_revalidate_experiment_domains_dafsa",
1302 "//base",
1303 ]
kapishnikovabe280e2016-04-14 19:07:161304 configs += net_configs
ricea7afa5232015-12-01 20:55:231305}
1306
sherouk51b4b098b2015-08-10 09:00:431307if (!is_ios) {
1308 executable("quic_client") {
1309 sources = [
1310 "tools/quic/quic_simple_client_bin.cc",
1311 ]
1312 deps = [
1313 ":net",
1314 ":simple_quic_tools",
1315 "//base",
brettwba7a73d2015-08-31 22:17:391316 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:071317 "//build/win:default_exe_manifest",
sherouk51b4b098b2015-08-10 09:00:431318 "//url",
1319 ]
1320 }
1321 executable("quic_server") {
1322 sources = [
1323 "tools/quic/quic_simple_server_bin.cc",
1324 ]
1325 deps = [
1326 ":net",
1327 ":simple_quic_tools",
1328 "//base",
brettwba7a73d2015-08-31 22:17:391329 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:071330 "//build/win:default_exe_manifest",
sherouk51b4b098b2015-08-10 09:00:431331 "//third_party/boringssl",
1332 "//third_party/protobuf:protobuf_lite",
1333 ]
1334 }
rchf80f62d12016-05-11 00:47:311335 executable("quic_packet_printer") {
1336 sources = [
1337 "tools/quic/quic_packet_printer_bin.cc",
1338 ]
1339 deps = [
1340 ":net",
1341 ":simple_quic_tools",
1342 "//base",
1343 "//build/config/sanitizers:deps",
1344 "//build/win:default_exe_manifest",
1345 "//third_party/boringssl",
1346 "//third_party/protobuf:protobuf_lite",
1347 ]
1348 }
rch216445c2015-03-27 00:23:281349}
1350
sdefresneb0a31642016-03-18 11:04:451351bundle_data("net_unittests_bundle_data") {
1352 testonly = true
sdefresne04f91142016-04-21 08:41:591353 sources = gypi_values.net_unittests_data_sources
sdefresneb0a31642016-03-18 11:04:451354 outputs = [
1355 "{{bundle_resources_dir}}/" +
1356 "{{source_root_relative_dir}}/{{source_file_part}}",
1357 ]
1358}
1359
dpranke64df2832015-07-31 22:33:361360test("net_unittests") {
1361 sources = gypi_values.net_test_sources
1362
1363 configs += [
1364 "//build/config:precompiled_headers",
1365
1366 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1367 "//build/config/compiler:no_size_t_to_int_warning",
1368 ]
1369 defines = []
1370
1371 deps = [
1372 ":balsa",
1373 ":extras",
dpranke64df2832015-07-31 22:33:361374 ":net",
sdefresneb0a31642016-03-18 11:04:451375 ":net_unittests_bundle_data",
dpranke64df2832015-07-31 22:33:361376 ":simple_quic_tools",
ricea7afa5232015-12-01 20:55:231377 ":stale_while_revalidate_experiment_domains",
dpranke64df2832015-07-31 22:33:361378 ":test_support",
1379 "//base",
1380 "//base:i18n",
dpranke64df2832015-07-31 22:33:361381 "//base/third_party/dynamic_annotations",
1382 "//crypto",
1383 "//crypto:platform",
1384 "//crypto:test_support",
dpranke64df2832015-07-31 22:33:361385 "//net/base/registry_controlled_domains",
1386 "//sql",
1387 "//testing/gmock",
1388 "//testing/gtest",
1389 "//third_party/zlib",
1390 "//url",
kapishnikovabe280e2016-04-14 19:07:161391 "//url:url_features",
dpranke64df2832015-07-31 22:33:361392 ]
1393
1394 data = [
1395 "data/",
1396 ]
svaldez2135be52016-04-20 16:34:531397 data_deps = [
1398 "third_party/nist-pkits/",
1399 ]
dpranke64df2832015-07-31 22:33:361400
1401 if (is_linux || is_mac || is_win) {
1402 deps += [
1403 "//third_party/pyftpdlib/",
1404 "//third_party/pywebsocket/",
1405 "//third_party/tlslite/",
1406 ]
mattm6586b432016-02-12 04:52:391407 data_deps += [
dpranke64df2832015-07-31 22:33:361408 "//third_party/pyftpdlib/",
1409 "//third_party/pywebsocket/",
1410 "//third_party/tlslite/",
1411 ]
1412 data += [
1413 "tools/testserver/",
1414 "//third_party/pyftpdlib/",
1415 "//third_party/pywebsocket/",
1416 "//third_party/tlslite/",
1417 "$root_out_dir/pyproto/google/",
dprankef497c7962015-07-31 19:46:231418 ]
1419 }
1420
dpranke64df2832015-07-31 22:33:361421 if (is_desktop_linux) {
1422 deps += [ ":epoll_quic_tools" ]
1423 }
1424 if (is_linux) {
1425 sources += gypi_values.net_linux_test_sources
1426 deps += [
1427 ":epoll_quic_tools",
1428 ":epoll_server",
1429 ":flip_in_mem_edsm_server_base",
brettwbc8b2a22015-07-28 18:24:421430 ]
dpranke64df2832015-07-31 22:33:361431 }
[email protected]8a3f8242014-06-05 18:05:121432
dpranke64df2832015-07-31 22:33:361433 if (is_mac || is_ios) {
1434 sources += gypi_values.net_base_test_mac_ios_sources
1435 }
1436
1437 if (is_chromeos) {
1438 sources -= [ "proxy/proxy_config_service_linux_unittest.cc" ]
1439 }
1440
1441 if (v8_use_external_startup_data) {
1442 deps += [ "//gin" ]
1443 }
1444
1445 if (!use_nss_certs) {
1446 sources -= [
1447 "cert/nss_cert_database_unittest.cc",
1448 "ssl/client_cert_store_nss_unittest.cc",
[email protected]8a3f8242014-06-05 18:05:121449 ]
dpranke64df2832015-07-31 22:33:361450 if (is_chromeos) { # Already removed for all non-ChromeOS builds.
davidben2bcbc6b2015-04-22 02:36:411451 sources -= [
dpranke64df2832015-07-31 22:33:361452 "cert/nss_cert_database_chromeos_unittest.cc",
1453 "cert/nss_profile_filter_chromeos_unittest.cc",
davidben2bcbc6b2015-04-22 02:36:411454 ]
brettw43ae0e12015-07-14 22:12:361455 }
[email protected]8a3f8242014-06-05 18:05:121456 }
dpranke64df2832015-07-31 22:33:361457
dpranke64df2832015-07-31 22:33:361458 if (use_kerberos) {
1459 defines += [ "USE_KERBEROS" ]
1460 }
1461
1462 # These are excluded on Android, because the actual Kerberos support, which
1463 # these test, is in a separate app on Android.
1464 if (!use_kerberos || is_android) {
1465 sources -= [
1466 "http/http_auth_gssapi_posix_unittest.cc",
1467 "http/mock_gssapi_library_posix.cc",
1468 "http/mock_gssapi_library_posix.h",
1469 ]
1470 }
1471 if (!use_kerberos) {
1472 sources -= [ "http/http_auth_handler_negotiate_unittest.cc" ]
1473 }
1474
svaldez2135be52016-04-20 16:34:531475 if (!use_nss_certs) {
svaldeza1714ab2016-03-18 20:47:531476 # Only include this test when using NSS for cert verification.
dpranke64df2832015-07-31 22:33:361477 sources -= [ "cert_net/nss_ocsp_unittest.cc" ]
1478 }
1479
1480 if (!use_openssl_certs) {
1481 sources -= [ "ssl/openssl_client_key_store_unittest.cc" ]
1482 }
1483
jbudorick1273a842016-04-01 19:50:051484 if (enable_websockets) {
1485 sources += gypi_values.net_websockets_test_sources
1486 deps += [ ":http_server" ]
dpranke64df2832015-07-31 22:33:361487 }
1488
1489 if (disable_file_support) {
1490 sources -= [
1491 "base/directory_lister_unittest.cc",
Thiago Farinad673bb122016-01-06 23:18:161492 "base/directory_listing_unittest.cc",
shahriar.rostamia8c06daf2016-02-12 00:07:041493 "url_request/url_request_file_dir_job_unittest.cc",
dpranke64df2832015-07-31 22:33:361494 "url_request/url_request_file_job_unittest.cc",
1495 ]
1496 }
1497
1498 if (disable_ftp_support) {
1499 sources -= [
1500 "ftp/ftp_auth_cache_unittest.cc",
1501 "ftp/ftp_ctrl_response_buffer_unittest.cc",
1502 "ftp/ftp_directory_listing_parser_ls_unittest.cc",
dpranke64df2832015-07-31 22:33:361503 "ftp/ftp_directory_listing_parser_unittest.cc",
1504 "ftp/ftp_directory_listing_parser_unittest.h",
1505 "ftp/ftp_directory_listing_parser_vms_unittest.cc",
1506 "ftp/ftp_directory_listing_parser_windows_unittest.cc",
1507 "ftp/ftp_network_transaction_unittest.cc",
1508 "ftp/ftp_util_unittest.cc",
1509 "url_request/url_request_ftp_job_unittest.cc",
1510 ]
1511 }
1512
1513 if (!enable_built_in_dns) {
1514 sources -= [
1515 "dns/address_sorter_posix_unittest.cc",
1516 "dns/address_sorter_unittest.cc",
1517 ]
1518 }
1519
xunjieli905496a2015-08-31 15:51:171520 if (use_v8_in_net) {
dpranke64df2832015-07-31 22:33:361521 deps += [ ":net_with_v8" ]
1522 } else {
1523 sources -= [
1524 "proxy/proxy_resolver_v8_tracing_unittest.cc",
1525 "proxy/proxy_resolver_v8_tracing_wrapper_unittest.cc",
1526 "proxy/proxy_resolver_v8_unittest.cc",
1527 ]
1528 }
1529
1530 if (use_v8_in_net && !is_android) {
1531 deps += [
1532 ":net_browser_services",
1533 ":net_utility_services",
rockotc637caf9b2016-02-10 09:57:081534 "//mojo/edk/system",
dpranke64df2832015-07-31 22:33:361535 ]
1536 } else {
1537 sources -= [
1538 "dns/host_resolver_mojo_unittest.cc",
1539 "dns/mojo_host_resolver_impl_unittest.cc",
1540 "proxy/mojo_proxy_resolver_factory_impl_unittest.cc",
1541 "proxy/mojo_proxy_resolver_impl_unittest.cc",
1542 "proxy/mojo_proxy_resolver_v8_tracing_bindings_unittest.cc",
1543 "proxy/proxy_resolver_factory_mojo_unittest.cc",
1544 "proxy/proxy_service_mojo_unittest.cc",
1545 ]
1546 }
1547
1548 if (!enable_mdns) {
1549 sources -= [
1550 "dns/mdns_cache_unittest.cc",
1551 "dns/mdns_client_unittest.cc",
1552 "dns/record_parsed_unittest.cc",
1553 "dns/record_rdata_unittest.cc",
1554 ]
1555 }
1556
1557 if (is_ios) {
dpranke64df2832015-07-31 22:33:361558 sources -= [
1559 # TODO(droger): The following tests are disabled because the
1560 # implementation is missing or incomplete.
1561 # KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS.
1562 "base/keygen_handler_unittest.cc",
1563 "disk_cache/backend_unittest.cc",
1564 "disk_cache/blockfile/block_files_unittest.cc",
1565
1566 # Need to read input data files.
1567 "filter/gzip_filter_unittest.cc",
1568 "socket/ssl_server_socket_unittest.cc",
1569 "spdy/fuzzing/hpack_fuzz_util_test.cc",
1570
1571 # Need TestServer.
1572 "cert_net/cert_net_fetcher_impl_unittest.cc",
1573 "proxy/proxy_script_fetcher_impl_unittest.cc",
1574 "socket/ssl_client_socket_unittest.cc",
1575 "url_request/url_fetcher_impl_unittest.cc",
1576 "url_request/url_request_context_builder_unittest.cc",
1577
1578 # Needs GetAppOutput().
1579 "test/python_utils_unittest.cc",
1580
1581 # The following tests are disabled because they don't apply to
1582 # iOS.
1583 # OS is not "linux" or "freebsd" or "openbsd".
1584 "socket/unix_domain_client_socket_posix_unittest.cc",
1585 "socket/unix_domain_server_socket_posix_unittest.cc",
dpranke64df2832015-07-31 22:33:361586 ]
1587 }
1588
kapishnikovabe280e2016-04-14 19:07:161589 # Unit tests that aren't supported by the current ICU alternatives on Android.
1590 if (is_android && use_platform_icu_alternatives) {
1591 sources -= [
1592 "base/filename_util_unittest.cc",
1593 "base/url_util_unittest.cc",
1594 "cert/x509_certificate_unittest.cc",
1595 "proxy/proxy_resolver_v8_unittest.cc",
1596 "url_request/url_request_job_unittest.cc",
1597 ]
1598 }
1599
1600 # Unit tests that are not supported by the current ICU alternatives on iOS.
1601 if (is_ios && use_platform_icu_alternatives) {
1602 sources -= [
1603 "base/filename_util_unittest.cc",
1604 "base/url_util_unittest.cc",
1605 "cert/x509_certificate_unittest.cc",
1606 "http/http_auth_handler_basic_unittest.cc",
1607 "http/http_auth_handler_digest_unittest.cc",
1608 "http/http_auth_handler_factory_unittest.cc",
1609 "http/http_auth_unittest.cc",
1610 "http/http_content_disposition_unittest.cc",
1611 "http/http_network_transaction_unittest.cc",
1612 "http/http_proxy_client_socket_pool_unittest.cc",
1613 "socket/ssl_client_socket_pool_unittest.cc",
1614 "spdy/spdy_network_transaction_unittest.cc",
1615 "spdy/spdy_proxy_client_socket_unittest.cc",
1616 "url_request/url_request_job_unittest.cc",
1617 "url_request/url_request_unittest.cc",
1618 ]
1619 }
1620
1621 # Exclude brotli test if the support for brotli is disabled.
1622 # Also, exclude the test from iOS for now (needs to read input data files).
1623 if (disable_brotli_filter || is_ios) {
1624 sources -= [ "filter/brotli_filter_unittest.cc" ]
1625 }
1626
dpranke64df2832015-07-31 22:33:361627 if (is_android) {
agrieve732db3a2016-04-26 19:18:191628 data_deps += [ "//net/tools/testserver:testserver_py" ]
agrieve97176362015-12-01 16:36:191629 deps += [
1630 ":net_test_jni_headers",
agrievea5517aa2015-10-23 03:03:451631 "//base:base_java_unittest_support",
1632 "//net/android:net_java",
agrievea5517aa2015-10-23 03:03:451633 "//net/android:net_java_test_support",
agrieve97176362015-12-01 16:36:191634 "//net/android:net_javatests",
agrievea5517aa2015-10-23 03:03:451635 "//net/android:net_unittests_apk_resources",
agrieve97176362015-12-01 16:36:191636
1637 # TODO(mmenke): This depends on test_support_base, which depends on
1638 # icu. Figure out a way to remove that dependency.
1639 "//testing/android/native_test:native_test_native_code",
pkotwicz8c7027d2015-11-11 06:30:071640 "//v8:v8_external_startup_data_assets",
agrievea5517aa2015-10-23 03:03:451641 ]
1642 android_manifest = "//net/android/unittest_support/AndroidManifest.xml"
dpranke64df2832015-07-31 22:33:361643 set_sources_assignment_filter([])
1644 sources += [ "base/address_tracker_linux_unittest.cc" ]
1645 set_sources_assignment_filter(sources_assignment_filter)
agrieve3ac557f02016-04-12 15:52:001646 shard_timeout = 300
dpranke64df2832015-07-31 22:33:361647 }
1648
dpranke64df2832015-07-31 22:33:361649 # Symbols for crashes when running tests on swarming.
1650 if (symbol_level > 0) {
1651 if (is_win) {
1652 data += [ "$root_out_dir/net_unittests.exe.pdb" ]
1653 } else if (is_mac) {
dprankede2945b82016-04-15 22:14:131654 # TODO(crbug.com/330301): make this conditional on mac_strip_release.
1655 # data += [ "$root_out_dir/net_unittests.dSYM/" ]
dpranke64df2832015-07-31 22:33:361656 }
1657 }
1658}
1659
1660# !is_android && !is_win && !is_mac
sdefresne3001f172016-03-16 10:30:031661if (!is_ios) {
1662 # TODO(crbug.com/594965): this should be converted to "app" template and
1663 # enabled on iOS too.
1664 executable("net_perftests") {
1665 testonly = true
1666 sources = [
1667 "base/mime_sniffer_perftest.cc",
1668 "cookies/cookie_monster_perftest.cc",
gavinpc28fe1122016-05-13 17:49:051669 "disk_cache/disk_cache_perftest.cc",
sdefresne3001f172016-03-16 10:30:031670 "extras/sqlite/sqlite_persistent_cookie_store_perftest.cc",
1671 "proxy/proxy_resolver_perftest.cc",
1672 "udp/udp_socket_perftest.cc",
1673 ]
[email protected]8a3f8242014-06-05 18:05:121674
sdefresne3001f172016-03-16 10:30:031675 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1676 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1677 deps = [
1678 ":extras",
1679 ":net",
1680 ":test_support",
1681 "//base",
1682 "//base:i18n",
1683 "//base/test:test_support_perf",
1684 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:071685 "//build/win:default_exe_manifest",
sdefresne3001f172016-03-16 10:30:031686 "//testing/gtest",
1687 "//url",
1688 ]
rockot9c67e5f2015-03-12 20:01:211689
sdefresne3001f172016-03-16 10:30:031690 if (enable_websockets) {
1691 sources += [ "websockets/websocket_frame_perftest.cc" ]
1692 }
rockot9c67e5f2015-03-12 20:01:211693
sdefresne3001f172016-03-16 10:30:031694 if (use_v8_in_net) {
1695 deps += [ ":net_with_v8" ]
1696 } else {
1697 sources -= [ "proxy/proxy_resolver_perftest.cc" ]
1698 }
rockot9c67e5f2015-03-12 20:01:211699 }
rockot9c67e5f2015-03-12 20:01:211700}
mefff34b822016-01-11 15:28:081701
eromanfe8659e2016-03-02 23:47:021702# Fuzzers
1703
eroman02b4fe562016-03-04 12:15:161704source_set("net_fuzzer_test_support") {
1705 testonly = true
1706
1707 sources = [
mmenkec951d412016-04-28 19:05:221708 "base/fuzzed_data_provider.cc",
1709 "base/fuzzed_data_provider.h",
eroman02b4fe562016-03-04 12:15:161710 "base/fuzzer_test_support.cc",
mmenke99b57172016-04-14 20:44:331711 "socket/fuzzed_socket.cc",
1712 "socket/fuzzed_socket.h",
mmenkec951d412016-04-28 19:05:221713 "socket/fuzzed_socket_factory.cc",
1714 "socket/fuzzed_socket_factory.h",
eroman02b4fe562016-03-04 12:15:161715 ]
1716 deps = [
1717 "//base",
1718 "//base:i18n",
mmenke99b57172016-04-14 20:44:331719 "//net",
eroman02b4fe562016-03-04 12:15:161720 ]
1721}
1722
csharrisonaa314dc2016-04-29 20:15:371723fuzzer_test("net_data_job_fuzzer") {
1724 sources = [
1725 "url_request/url_request_data_job_fuzzer.cc",
1726 ]
1727 deps = [
1728 ":net_fuzzer_test_support",
1729 ":test_support",
1730 "//base",
1731 "//net",
1732 ]
1733}
1734
mmenke5552a6a2016-03-28 23:11:591735fuzzer_test("net_mime_sniffer_fuzzer") {
1736 sources = [
1737 "base/mime_sniffer_fuzzer.cc",
1738 ]
1739 deps = [
1740 ":net_fuzzer_test_support",
1741 "//base",
1742 "//net",
1743 ]
1744}
1745
mmoroz565e8df22016-03-04 18:17:201746fuzzer_test("net_parse_proxy_list_pac_fuzzer") {
eromane6264fd2016-03-02 22:46:301747 sources = [
1748 "proxy/parse_proxy_list_pac_fuzzer.cc",
1749 ]
1750 deps = [
eroman02b4fe562016-03-04 12:15:161751 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301752 "//net",
1753 ]
1754}
1755
mmoroz565e8df22016-03-04 18:17:201756fuzzer_test("net_parse_proxy_list_fuzzer") {
eromane6264fd2016-03-02 22:46:301757 sources = [
1758 "proxy/parse_proxy_list_fuzzer.cc",
1759 ]
1760 deps = [
eroman02b4fe562016-03-04 12:15:161761 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301762 "//net",
1763 ]
1764}
1765
mmoroz565e8df22016-03-04 18:17:201766fuzzer_test("net_parse_proxy_bypass_rules_fuzzer") {
eromane6264fd2016-03-02 22:46:301767 sources = [
1768 "proxy/parse_proxy_bypass_rules_fuzzer.cc",
1769 ]
1770 deps = [
eroman02b4fe562016-03-04 12:15:161771 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301772 "//net",
1773 ]
1774}
1775
mmoroz565e8df22016-03-04 18:17:201776fuzzer_test("net_parse_proxy_rules_fuzzer") {
eromane6264fd2016-03-02 22:46:301777 sources = [
1778 "proxy/parse_proxy_rules_fuzzer.cc",
1779 ]
1780 deps = [
eroman02b4fe562016-03-04 12:15:161781 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301782 "//net",
1783 ]
1784}
1785
mmoroz565e8df22016-03-04 18:17:201786fuzzer_test("net_parse_data_url_fuzzer") {
eromane6264fd2016-03-02 22:46:301787 sources = [
1788 "base/parse_data_url_fuzzer.cc",
1789 ]
1790 deps = [
eroman02b4fe562016-03-04 12:15:161791 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301792 "//base",
1793 "//net",
1794 ]
1795}
1796
mmoroz565e8df22016-03-04 18:17:201797fuzzer_test("net_parse_ip_pattern_fuzzer") {
eromane6264fd2016-03-02 22:46:301798 sources = [
1799 "base/parse_ip_pattern_fuzzer.cc",
1800 ]
1801 deps = [
eroman02b4fe562016-03-04 12:15:161802 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301803 "//net",
1804 ]
1805}
1806
mmoroz565e8df22016-03-04 18:17:201807fuzzer_test("net_get_domain_and_registry_fuzzer") {
eromane6264fd2016-03-02 22:46:301808 sources = [
1809 "base/registry_controlled_domains/get_domain_and_registry_fuzzer.cc",
1810 ]
1811 deps = [
eroman02b4fe562016-03-04 12:15:161812 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301813 "//base",
eromane6264fd2016-03-02 22:46:301814 "//net",
1815 ]
1816}
1817
mattmafe43b82016-04-28 20:40:541818fuzzer_test("net_cert_verify_name_match_fuzzer") {
1819 sources = [
1820 "cert/internal/verify_name_match_fuzzer.cc",
1821 ]
1822 deps = [
1823 ":net_fuzzer_test_support",
1824 "//base",
1825 "//net",
1826 ]
1827}
1828
mattm2c637da42016-04-28 02:55:591829fuzzer_test("net_cert_normalize_name_fuzzer") {
1830 sources = [
1831 "cert/internal/verify_name_match_normalizename_fuzzer.cc",
1832 ]
1833 deps = [
1834 "//base",
1835 "//net",
1836 ]
1837}
1838
mattmafe43b82016-04-28 20:40:541839fuzzer_test("net_cert_verify_name_in_subtree_fuzzer") {
1840 sources = [
1841 "cert/internal/verify_name_match_verifynameinsubtree_fuzzer.cc",
1842 ]
1843 deps = [
1844 ":net_fuzzer_test_support",
1845 "//base",
1846 "//net",
1847 ]
1848}
1849
nharper85d3b6f2016-04-28 20:58:191850fuzzer_test("net_cert_parse_certificate_fuzzer") {
1851 sources = [
1852 "cert/internal/parse_certificate_fuzzer.cc",
1853 ]
1854 deps = [
1855 "//base",
1856 "//net",
1857 ]
1858}
1859
mmoroz565e8df22016-03-04 18:17:201860fuzzer_test("net_parse_cookie_line_fuzzer") {
eromane6264fd2016-03-02 22:46:301861 sources = [
1862 "cookies/parse_cookie_line_fuzzer.cc",
1863 ]
1864 deps = [
eroman02b4fe562016-03-04 12:15:161865 ":net_fuzzer_test_support",
eromane6264fd2016-03-02 22:46:301866 "//net",
1867 ]
1868}
1869
mmoroz565e8df22016-03-04 18:17:201870fuzzer_test("net_dns_record_fuzzer") {
eromanfe8659e2016-03-02 23:47:021871 sources = [
1872 "dns/dns_record_fuzzer.cc",
1873 ]
1874 deps = [
eroman02b4fe562016-03-04 12:15:161875 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021876 "//base",
1877 "//net",
1878 ]
1879}
1880
zhongyi273af9f2016-04-28 18:46:341881fuzzer_test("net_dns_hosts_parse_fuzzer") {
1882 sources = [
1883 "dns/dns_hosts_parse_fuzzer.cc",
1884 ]
1885 deps = [
1886 ":net_fuzzer_test_support",
1887 "//base",
1888 "//net",
1889 ]
1890}
1891
mmenke44e8e9c2016-03-29 18:38:571892fuzzer_test("net_http_stream_parser_fuzzer") {
1893 sources = [
1894 "http/http_stream_parser_fuzzer.cc",
1895 ]
1896 deps = [
1897 ":net_fuzzer_test_support",
1898 ":test_support",
1899 "//base",
1900 "//net",
1901 ]
mmenkee15732f2016-04-18 18:47:491902 dict = "data/http/http.dict"
mmenke44e8e9c2016-03-29 18:38:571903}
1904
mmoroz565e8df22016-03-04 18:17:201905fuzzer_test("net_ftp_ctrl_response_fuzzer") {
eromanfe8659e2016-03-02 23:47:021906 sources = [
1907 "ftp/ftp_ctrl_response_fuzzer.cc",
1908 ]
1909 deps = [
eroman02b4fe562016-03-04 12:15:161910 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021911 "//base",
1912 "//net",
1913 ]
1914}
1915
mmoroz565e8df22016-03-04 18:17:201916fuzzer_test("net_ftp_directory_listing_fuzzer") {
eromanfe8659e2016-03-02 23:47:021917 sources = [
1918 "ftp/ftp_directory_listing_fuzzer.cc",
1919 ]
1920 deps = [
eroman02b4fe562016-03-04 12:15:161921 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021922 "//base",
eromanfe8659e2016-03-02 23:47:021923 "//net",
1924 ]
1925}
1926
mmoroz565e8df22016-03-04 18:17:201927fuzzer_test("net_unescape_url_component_fuzzer") {
eromanfe8659e2016-03-02 23:47:021928 sources = [
1929 "base/unescape_url_component_fuzzer.cc",
1930 ]
1931 deps = [
eroman02b4fe562016-03-04 12:15:161932 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021933 "//base",
1934 "//net",
1935 ]
mmoroz34eb0082016-03-11 14:32:011936 dict = "base/unescape_url_component_fuzzer.dict"
mmoroz062a4a62016-04-12 09:02:331937 libfuzzer_options = [ "max_len = 2048" ]
eromanfe8659e2016-03-02 23:47:021938}
1939
mmoroz565e8df22016-03-04 18:17:201940fuzzer_test("net_websocket_frame_parser_fuzzer") {
eromanfe8659e2016-03-02 23:47:021941 sources = [
1942 "websockets/websocket_frame_parser_fuzzer.cc",
1943 ]
1944 deps = [
eroman02b4fe562016-03-04 12:15:161945 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021946 "//net",
1947 ]
1948}
1949
mmoroz565e8df22016-03-04 18:17:201950fuzzer_test("net_http_chunked_decoder_fuzzer") {
eromanfe8659e2016-03-02 23:47:021951 sources = [
1952 "http/http_chunked_decoder_fuzzer.cc",
1953 ]
1954 deps = [
eroman02b4fe562016-03-04 12:15:161955 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021956 "//net",
1957 ]
mmoroz5fa27922016-03-22 19:42:191958 dict = "http/http_chunked_decoder_fuzzer.dict"
eromanfe8659e2016-03-02 23:47:021959}
1960
mmenke8e9314bc2016-04-15 21:45:021961fuzzer_test("net_http_proxy_client_socket_fuzzer") {
1962 sources = [
1963 "http/http_proxy_client_socket_fuzzer.cc",
1964 ]
1965 deps = [
1966 ":net_fuzzer_test_support",
1967 ":test_support",
1968 "//base",
1969 "//net",
1970 ]
mmenkee15732f2016-04-18 18:47:491971 dict = "data/http/http.dict"
mmenke8e9314bc2016-04-15 21:45:021972}
1973
mmoroz565e8df22016-03-04 18:17:201974fuzzer_test("net_quic_crypto_framer_parse_message_fuzzer") {
eromanfe8659e2016-03-02 23:47:021975 sources = [
1976 "quic/quic_crypto_framer_parse_message_fuzzer.cc",
1977 ]
1978 deps = [
eroman02b4fe562016-03-04 12:15:161979 ":net_fuzzer_test_support",
eromanfe8659e2016-03-02 23:47:021980 "//base",
1981 "//net",
1982 ]
1983}
mmenke99b57172016-04-14 20:44:331984
1985fuzzer_test("net_socks_client_socket_fuzzer") {
1986 sources = [
1987 "socket/socks_client_socket_fuzzer.cc",
1988 ]
1989 deps = [
1990 ":net_fuzzer_test_support",
1991 ":test_support",
1992 "//base",
1993 "//net",
1994 ]
1995}
1996
1997fuzzer_test("net_socks5_client_socket_fuzzer") {
1998 sources = [
1999 "socket/socks5_client_socket_fuzzer.cc",
2000 ]
2001 deps = [
2002 ":net_fuzzer_test_support",
2003 ":test_support",
2004 "//base",
2005 "//net",
2006 ]
2007}
mmenkec951d412016-04-28 19:05:222008
2009fuzzer_test("net_url_request_fuzzer") {
2010 sources = [
2011 "url_request/url_request_fuzzer.cc",
2012 ]
2013 deps = [
2014 ":net_fuzzer_test_support",
2015 ":test_support",
2016 "//base",
2017 "//net",
2018 ]
2019 dict = "data/http/http.dict"
2020}