Remove APIPermission::kFileSystemWriteDirectory
[chromium-blink-merge.git] / net / BUILD.gn
blob6892fb18871551572236b9bd87b2d357df473c50
1 # 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.
5 import("//build/config/crypto.gni")
6 import("//build/config/features.gni")
7 import("//build/config/ui.gni")
8 import("//build/module_args/v8.gni")
9 import("//testing/test.gni")
10 import("//third_party/icu/config.gni")
11 import("//third_party/protobuf/proto_library.gni")
13 # TODO(cjhopman): //build/config/android/rules.gni also imports grit_rule.gni.
14 # Currently, that file can't be imported multiple times.  Make this always
15 # imported when http://crbug.com/393704 is fixed.
16 if (!is_android) {
17   import("//tools/grit/grit_rule.gni")
20 if (is_android) {
21   import("//build/config/android/config.gni")
22   import("//build/config/android/rules.gni")
23 } else if (is_mac) {
24   import("//build/config/mac/mac_sdk.gni")
27 # The list of net files is kept in net.gypi. Read it.
28 gypi_values = exec_script("//build/gypi_to_gn.py",
29                           [ rebase_path("net.gypi") ],
30                           "scope",
31                           [ "net.gypi" ])
33 # Disable Kerberos on ChromeOS, Android and iOS, at least for now. It needs
34 # configuration (krb5.conf and so on).
35 use_kerberos = !is_chromeos && !is_android && !is_ios
37 # The way the cache uses mmap() is inefficient on some Android devices. If
38 # this flag is set, we hackily avoid using mmap() in the disk cache. We are
39 # pretty confident that mmap-ing the index would not hurt any existing x86
40 # android devices, but we cannot be so sure about the variety of ARM devices.
41 # So enable it for x86 only for now.
42 posix_avoid_mmap = is_android && current_cpu != "x86"
44 # WebSockets and socket stream code are used everywhere except iOS.
45 enable_websockets = !is_ios
46 use_v8_in_net = !is_ios
47 enable_built_in_dns = !is_ios
48 disable_ftp_support = is_ios
50 declare_args() {
51   # Disables support for file URLs.  File URL support requires use of icu.
52   disable_file_support = false
55 config("net_config") {
56   defines = []
57   if (posix_avoid_mmap) {
58     defines += [ "POSIX_AVOID_MMAP" ]
59   }
60   if (disable_file_support) {
61     defines += [ "DISABLE_FILE_SUPPORT" ]
62   }
65 # net_internal_config is shared with net and net_small.
66 config("net_internal_config") {
67   defines = [
68     # TODO(GYP) Note that the GYP file supports linux_link_kerberos (defaults to
69     # 0) which implies that we run pkg_config on kerberos and link to that
70     # rather than setting this define which will dynamically open it. That
71     # doesn't seem to be set in the regular builds, so we're skipping this
72     # capability here.
73     "DLOPEN_KERBEROS",
74     "NET_IMPLEMENTATION",
75   ]
77   if (use_kerberos) {
78     defines += [ "USE_KERBEROS" ]
79     if (is_android) {
80       include_dirs = [ "/usr/include/kerberosV" ]
81     }
82   }
84   if (enable_built_in_dns) {
85     defines += [ "ENABLE_BUILT_IN_DNS" ]
86   }
89 # net_shared_* are settings shared between net and net_small
90 net_shared_sources =
91     gypi_values.net_nacl_common_sources + gypi_values.net_non_nacl_sources
93 net_shared_unfiltered_sources = []
95 net_shared_configs = [
96   ":net_internal_config",
97   "//build/config:precompiled_headers",
99   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
100   "//build/config/compiler:no_size_t_to_int_warning",
103 net_shared_public_deps = [
104   ":net_quic_proto",
105   "//crypto",
106   "//crypto:platform",
109 net_shared_deps = [
110   ":net_resources",
111   "//base",
112   "//base:prefs",
113   "//base/third_party/dynamic_annotations",
114   "//net/base/registry_controlled_domains",
115   "//sdch",
116   "//third_party/protobuf:protobuf_lite",
117   "//third_party/zlib",
120 if (!use_kerberos) {
121   net_shared_sources -= [
122     "http/http_auth_gssapi_posix.cc",
123     "http/http_auth_gssapi_posix.h",
124     "http/http_auth_handler_negotiate.cc",
125     "http/http_auth_handler_negotiate.h",
126   ]
129 if (is_posix) {
130   if (posix_avoid_mmap) {
131     net_shared_sources -= [ "disk_cache/blockfile/mapped_file_posix.cc" ]
132   } else {
133     net_shared_sources -=
134         [ "disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc" ]
135   }
138 if (!enable_built_in_dns) {
139   net_shared_sources -= [
140     "dns/address_sorter_posix.cc",
141     "dns/address_sorter_posix.h",
142     "dns/dns_client.cc",
143   ]
146 if (use_openssl) {
147   net_shared_sources -= [
148     "base/nss_memio.c",
149     "base/nss_memio.h",
150     "cert/ct_log_verifier_nss.cc",
151     "cert/ct_objects_extractor_nss.cc",
152     "cert/jwk_serializer_nss.cc",
153     "cert/scoped_nss_types.h",
154     "cert/x509_util_nss.cc",
155     "quic/crypto/aead_base_decrypter_nss.cc",
156     "quic/crypto/aead_base_encrypter_nss.cc",
157     "quic/crypto/aes_128_gcm_12_decrypter_nss.cc",
158     "quic/crypto/aes_128_gcm_12_encrypter_nss.cc",
159     "quic/crypto/chacha20_poly1305_decrypter_nss.cc",
160     "quic/crypto/chacha20_poly1305_encrypter_nss.cc",
161     "quic/crypto/channel_id_nss.cc",
162     "quic/crypto/p256_key_exchange_nss.cc",
163     "socket/nss_ssl_util.cc",
164     "socket/nss_ssl_util.h",
165     "socket/ssl_client_socket_nss.cc",
166     "socket/ssl_client_socket_nss.h",
167     "socket/ssl_server_socket_nss.cc",
168     "socket/ssl_server_socket_nss.h",
169   ]
170   if (is_ios) {
171     # Always removed for !ios below.
172     net_shared_sources -= [
173       "cert/cert_verify_proc_nss.cc",
174       "cert/cert_verify_proc_nss.h",
175     ]
176   }
177   if (is_win) {
178     net_shared_sources -= [ "cert/sha256_legacy_support_nss_win.cc" ]
179   }
180   if (!use_nss_certs && !is_ios) {
181     net_shared_sources -= [ "cert/x509_util_nss.h" ]
182   }
183 } else {
184   net_shared_sources -= [
185     "cert/ct_log_verifier_openssl.cc",
186     "cert/ct_objects_extractor_openssl.cc",
187     "cert/jwk_serializer_openssl.cc",
188     "cert/x509_util_openssl.cc",
189     "cert/x509_util_openssl.h",
190     "quic/crypto/aead_base_decrypter_openssl.cc",
191     "quic/crypto/aead_base_encrypter_openssl.cc",
192     "quic/crypto/aes_128_gcm_12_decrypter_openssl.cc",
193     "quic/crypto/aes_128_gcm_12_encrypter_openssl.cc",
194     "quic/crypto/chacha20_poly1305_decrypter_openssl.cc",
195     "quic/crypto/chacha20_poly1305_encrypter_openssl.cc",
196     "quic/crypto/channel_id_openssl.cc",
197     "quic/crypto/p256_key_exchange_openssl.cc",
198     "quic/crypto/scoped_evp_aead_ctx.cc",
199     "quic/crypto/scoped_evp_aead_ctx.h",
200     "socket/ssl_client_socket_openssl.cc",
201     "socket/ssl_client_socket_openssl.h",
202     "socket/ssl_server_socket_openssl.cc",
203     "socket/ssl_server_socket_openssl.h",
204     "ssl/openssl_ssl_util.cc",
205     "ssl/openssl_ssl_util.h",
206     "ssl/ssl_client_session_cache_openssl.cc",
207     "ssl/ssl_client_session_cache_openssl.h",
208     "ssl/ssl_platform_key.h",
209     "ssl/threaded_ssl_private_key.cc",
210     "ssl/threaded_ssl_private_key.h",
211   ]
212   if (is_mac) {
213     net_shared_sources -= [ "ssl/ssl_platform_key_mac.cc" ]
214   }
215   if (is_win) {
216     net_shared_sources -= [
217       "cert/sha256_legacy_support_openssl_win.cc",
218       "ssl/ssl_platform_key_win.cc",
219     ]
220   }
221   if (use_nss_certs) {
222     net_shared_sources -= [
223       "ssl/client_key_store.cc",
224       "ssl/client_key_store.h",
225       "ssl/ssl_platform_key_nss.cc",
226     ]
227   }
230 if (!use_openssl_certs) {
231   net_shared_sources -= [
232     "base/crypto_module_openssl.cc",
233     "base/keygen_handler_openssl.cc",
234     "base/openssl_private_key_store.h",
235     "base/openssl_private_key_store_memory.cc",
236     "cert/cert_database_openssl.cc",
237     "cert/cert_verify_proc_openssl.cc",
238     "cert/cert_verify_proc_openssl.h",
239     "cert/test_root_certs_openssl.cc",
240     "cert/x509_certificate_openssl.cc",
241     "ssl/openssl_client_key_store.cc",
242     "ssl/openssl_client_key_store.h",
243   ]
244   if (is_android) {
245     net_shared_sources -= [ "base/openssl_private_key_store_android.cc" ]
246   }
247 } else {
248   if (is_android) {
249     # Android doesn't use these even when using OpenSSL.
250     net_shared_sources -= [
251       "base/openssl_private_key_store_memory.cc",
252       "cert/cert_database_openssl.cc",
253       "cert/cert_verify_proc_openssl.cc",
254       "cert/test_root_certs_openssl.cc",
255     ]
256   }
258   # TODO(davidben): Remove these exclusions when use_openssl_certs builds also
259   # use the SSLPrivateKey machinery.
260   net_shared_sources -= [
261     "ssl/threaded_ssl_private_key.cc",
262     "ssl/threaded_ssl_private_key.h",
263   ]
266 if (use_glib && !is_chromeos) {
267   net_shared_configs += [ "//build/config/linux:gconf" ]
268   net_shared_deps += [ "//build/config/linux:gio" ]
271 if (is_linux) {
272   net_shared_configs += [ "//build/config/linux:libresolv" ]
275 if (!use_nss_certs) {
276   net_shared_sources -= [
277     "base/crypto_module_nss.cc",
278     "base/keygen_handler_nss.cc",
279     "cert/cert_database_nss.cc",
280     "cert/nss_cert_database.cc",
281     "cert/nss_cert_database.h",
282     "cert/x509_certificate_nss.cc",
283     "ssl/client_cert_store_nss.cc",
284     "ssl/client_cert_store_nss.h",
285     "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
286     "third_party/mozilla_security_manager/nsKeygenHandler.h",
287     "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
288     "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
289     "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
290     "third_party/mozilla_security_manager/nsPKCS12Blob.h",
291   ]
292   if (!is_ios) {
293     # These files are part of the partial implementation of NSS on iOS so
294     # keep them in that case (even though use_nss_certs is not set).
295     net_shared_sources -= [
296       "cert/cert_verify_proc_nss.cc",
297       "cert/cert_verify_proc_nss.h",
298       "cert/test_root_certs_nss.cc",
299       "cert/x509_util_nss_certs.cc",
300       "cert_net/nss_ocsp.cc",
301       "cert_net/nss_ocsp.h",
302     ]
303   }
304   if (is_chromeos) {
305     # These were already removed on non-ChromeOS.
306     net_shared_sources -= [
307       "cert/nss_cert_database_chromeos.cc",
308       "cert/nss_cert_database_chromeos.h",
309       "cert/nss_profile_filter_chromeos.cc",
310       "cert/nss_profile_filter_chromeos.h",
311     ]
312   }
313   net_shared_sources -= [
314     "ssl/client_key_store.cc",
315     "ssl/client_key_store.h",
316     "ssl/ssl_platform_key_nss.cc",
317   ]
318 } else if (use_openssl) {
319   # client_cert_store_nss.c requires NSS_CmpCertChainWCANames from NSS's
320   # libssl, but our bundled copy is not built in OpenSSL ports. Pull that file
321   # in directly.
322   net_shared_sources += [ "third_party/nss/ssl/cmpcert.c" ]
325 if (!enable_mdns) {
326   net_shared_sources -= [
327     "dns/mdns_cache.cc",
328     "dns/mdns_cache.h",
329     "dns/mdns_client.cc",
330     "dns/mdns_client.h",
331     "dns/mdns_client_impl.cc",
332     "dns/mdns_client_impl.h",
333     "dns/record_parsed.cc",
334     "dns/record_parsed.h",
335     "dns/record_rdata.cc",
336     "dns/record_rdata.h",
337   ]
340 if (is_win) {
341   net_shared_sources -= [
342     "http/http_auth_handler_ntlm_portable.cc",
343     "socket/socket_libevent.cc",
344     "socket/socket_libevent.h",
345     "socket/tcp_socket_libevent.cc",
346     "socket/tcp_socket_libevent.h",
347     "udp/udp_socket_libevent.cc",
348     "udp/udp_socket_libevent.h",
349   ]
350 } else {  # !is_win
351   net_shared_sources -= [
352     "base/winsock_init.cc",
353     "base/winsock_init.h",
354     "base/winsock_util.cc",
355     "base/winsock_util.h",
356     "proxy/proxy_resolver_winhttp.cc",
357     "proxy/proxy_resolver_winhttp.h",
358   ]
361 if (is_ios) {
362   # Add back some sources that were otherwise filtered out. iOS needs some Mac
363   # files.
364   net_shared_unfiltered_sources += [
365     "base/mac/url_conversions.h",
366     "base/mac/url_conversions.mm",
367     "base/network_change_notifier_mac.cc",
368     "base/network_config_watcher_mac.cc",
369     "base/network_interfaces_mac.cc",
370     "base/network_interfaces_mac.h",
371     "base/platform_mime_util_mac.mm",
372     "proxy/proxy_resolver_mac.cc",
373     "proxy/proxy_server_mac.cc",
374   ]
376   net_shared_sources -= [ "disk_cache/blockfile/file_posix.cc" ]
377   net_shared_deps += [
378     "//third_party/nss:nspr",
379     "//third_party/nss",
380     "//net/third_party/nss/ssl:libssl",
381   ]
384 if (is_ios || is_mac) {
385   net_shared_sources += gypi_values.net_base_mac_ios_sources
388 if (is_android) {
389   net_shared_deps += [ ":net_jni_headers" ]
391   # Add some Linux sources that were excluded by the filter, but which
392   # are needed.
393   net_shared_unfiltered_sources += [
394     "base/address_tracker_linux.cc",
395     "base/address_tracker_linux.h",
396     "base/network_interfaces_linux.cc",
397     "base/network_interfaces_linux.h",
398     "base/platform_mime_util_linux.cc",
399   ]
402 component("net") {
403   sources = net_shared_sources
405   # Add back some sources that were otherwise filtered out.
406   set_sources_assignment_filter([])
407   sources += net_shared_unfiltered_sources
408   set_sources_assignment_filter(sources_assignment_filter)
410   cflags = []
411   configs += net_shared_configs
412   public_configs = [ ":net_config" ]
414   public_deps = net_shared_public_deps + [ "//url" ]
415   deps = net_shared_deps
417   if (is_mac) {
418     libs = [
419       "Foundation.framework",
420       "Security.framework",
421       "SystemConfiguration.framework",
422       "resolv",
423     ]
424   }
426   if (is_ios) {
427     libs = [
428       "CFNetwork.framework",
429       "MobileCoreServices.framework",
430       "Security.framework",
431       "SystemConfiguration.framework",
432       "resolv",
433     ]
434   }
436   if (!disable_file_support) {
437     sources += gypi_values.net_file_support_sources
438   }
440   if (!disable_ftp_support) {
441     sources += gypi_values.net_ftp_support_sources
442   }
444   if (enable_websockets) {
445     sources += gypi_values.net_websockets_sources
446   }
448   # ICU support.
449   deps += [
450     "//base:i18n",
451     "//third_party/icu",
452   ]
453   sources += [
454     "base/filename_util_icu.cc",
455     "base/net_string_util_icu.cc",
456     "base/net_util_icu.cc",
457   ]
460 if (is_android) {
461   # Same as net, but with ICU, file, ftp, and websocket support stripped.
462   component("net_small") {
463     sources = net_shared_sources
465     # Add back some sources that were otherwise filtered out.
466     set_sources_assignment_filter([])
467     sources += net_shared_unfiltered_sources
468     set_sources_assignment_filter(sources_assignment_filter)
470     cflags = []
471     defines = []
472     configs += net_shared_configs
473     public_configs = [ ":net_config" ]
475     public_deps = net_shared_public_deps +
476                   [ "//url:url_lib_use_icu_alternatives_on_android" ]
477     deps = net_shared_deps + [ ":net_jni_headers" ]
479     defines += [
480       "DISABLE_FILE_SUPPORT",
481       "DISABLE_FTP_SUPPORT",
482       "USE_ICU_ALTERNATIVES_ON_ANDROID=1",
483     ]
485     # Use ICU alternative on Android.
486     sources += [
487       "base/net_string_util_icu_alternatives_android.cc",
488       "base/net_string_util_icu_alternatives_android.h",
489     ]
490   }
493 grit("net_resources") {
494   source = "base/net_resources.grd"
495   use_qualified_include = true
496   outputs = [
497     "grit/net_resources.h",
498     "net_resources.pak",
499   ]
502 proto_library("net_quic_proto") {
503   visibility = [
504     ":net",
505     ":net_small",
506   ]
508   sources = [
509     "quic/proto/cached_network_parameters.proto",
510     "quic/proto/source_address_token.proto",
511   ]
512   cc_generator_options = "dllexport_decl=NET_EXPORT_PRIVATE:"
513   cc_include = "net/base/net_export.h"
515   defines = [ "NET_IMPLEMENTATION" ]
517   extra_configs = [ "//build/config/compiler:wexit_time_destructors" ]
520 static_library("extras") {
521   sources = gypi_values.net_extras_sources
522   configs += [ "//build/config/compiler:wexit_time_destructors" ]
523   deps = [
524     ":net",
525     "//base",
526     "//sql:sql",
527   ]
530 static_library("http_server") {
531   sources = [
532     "server/http_connection.cc",
533     "server/http_connection.h",
534     "server/http_server.cc",
535     "server/http_server.h",
536     "server/http_server_request_info.cc",
537     "server/http_server_request_info.h",
538     "server/http_server_response_info.cc",
539     "server/http_server_response_info.h",
540     "server/web_socket.cc",
541     "server/web_socket.h",
542     "server/web_socket_encoder.cc",
543     "server/web_socket_encoder.h",
544   ]
545   configs += [
546     "//build/config/compiler:no_size_t_to_int_warning",
547     "//build/config/compiler:wexit_time_destructors",
548   ]
549   deps = [
550     ":net",
551     "//base",
552   ]
555 executable("dump_cache") {
556   testonly = true
557   sources = [
558     "tools/dump_cache/dump_cache.cc",
559     "tools/dump_cache/dump_files.cc",
560     "tools/dump_cache/dump_files.h",
561   ]
563   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
564   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
566   deps = [
567     "//base",
568     ":net",
569     ":test_support",
570   ]
573 source_set("test_support") {
574   testonly = true
575   sources = [
576     "base/load_timing_info_test_util.cc",
577     "base/load_timing_info_test_util.h",
578     "base/mock_file_stream.cc",
579     "base/mock_file_stream.h",
580     "base/test_completion_callback.cc",
581     "base/test_completion_callback.h",
582     "base/test_data_directory.cc",
583     "base/test_data_directory.h",
584     "cert/mock_cert_verifier.cc",
585     "cert/mock_cert_verifier.h",
586     "cookies/cookie_monster_store_test.cc",
587     "cookies/cookie_monster_store_test.h",
588     "cookies/cookie_store_test_callbacks.cc",
589     "cookies/cookie_store_test_callbacks.h",
590     "cookies/cookie_store_test_helpers.cc",
591     "cookies/cookie_store_test_helpers.h",
592     "disk_cache/disk_cache_test_base.cc",
593     "disk_cache/disk_cache_test_base.h",
594     "disk_cache/disk_cache_test_util.cc",
595     "disk_cache/disk_cache_test_util.h",
596     "dns/dns_test_util.cc",
597     "dns/dns_test_util.h",
598     "dns/mock_host_resolver.cc",
599     "dns/mock_host_resolver.h",
600     "dns/mock_mdns_socket_factory.cc",
601     "dns/mock_mdns_socket_factory.h",
602     "http/http_transaction_test_util.cc",
603     "http/http_transaction_test_util.h",
604     "log/test_net_log.cc",
605     "log/test_net_log.h",
606     "log/test_net_log_entry.cc",
607     "log/test_net_log_entry.h",
608     "log/test_net_log_util.cc",
609     "log/test_net_log_util.h",
610     "proxy/mock_proxy_resolver.cc",
611     "proxy/mock_proxy_resolver.h",
612     "proxy/mock_proxy_script_fetcher.cc",
613     "proxy/mock_proxy_script_fetcher.h",
614     "proxy/proxy_config_service_common_unittest.cc",
615     "proxy/proxy_config_service_common_unittest.h",
616     "socket/socket_test_util.cc",
617     "socket/socket_test_util.h",
618     "test/cert_test_util.cc",
619     "test/cert_test_util.h",
620     "test/cert_test_util_nss.cc",
621     "test/channel_id_test_util.cc",
622     "test/channel_id_test_util.h",
623     "test/ct_test_util.cc",
624     "test/ct_test_util.h",
625     "test/embedded_test_server/embedded_test_server.cc",
626     "test/embedded_test_server/embedded_test_server.h",
627     "test/embedded_test_server/http_connection.cc",
628     "test/embedded_test_server/http_connection.h",
629     "test/embedded_test_server/http_request.cc",
630     "test/embedded_test_server/http_request.h",
631     "test/embedded_test_server/http_response.cc",
632     "test/embedded_test_server/http_response.h",
633     "test/embedded_test_server/stream_listen_socket.cc",
634     "test/embedded_test_server/stream_listen_socket.h",
635     "test/embedded_test_server/tcp_listen_socket.cc",
636     "test/embedded_test_server/tcp_listen_socket.h",
637     "test/event_waiter.h",
638     "test/net_test_suite.cc",
639     "test/net_test_suite.h",
640     "test/python_utils.cc",
641     "test/python_utils.h",
642     "test/spawned_test_server/base_test_server.cc",
643     "test/spawned_test_server/base_test_server.h",
644     "test/spawned_test_server/local_test_server.cc",
645     "test/spawned_test_server/local_test_server.h",
646     "test/spawned_test_server/local_test_server_posix.cc",
647     "test/spawned_test_server/local_test_server_win.cc",
648     "test/spawned_test_server/remote_test_server.cc",
649     "test/spawned_test_server/remote_test_server.h",
650     "test/spawned_test_server/spawned_test_server.h",
651     "test/spawned_test_server/spawner_communicator.cc",
652     "test/spawned_test_server/spawner_communicator.h",
653     "test/url_request/ssl_certificate_error_job.cc",
654     "test/url_request/ssl_certificate_error_job.h",
655     "test/url_request/url_request_failed_job.cc",
656     "test/url_request/url_request_failed_job.h",
657     "test/url_request/url_request_mock_data_job.cc",
658     "test/url_request/url_request_mock_data_job.h",
659     "test/url_request/url_request_slow_download_job.cc",
660     "test/url_request/url_request_slow_download_job.h",
661     "url_request/test_url_fetcher_factory.cc",
662     "url_request/test_url_fetcher_factory.h",
663     "url_request/url_request_test_util.cc",
664     "url_request/url_request_test_util.h",
665   ]
667   configs += [
668     "//build/config:precompiled_headers",
670     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
671     "//build/config/compiler:no_size_t_to_int_warning",
672   ]
674   public_deps = [
675     "//base",
676     "//base/test:test_support",
677     "//crypto",
678     "//net",
679     "//net/tools/tld_cleanup",
680     "//testing/gmock",
681     "//testing/gtest",
682     "//url",
683   ]
685   if (!is_ios) {
686     public_deps += [ "//third_party/protobuf:py_proto" ]
687   }
689   if (use_nss_certs || is_ios) {
690     public_deps += [ "//crypto:platform" ]
691   }
693   if (!is_android) {
694     sources -= [
695       "test/spawned_test_server/remote_test_server.cc",
696       "test/spawned_test_server/remote_test_server.h",
697       "test/spawned_test_server/spawner_communicator.cc",
698       "test/spawned_test_server/spawner_communicator.h",
699     ]
700   }
702   if (use_v8_in_net) {
703     public_deps += [ ":net_with_v8" ]
704   }
706   if (!enable_mdns) {
707     sources -= [
708       "dns/mock_mdns_socket_factory.cc",
709       "dns/mock_mdns_socket_factory.h",
710     ]
711   }
713   if (!use_nss_certs) {
714     sources -= [ "test/cert_test_util_nss.cc" ]
715   }
717   if (!disable_file_support) {
718     sources += [
719       "test/url_request/url_request_mock_http_job.cc",
720       "test/url_request/url_request_mock_http_job.h",
721       "url_request/test_url_request_interceptor.cc",
722       "url_request/test_url_request_interceptor.h",
723     ]
724   }
727 source_set("balsa") {
728   sources = [
729     "tools/balsa/balsa_enums.h",
730     "tools/balsa/balsa_frame.cc",
731     "tools/balsa/balsa_frame.h",
732     "tools/balsa/balsa_headers.cc",
733     "tools/balsa/balsa_headers.h",
734     "tools/balsa/balsa_headers_token_utils.cc",
735     "tools/balsa/balsa_headers_token_utils.h",
736     "tools/balsa/balsa_visitor_interface.h",
737     "tools/balsa/http_message_constants.cc",
738     "tools/balsa/http_message_constants.h",
739     "tools/balsa/noop_balsa_visitor.h",
740     "tools/balsa/simple_buffer.cc",
741     "tools/balsa/simple_buffer.h",
742     "tools/balsa/split.cc",
743     "tools/balsa/split.h",
744     "tools/balsa/string_piece_utils.h",
745     "tools/quic/spdy_balsa_utils.cc",
746     "tools/quic/spdy_balsa_utils.h",
747   ]
748   deps = [
749     ":net",
750     "//base",
751     "//url",
752   ]
755 if (use_v8_in_net) {
756   component("net_with_v8") {
757     sources = [
758       "proxy/proxy_resolver_v8.cc",
759       "proxy/proxy_resolver_v8.h",
760       "proxy/proxy_resolver_v8_tracing.cc",
761       "proxy/proxy_resolver_v8_tracing.h",
762       "proxy/proxy_resolver_v8_tracing_wrapper.cc",
763       "proxy/proxy_resolver_v8_tracing_wrapper.h",
764       "proxy/proxy_service_v8.cc",
765       "proxy/proxy_service_v8.h",
766     ]
768     defines = [ "NET_IMPLEMENTATION" ]
769     configs += [
770       "//build/config/compiler:no_size_t_to_int_warning",
771       "//build/config/compiler:wexit_time_destructors",
772     ]
774     public_deps = [
775       ":net",
776     ]
777     deps = [
778       "//base",
779       "//gin",
780       "//url",
781       "//v8",
782     ]
783   }
786 if (use_v8_in_net && !is_android) {
787   source_set("net_browser_services") {
788     sources = [
789       "dns/mojo_host_resolver_impl.cc",
790       "dns/mojo_host_resolver_impl.h",
791       "proxy/in_process_mojo_proxy_resolver_factory.cc",
792       "proxy/in_process_mojo_proxy_resolver_factory.h",
793       "proxy/mojo_proxy_resolver_factory.h",
794       "proxy/proxy_resolver_factory_mojo.cc",
795       "proxy/proxy_resolver_factory_mojo.h",
796       "proxy/proxy_service_mojo.cc",
797       "proxy/proxy_service_mojo.h",
798     ]
800     public_deps = [
801       ":mojo_type_converters",
802       ":net",
803       "//base",
804       "//mojo/common",
805       "//net/interfaces",
806       "//third_party/mojo/src/mojo/public/cpp/bindings",
808       # NOTE(amistry): As long as we support in-process Mojo v8 PAC, we need
809       # this dependency since in_process_mojo_proxy_resolver_factory creates
810       # the utility process side Mojo services in the browser process.
811       # Ultimately, this will go away when we only support out-of-process.
812       ":net_utility_services",
813     ]
814   }
816   source_set("mojo_type_converters") {
817     sources = [
818       "dns/mojo_host_type_converters.cc",
819       "dns/mojo_host_type_converters.h",
820       "proxy/mojo_proxy_type_converters.cc",
821       "proxy/mojo_proxy_type_converters.h",
822     ]
824     public_deps = [
825       ":net",
826       "//net/interfaces",
827       "//third_party/mojo/src/mojo/public/cpp/bindings",
828     ]
829   }
831   source_set("net_utility_services") {
832     sources = [
833       "dns/host_resolver_mojo.cc",
834       "dns/host_resolver_mojo.h",
835       "proxy/mojo_proxy_resolver_factory_impl.cc",
836       "proxy/mojo_proxy_resolver_factory_impl.h",
837       "proxy/mojo_proxy_resolver_impl.cc",
838       "proxy/mojo_proxy_resolver_impl.h",
839       "proxy/mojo_proxy_resolver_v8_tracing_bindings.h",
840     ]
842     deps = [
843       ":net_with_v8",
844     ]
846     public_deps = [
847       ":mojo_type_converters",
848       ":net",
849       "//mojo/common",
850       "//net/interfaces",
851       "//third_party/mojo/src/mojo/public/cpp/bindings",
852     ]
853   }
856 if (!is_ios && !is_android) {
857   executable("crash_cache") {
858     testonly = true
859     sources = [
860       "tools/crash_cache/crash_cache.cc",
861     ]
863     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
864     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
865     deps = [
866       ":net",
867       ":test_support",
868       "//base",
869     ]
870   }
872   executable("crl_set_dump") {
873     testonly = true
874     sources = [
875       "tools/crl_set_dump/crl_set_dump.cc",
876     ]
878     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
879     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
880     deps = [
881       ":net",
882       "//base",
883     ]
884   }
886   executable("dns_fuzz_stub") {
887     testonly = true
888     sources = [
889       "tools/dns_fuzz_stub/dns_fuzz_stub.cc",
890     ]
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 = [
895       ":net",
896       "//base",
897     ]
898   }
900   executable("gdig") {
901     testonly = true
902     sources = [
903       "tools/gdig/file_net_log.cc",
904       "tools/gdig/gdig.cc",
905     ]
906     deps = [
907       ":net",
908       "//base",
909     ]
910   }
912   executable("get_server_time") {
913     testonly = true
914     sources = [
915       "tools/get_server_time/get_server_time.cc",
916     ]
918     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
919     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
920     deps = [
921       ":net",
922       "//base",
923       "//base:i18n",
924       "//url",
925     ]
926   }
928   executable("hpack_example_generator") {
929     testonly = true
930     sources = [
931       "spdy/fuzzing/hpack_example_generator.cc",
932     ]
934     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
935     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
936     deps = [
937       "//base",
938       ":net",
939     ]
940   }
942   executable("hpack_fuzz_mutator") {
943     testonly = true
944     sources = [
945       "spdy/fuzzing/hpack_fuzz_mutator.cc",
946     ]
948     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
949     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
950     deps = [
951       "//base",
952       ":net",
953     ]
954   }
956   executable("hpack_fuzz_wrapper") {
957     testonly = true
958     sources = [
959       "spdy/fuzzing/hpack_fuzz_wrapper.cc",
960     ]
962     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
963     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
964     deps = [
965       "//base",
966       ":net",
967     ]
968   }
970   if (use_v8_in_net) {
971     executable("net_watcher") {
972       testonly = true
973       sources = [
974         "tools/net_watcher/net_watcher.cc",
975       ]
976       deps = [
977         ":net",
978         ":net_with_v8",
979         "//base",
980       ]
982       if (is_desktop_linux) {
983         configs += [
984           "//build/config/linux:gconf",
985           "//build/config/linux:glib",
986         ]
987         deps += [ "//build/config/linux:gio" ]
988       }
989     }
990   }
992   executable("run_testserver") {
993     testonly = true
994     sources = [
995       "tools/testserver/run_testserver.cc",
996     ]
997     deps = [
998       ":test_support",
999       "//base",
1000       "//base/test:test_support",
1001       "//testing/gtest",
1002     ]
1003   }
1005   executable("stress_cache") {
1006     testonly = true
1007     sources = [
1008       "tools/stress_cache/stress_cache.cc",
1009     ]
1011     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1012     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1013     deps = [
1014       ":net",
1015       ":test_support",
1016       "//base",
1017     ]
1018   }
1020   executable("tld_cleanup") {
1021     sources = [
1022       "tools/tld_cleanup/tld_cleanup.cc",
1023     ]
1025     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1026     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1027     deps = [
1028       "//base",
1029       "//base:i18n",
1030       "//net/tools/tld_cleanup",
1031     ]
1032   }
1035 if (is_linux) {
1036   static_library("epoll_server") {
1037     sources = [
1038       "tools/epoll_server/epoll_server.cc",
1039       "tools/epoll_server/epoll_server.h",
1040     ]
1041     deps = [
1042       ":net",
1043       "//base",
1044     ]
1045   }
1047   static_library("flip_in_mem_edsm_server_base") {
1048     testonly = true
1049     sources = [
1050       "tools/flip_server/acceptor_thread.cc",
1051       "tools/flip_server/acceptor_thread.h",
1052       "tools/flip_server/constants.h",
1053       "tools/flip_server/create_listener.cc",
1054       "tools/flip_server/create_listener.h",
1055       "tools/flip_server/flip_config.cc",
1056       "tools/flip_server/flip_config.h",
1057       "tools/flip_server/http_interface.cc",
1058       "tools/flip_server/http_interface.h",
1059       "tools/flip_server/loadtime_measurement.h",
1060       "tools/flip_server/mem_cache.cc",
1061       "tools/flip_server/mem_cache.h",
1062       "tools/flip_server/output_ordering.cc",
1063       "tools/flip_server/output_ordering.h",
1064       "tools/flip_server/ring_buffer.cc",
1065       "tools/flip_server/ring_buffer.h",
1066       "tools/flip_server/sm_connection.cc",
1067       "tools/flip_server/sm_connection.h",
1068       "tools/flip_server/sm_interface.h",
1069       "tools/flip_server/spdy_interface.cc",
1070       "tools/flip_server/spdy_interface.h",
1071       "tools/flip_server/spdy_ssl.cc",
1072       "tools/flip_server/spdy_ssl.h",
1073       "tools/flip_server/spdy_util.cc",
1074       "tools/flip_server/spdy_util.h",
1075       "tools/flip_server/streamer_interface.cc",
1076       "tools/flip_server/streamer_interface.h",
1077       "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",
1081     ]
1082     deps = [
1083       ":balsa",
1084       ":epoll_server",
1085       ":net",
1086       "//base",
1087       "//third_party/boringssl",
1088     ]
1089   }
1091   executable("flip_in_mem_edsm_server_unittests") {
1092     testonly = true
1093     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",
1100       "tools/flip_server/url_to_filename_encoder_unittest.cc",
1101       "tools/flip_server/url_utilities_unittest.cc",
1102     ]
1103     deps = [
1104       ":balsa",
1105       ":flip_in_mem_edsm_server_base",
1106       ":net",
1107       ":test_support",
1108       "//testing/gtest",
1109       "//testing/gmock",
1110       "//third_party/boringssl",
1111     ]
1112   }
1114   executable("flip_in_mem_edsm_server") {
1115     testonly = true
1116     sources = [
1117       "tools/flip_server/flip_in_mem_edsm_server.cc",
1118     ]
1119     deps = [
1120       ":balsa",
1121       ":flip_in_mem_edsm_server_base",
1122       ":net",
1123       "//base",
1124     ]
1125   }
1127   source_set("epoll_quic_tools") {
1128     sources = [
1129       "tools/quic/quic_client.cc",
1130       "tools/quic/quic_client.h",
1131       "tools/quic/quic_default_packet_writer.cc",
1132       "tools/quic/quic_default_packet_writer.h",
1133       "tools/quic/quic_epoll_clock.cc",
1134       "tools/quic/quic_epoll_clock.h",
1135       "tools/quic/quic_epoll_connection_helper.cc",
1136       "tools/quic/quic_epoll_connection_helper.h",
1137       "tools/quic/quic_packet_reader.cc",
1138       "tools/quic/quic_packet_reader.h",
1139       "tools/quic/quic_packet_writer_wrapper.cc",
1140       "tools/quic/quic_packet_writer_wrapper.h",
1141       "tools/quic/quic_server.cc",
1142       "tools/quic/quic_server.h",
1143       "tools/quic/quic_socket_utils.cc",
1144       "tools/quic/quic_socket_utils.h",
1145     ]
1146     deps = [
1147       ":balsa",
1148       ":epoll_server",
1149       ":net",
1150       "//base",
1151       "//base/third_party/dynamic_annotations",
1152       "//crypto",
1153       "//third_party/boringssl",
1154       "//url",
1155     ]
1156   }
1158   executable("epoll_quic_client") {
1159     sources = [
1160       "tools/quic/quic_client_bin.cc",
1161     ]
1162     deps = [
1163       ":balsa",
1164       ":epoll_server",
1165       ":epoll_quic_tools",
1166       ":net",
1167       ":simple_quic_tools",
1168       "//base",
1169       "//third_party/boringssl",
1170     ]
1171   }
1173   executable("epoll_quic_server") {
1174     sources = [
1175       "tools/quic/quic_server_bin.cc",
1176     ]
1177     deps = [
1178       ":balsa",
1179       ":epoll_server",
1180       ":epoll_quic_tools",
1181       ":net",
1182       ":simple_quic_tools",
1183       "//base",
1184       "//third_party/boringssl",
1185     ]
1186   }
1189 if (is_android) {
1190   generate_jni("net_jni_headers") {
1191     sources = [
1192       "android/java/src/org/chromium/net/AndroidCertVerifyResult.java",
1193       "android/java/src/org/chromium/net/AndroidKeyStore.java",
1194       "android/java/src/org/chromium/net/AndroidNetworkLibrary.java",
1195       "android/java/src/org/chromium/net/AndroidPrivateKey.java",
1196       "android/java/src/org/chromium/net/GURLUtils.java",
1197       "android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java",
1198       "android/java/src/org/chromium/net/NetStringUtil.java",
1199       "android/java/src/org/chromium/net/NetworkChangeNotifier.java",
1200       "android/java/src/org/chromium/net/ProxyChangeListener.java",
1201       "android/java/src/org/chromium/net/X509Util.java",
1202     ]
1203     jni_package = "net"
1204   }
1205   generate_jni("net_test_jni_headers") {
1206     sources = [
1207       "android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java",
1208       "test/android/javatests/src/org/chromium/net/test/DummySpnegoAuthenticator.java",
1209     ]
1210     jni_package = "net/test"
1211   }
1214 if (is_android || is_linux) {
1215   executable("disk_cache_memory_test") {
1216     testonly = true
1217     sources = [
1218       "tools/disk_cache_memory_test/disk_cache_memory_test.cc",
1219     ]
1220     deps = [
1221       ":net",
1222       "//base",
1223     ]
1224   }
1227 source_set("simple_quic_tools") {
1228   sources = [
1229     "tools/quic/quic_client_base.cc",
1230     "tools/quic/quic_client_base.h",
1231     "tools/quic/quic_client_session.cc",
1232     "tools/quic/quic_client_session.h",
1233     "tools/quic/quic_dispatcher.cc",
1234     "tools/quic/quic_dispatcher.h",
1235     "tools/quic/quic_in_memory_cache.cc",
1236     "tools/quic/quic_in_memory_cache.h",
1237     "tools/quic/quic_per_connection_packet_writer.cc",
1238     "tools/quic/quic_per_connection_packet_writer.h",
1239     "tools/quic/quic_server_session.cc",
1240     "tools/quic/quic_server_session.h",
1241     "tools/quic/quic_simple_client.cc",
1242     "tools/quic/quic_simple_client.h",
1243     "tools/quic/quic_simple_per_connection_packet_writer.cc",
1244     "tools/quic/quic_simple_per_connection_packet_writer.h",
1245     "tools/quic/quic_simple_server.cc",
1246     "tools/quic/quic_simple_server.h",
1247     "tools/quic/quic_simple_server_packet_writer.cc",
1248     "tools/quic/quic_simple_server_packet_writer.h",
1249     "tools/quic/quic_spdy_client_stream.cc",
1250     "tools/quic/quic_spdy_client_stream.h",
1251     "tools/quic/quic_spdy_server_stream.cc",
1252     "tools/quic/quic_spdy_server_stream.h",
1253     "tools/quic/quic_time_wait_list_manager.cc",
1254     "tools/quic/quic_time_wait_list_manager.h",
1255     "tools/quic/synchronous_host_resolver.cc",
1256     "tools/quic/synchronous_host_resolver.h",
1257   ]
1258   deps = [
1259     ":net",
1260     "//base",
1261     "//base/third_party/dynamic_annotations",
1262     "//url",
1263   ]
1266 if (!is_ios) {
1267   executable("quic_client") {
1268     sources = [
1269       "tools/quic/quic_simple_client_bin.cc",
1270     ]
1271     deps = [
1272       ":net",
1273       ":simple_quic_tools",
1274       "//base",
1275       "//url",
1276     ]
1277   }
1278   executable("quic_server") {
1279     sources = [
1280       "tools/quic/quic_simple_server_bin.cc",
1281     ]
1282     deps = [
1283       ":net",
1284       ":simple_quic_tools",
1285       "//base",
1286       "//third_party/boringssl",
1287       "//third_party/protobuf:protobuf_lite",
1288     ]
1289   }
1292 # TODO(GYP): Delete this after we've converted everything to GN.
1293 # The _run targets exist only for compatibility w/ GYP.
1294 group("net_unittests_run") {
1295   testonly = true
1296   deps = [
1297     ":net_unittests",
1298   ]
1301 test("net_unittests") {
1302   sources = gypi_values.net_test_sources
1304   if (is_ios) {
1305     sources -= [
1306       "websockets/websocket_stream_cookie_test.cc",
1307       "websockets/websocket_stream_create_test_base.cc",
1308       "websockets/websocket_stream_create_test_base.h",
1309     ]
1310   }
1312   configs += [
1313     "//build/config:precompiled_headers",
1315     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1316     "//build/config/compiler:no_size_t_to_int_warning",
1317   ]
1318   defines = []
1320   deps = [
1321     ":balsa",
1322     ":extras",
1323     ":http_server",
1324     ":net",
1325     ":simple_quic_tools",
1326     ":test_support",
1327     "//base",
1328     "//base:i18n",
1329     "//base:prefs_test_support",
1330     "//base/allocator",
1331     "//base/third_party/dynamic_annotations",
1332     "//crypto",
1333     "//crypto:platform",
1334     "//crypto:test_support",
1335     "//gin",
1336     "//net/base/registry_controlled_domains",
1337     "//sql",
1338     "//testing/gmock",
1339     "//testing/gtest",
1340     "//third_party/zlib",
1341     "//url",
1342   ]
1344   data = [
1345     "data/",
1346   ]
1348   if (is_linux || is_mac || is_win) {
1349     deps += [
1350       "//third_party/pyftpdlib/",
1351       "//third_party/pywebsocket/",
1352       "//third_party/tlslite/",
1353     ]
1354     data_deps = [
1355       "//third_party/pyftpdlib/",
1356       "//third_party/pywebsocket/",
1357       "//third_party/tlslite/",
1358     ]
1359     data += [
1360       "tools/testserver/",
1361       "//third_party/pyftpdlib/",
1362       "//third_party/pywebsocket/",
1363       "//third_party/tlslite/",
1364       "$root_out_dir/pyproto/google/",
1365     ]
1366   }
1368   if (is_desktop_linux) {
1369     deps += [ ":epoll_quic_tools" ]
1370   }
1371   if (is_linux) {
1372     sources += gypi_values.net_linux_test_sources
1373     deps += [
1374       ":epoll_quic_tools",
1375       ":epoll_server",
1376       ":flip_in_mem_edsm_server_base",
1377     ]
1378   }
1380   if (is_mac || is_ios) {
1381     sources += gypi_values.net_base_test_mac_ios_sources
1382   }
1384   if (is_chromeos) {
1385     sources -= [ "proxy/proxy_config_service_linux_unittest.cc" ]
1386   }
1388   if (v8_use_external_startup_data) {
1389     deps += [ "//gin" ]
1390   }
1392   if (!use_nss_certs) {
1393     sources -= [
1394       "cert/nss_cert_database_unittest.cc",
1395       "ssl/client_cert_store_nss_unittest.cc",
1396     ]
1397     if (is_chromeos) {  # Already removed for all non-ChromeOS builds.
1398       sources -= [
1399         "cert/nss_cert_database_chromeos_unittest.cc",
1400         "cert/nss_profile_filter_chromeos_unittest.cc",
1401       ]
1402     }
1403   }
1405   if (use_openssl) {
1406     # When building for OpenSSL, we need to exclude NSS specific tests
1407     # or functionality not supported by OpenSSL yet.
1408     # TODO(bulach): Add equivalent tests when the underlying
1409     #               functionality is ported to OpenSSL.
1410     sources -= [ "quic/test_tools/crypto_test_utils_nss.cc" ]
1411   } else {
1412     sources -= [
1413       "cert/x509_util_openssl_unittest.cc",
1414       "quic/test_tools/crypto_test_utils_openssl.cc",
1415       "socket/ssl_client_socket_openssl_unittest.cc",
1416       "ssl/ssl_client_session_cache_openssl_unittest.cc",
1417     ]
1418   }
1420   if (use_kerberos) {
1421     defines += [ "USE_KERBEROS" ]
1422   }
1424   # These are excluded on Android, because the actual Kerberos support, which
1425   # these test, is in a separate app on Android.
1426   if (!use_kerberos || is_android) {
1427     sources -= [
1428       "http/http_auth_gssapi_posix_unittest.cc",
1429       "http/mock_gssapi_library_posix.cc",
1430       "http/mock_gssapi_library_posix.h",
1431     ]
1432   }
1433   if (!use_kerberos) {
1434     sources -= [ "http/http_auth_handler_negotiate_unittest.cc" ]
1435   }
1437   if (use_openssl || (!is_desktop_linux && !is_chromeos && !is_ios)) {
1438     # Only include this test when on Posix and using NSS for
1439     # cert verification or on iOS (which also uses NSS for certs).
1440     sources -= [ "cert_net/nss_ocsp_unittest.cc" ]
1441   }
1443   if (!use_openssl_certs) {
1444     sources -= [ "ssl/openssl_client_key_store_unittest.cc" ]
1445   }
1447   if (!enable_websockets) {
1448     sources -= [
1449       "server/http_connection_unittest.cc",
1450       "server/http_server_response_info_unittest.cc",
1451       "server/http_server_unittest.cc",
1452       "server/web_socket_encoder_unittest.cc",
1453       "websockets/websocket_basic_stream_test.cc",
1454       "websockets/websocket_channel_test.cc",
1455       "websockets/websocket_deflate_predictor_impl_test.cc",
1456       "websockets/websocket_deflate_stream_test.cc",
1457       "websockets/websocket_deflater_test.cc",
1458       "websockets/websocket_end_to_end_test.cc",
1459       "websockets/websocket_errors_test.cc",
1460       "websockets/websocket_extension_parser_test.cc",
1461       "websockets/websocket_frame_parser_test.cc",
1462       "websockets/websocket_frame_test.cc",
1463       "websockets/websocket_handshake_challenge_test.cc",
1464       "websockets/websocket_handshake_stream_create_helper_test.cc",
1465       "websockets/websocket_inflater_test.cc",
1466       "websockets/websocket_stream_test.cc",
1467       "websockets/websocket_test_util.cc",
1468       "websockets/websocket_test_util.h",
1469     ]
1470     deps -= [ ":http_server" ]
1471   }
1473   if (disable_file_support) {
1474     sources -= [
1475       "base/directory_lister_unittest.cc",
1476       "url_request/url_request_file_job_unittest.cc",
1477     ]
1478   }
1480   if (disable_ftp_support) {
1481     sources -= [
1482       "ftp/ftp_auth_cache_unittest.cc",
1483       "ftp/ftp_ctrl_response_buffer_unittest.cc",
1484       "ftp/ftp_directory_listing_parser_ls_unittest.cc",
1485       "ftp/ftp_directory_listing_parser_netware_unittest.cc",
1486       "ftp/ftp_directory_listing_parser_os2_unittest.cc",
1487       "ftp/ftp_directory_listing_parser_unittest.cc",
1488       "ftp/ftp_directory_listing_parser_unittest.h",
1489       "ftp/ftp_directory_listing_parser_vms_unittest.cc",
1490       "ftp/ftp_directory_listing_parser_windows_unittest.cc",
1491       "ftp/ftp_network_transaction_unittest.cc",
1492       "ftp/ftp_util_unittest.cc",
1493       "url_request/url_request_ftp_job_unittest.cc",
1494     ]
1495   }
1497   if (!enable_built_in_dns) {
1498     sources -= [
1499       "dns/address_sorter_posix_unittest.cc",
1500       "dns/address_sorter_unittest.cc",
1501     ]
1502   }
1504   if (use_v8_in_net) {
1505     deps += [ ":net_with_v8" ]
1506   } else {
1507     sources -= [
1508       "proxy/proxy_resolver_v8_tracing_unittest.cc",
1509       "proxy/proxy_resolver_v8_tracing_wrapper_unittest.cc",
1510       "proxy/proxy_resolver_v8_unittest.cc",
1511     ]
1512   }
1514   if (use_v8_in_net && !is_android) {
1515     deps += [
1516       ":net_browser_services",
1517       ":net_utility_services",
1518       "//mojo/environment:chromium",
1519       "//third_party/mojo/src/mojo/edk/system",
1520     ]
1521   } else {
1522     sources -= [
1523       "dns/host_resolver_mojo_unittest.cc",
1524       "dns/mojo_host_resolver_impl_unittest.cc",
1525       "proxy/mojo_proxy_resolver_factory_impl_unittest.cc",
1526       "proxy/mojo_proxy_resolver_impl_unittest.cc",
1527       "proxy/mojo_proxy_resolver_v8_tracing_bindings_unittest.cc",
1528       "proxy/proxy_resolver_factory_mojo_unittest.cc",
1529       "proxy/proxy_service_mojo_unittest.cc",
1530     ]
1531   }
1533   if (!enable_mdns) {
1534     sources -= [
1535       "dns/mdns_cache_unittest.cc",
1536       "dns/mdns_client_unittest.cc",
1537       "dns/record_parsed_unittest.cc",
1538       "dns/record_rdata_unittest.cc",
1539     ]
1540   }
1542   if (is_ios) {
1543     # TODO(GYP)
1544     #  'actions': [
1545     #    {
1546     #      'action_name': 'copy_test_data',
1547     #      'variables': {
1548     #        'test_data_files': [
1549     #          'data/ssl/certificates/',
1550     #          'data/test.html',
1551     #          'data/url_request_unittest/',
1552     #          'data/verify_name_match_unittest/names/',
1553     #          'data/parse_certificate_unittest/',
1554     #        ],
1555     #        'test_data_prefix': 'net',
1556     #      },
1557     #      'includes': [ '../build/copy_test_data_ios.gypi' ],
1558     #    },
1559     #  ],
1560     sources -= [
1561       # TODO(droger): The following tests are disabled because the
1562       # implementation is missing or incomplete.
1563       # KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS.
1564       "base/keygen_handler_unittest.cc",
1565       "disk_cache/backend_unittest.cc",
1566       "disk_cache/blockfile/block_files_unittest.cc",
1568       # Need to read input data files.
1569       "filter/gzip_filter_unittest.cc",
1570       "socket/ssl_server_socket_unittest.cc",
1571       "spdy/fuzzing/hpack_fuzz_util_test.cc",
1573       # Need TestServer.
1574       "cert_net/cert_net_fetcher_impl_unittest.cc",
1575       "proxy/proxy_script_fetcher_impl_unittest.cc",
1576       "socket/ssl_client_socket_unittest.cc",
1577       "url_request/url_fetcher_impl_unittest.cc",
1578       "url_request/url_request_context_builder_unittest.cc",
1580       # Needs GetAppOutput().
1581       "test/python_utils_unittest.cc",
1583       # The following tests are disabled because they don't apply to
1584       # iOS.
1585       # OS is not "linux" or "freebsd" or "openbsd".
1586       "socket/unix_domain_client_socket_posix_unittest.cc",
1587       "socket/unix_domain_server_socket_posix_unittest.cc",
1589       # See bug http://crbug.com/344533.
1590       "disk_cache/blockfile/index_table_v3_unittest.cc",
1591     ]
1592   }
1594   if (is_android) {
1595     sources -= [
1596       # See bug http://crbug.com/344533.
1597       "disk_cache/blockfile/index_table_v3_unittest.cc",
1598       "dns/dns_config_service_posix_unittest.cc",
1599     ]
1600     deps += [
1601       ":net_test_jni_headers",
1603       # TODO(mmenke):  This depends on test_support_base, which depends on
1604       #                icu.  Figure out a way to remove that dependency.
1605       "//testing/android/native_test:native_test_native_code",
1606     ]
1607     set_sources_assignment_filter([])
1608     sources += [ "base/address_tracker_linux_unittest.cc" ]
1609     set_sources_assignment_filter(sources_assignment_filter)
1610     isolate_file = "net_unittests.isolate"
1611   }
1613   # Symbols for crashes when running tests on swarming.
1614   if (symbol_level > 0) {
1615     if (is_win) {
1616       data += [ "$root_out_dir/net_unittests.exe.pdb" ]
1617     } else if (is_mac) {
1618       data += [ "$root_out_dir/net_unittests.dSYM/" ]
1619     }
1620   }
1623 # !is_android && !is_win && !is_mac
1625 executable("net_perftests") {
1626   testonly = true
1627   sources = [
1628     "base/mime_sniffer_perftest.cc",
1629     "cookies/cookie_monster_perftest.cc",
1630     "disk_cache/blockfile/disk_cache_perftest.cc",
1631     "extras/sqlite/sqlite_persistent_cookie_store_perftest.cc",
1632     "proxy/proxy_resolver_perftest.cc",
1633     "udp/udp_socket_perftest.cc",
1634   ]
1636   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1637   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1638   deps = [
1639     ":extras",
1640     ":net",
1641     ":test_support",
1642     "//base",
1643     "//base:i18n",
1644     "//base/test:test_support_perf",
1645     "//testing/gtest",
1646     "//url",
1647   ]
1649   if (enable_websockets) {
1650     sources += [ "websockets/websocket_frame_perftest.cc" ]
1651   }
1653   if (use_v8_in_net) {
1654     deps += [ ":net_with_v8" ]
1655   } else {
1656     sources -= [ "proxy/proxy_resolver_perftest.cc" ]
1657   }