ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / net / BUILD.gn
blobfd27722664395bf6b120aad51f7d6599569bb7c3
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("//url/config.gni")
10 import("//testing/test.gni")
12 # TODO(cjhopman): //build/config/android/rules.gni also imports grit_rule.gni.
13 # Currently, that file can't be imported multiple times.  Make this always
14 # imported when http://crbug.com/393704 is fixed.
15 if (!is_android) {
16   import("//tools/grit/grit_rule.gni")
19 if (is_android) {
20   import("//build/config/android/config.gni")
21   import("//build/config/android/rules.gni")
22 } else if (is_mac) {
23   import("//build/config/mac/mac_sdk.gni")
26 # The list of net files is kept in net.gypi. Read it.
27 gypi_values = exec_script("//build/gypi_to_gn.py",
28                           [ rebase_path("net.gypi") ],
29                           "scope",
30                           [ "net.gypi" ])
32 # Disable Kerberos on ChromeOS, Android and iOS, at least for now. It needs
33 # configuration (krb5.conf and so on).
34 use_kerberos = !is_chromeos && !is_android && !is_ios
36 # The way the cache uses mmap() is inefficient on some Android devices. If
37 # this flag is set, we hackily avoid using mmap() in the disk cache. We are
38 # pretty confident that mmap-ing the index would not hurt any existing x86
39 # android devices, but we cannot be so sure about the variety of ARM devices.
40 # So enable it for x86 only for now.
41 posix_avoid_mmap = is_android && current_cpu != "x86"
43 # WebSockets and socket stream code are used everywhere except iOS.
44 enable_websockets = !is_ios
45 use_v8_in_net = !is_ios
46 enable_built_in_dns = !is_ios
47 disable_ftp_support = is_ios
49 declare_args() {
50   # Disables support for file URLs.  File URL support requires use of icu.
51   disable_file_support = false
54 config("net_config") {
55   defines = []
56   if (posix_avoid_mmap) {
57     defines += [ "POSIX_AVOID_MMAP" ]
58   }
59   if (disable_file_support) {
60     defines += [ "DISABLE_FILE_SUPPORT" ]
61   }
64 component("net") {
65   sources =
66       gypi_values.net_nacl_common_sources + gypi_values.net_non_nacl_sources
68   cflags = []
69   defines = [
70     # TODO(GYP) Note that he GYP file supports linux_link_kerberos (defaults to
71     # 0) which implies that we run pkg_config on kerberos and link to that
72     # rather than setting this define which will dynamically open it. That
73     # doesn't seem to be set in the regular builds, so we're skipping this
74     # capability here.
75     "DLOPEN_KERBEROS",
76     "NET_IMPLEMENTATION",
77   ]
79   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
80   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
81   public_configs = [ ":net_config" ]
82   include_dirs = []
84   public_deps = [
85     "//crypto",
86     "//crypto:platform",
87     "//url",
88   ]
89   deps = [
90     ":net_resources",
91     "//base",
92     "//base:i18n",
93     "//base:prefs",
94     "//base/third_party/dynamic_annotations",
95     "//net/base/registry_controlled_domains",
96     "//sdch",
97     "//third_party/icu",
98     "//third_party/zlib",
99     "//url",
100   ]
102   if (use_kerberos) {
103     defines += [ "USE_KERBEROS" ]
104     if (is_android) {
105       include_dirs += [ "/usr/include/kerberosV" ]
106     }
107   } else {
108     sources -= [
109       "http/http_auth_gssapi_posix.cc",
110       "http/http_auth_gssapi_posix.h",
111       "http/http_auth_handler_negotiate.cc",
112       "http/http_auth_handler_negotiate.h",
113     ]
114   }
116   if (is_posix) {
117     if (posix_avoid_mmap) {
118       sources -= [ "disk_cache/blockfile/mapped_file_posix.cc" ]
119     } else {
120       sources -= [ "disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc" ]
121     }
122   }
124   if (disable_file_support) {
125     sources -= [
126       "base/directory_lister.cc",
127       "base/directory_lister.h",
128       "url_request/file_protocol_handler.cc",
129       "url_request/file_protocol_handler.h",
130       "url_request/url_request_file_dir_job.cc",
131       "url_request/url_request_file_dir_job.h",
132       "url_request/url_request_file_job.cc",
133       "url_request/url_request_file_job.h",
134     ]
135   }
137   if (disable_ftp_support) {
138     sources -= [
139       "ftp/ftp_auth_cache.cc",
140       "ftp/ftp_auth_cache.h",
141       "ftp/ftp_ctrl_response_buffer.cc",
142       "ftp/ftp_ctrl_response_buffer.h",
143       "ftp/ftp_directory_listing_parser.cc",
144       "ftp/ftp_directory_listing_parser.h",
145       "ftp/ftp_directory_listing_parser_ls.cc",
146       "ftp/ftp_directory_listing_parser_ls.h",
147       "ftp/ftp_directory_listing_parser_netware.cc",
148       "ftp/ftp_directory_listing_parser_netware.h",
149       "ftp/ftp_directory_listing_parser_os2.cc",
150       "ftp/ftp_directory_listing_parser_os2.h",
151       "ftp/ftp_directory_listing_parser_vms.cc",
152       "ftp/ftp_directory_listing_parser_vms.h",
153       "ftp/ftp_directory_listing_parser_windows.cc",
154       "ftp/ftp_directory_listing_parser_windows.h",
155       "ftp/ftp_network_layer.cc",
156       "ftp/ftp_network_layer.h",
157       "ftp/ftp_network_session.cc",
158       "ftp/ftp_network_session.h",
159       "ftp/ftp_network_transaction.cc",
160       "ftp/ftp_network_transaction.h",
161       "ftp/ftp_request_info.h",
162       "ftp/ftp_response_info.cc",
163       "ftp/ftp_response_info.h",
164       "ftp/ftp_server_type_histograms.cc",
165       "ftp/ftp_server_type_histograms.h",
166       "ftp/ftp_transaction.h",
167       "ftp/ftp_transaction_factory.h",
168       "ftp/ftp_util.cc",
169       "ftp/ftp_util.h",
170       "url_request/ftp_protocol_handler.cc",
171       "url_request/ftp_protocol_handler.h",
172       "url_request/url_request_ftp_job.cc",
173       "url_request/url_request_ftp_job.h",
174     ]
175   }
177   if (enable_built_in_dns) {
178     defines += [ "ENABLE_BUILT_IN_DNS" ]
179   } else {
180     sources -= [
181       "dns/address_sorter_posix.cc",
182       "dns/address_sorter_posix.h",
183       "dns/dns_client.cc",
184     ]
185   }
187   if (use_openssl) {
188     sources -= [
189       "base/nss_memio.c",
190       "base/nss_memio.h",
191       "cert/ct_log_verifier_nss.cc",
192       "cert/ct_objects_extractor_nss.cc",
193       "cert/jwk_serializer_nss.cc",
194       "cert/scoped_nss_types.h",
195       "cert/test_root_certs_nss.cc",
196       "cert/x509_util_nss.cc",
197       "cert/x509_util_nss.h",
198       "ocsp/nss_ocsp.cc",
199       "ocsp/nss_ocsp.h",
200       "quic/crypto/aead_base_decrypter_nss.cc",
201       "quic/crypto/aead_base_encrypter_nss.cc",
202       "quic/crypto/aes_128_gcm_12_decrypter_nss.cc",
203       "quic/crypto/aes_128_gcm_12_encrypter_nss.cc",
204       "quic/crypto/chacha20_poly1305_decrypter_nss.cc",
205       "quic/crypto/chacha20_poly1305_encrypter_nss.cc",
206       "quic/crypto/channel_id_nss.cc",
207       "quic/crypto/p256_key_exchange_nss.cc",
208       "socket/nss_ssl_util.cc",
209       "socket/nss_ssl_util.h",
210       "socket/ssl_client_socket_nss.cc",
211       "socket/ssl_client_socket_nss.h",
212       "socket/ssl_server_socket_nss.cc",
213       "socket/ssl_server_socket_nss.h",
214     ]
215     if (is_chromeos) {
216       sources -= [
217         "cert/nss_cert_database_chromeos.cc",
218         "cert/nss_cert_database_chromeos.h",
219         "cert/nss_profile_filter_chromeos.cc",
220         "cert/nss_profile_filter_chromeos.h",
221       ]
222     }
223     if (is_linux) {
224       # These are always removed for non-Linux cases below.
225       sources -= [
226         "base/crypto_module_nss.cc",
227         "base/keygen_handler_nss.cc",
228         "cert/cert_database_nss.cc",
229         "cert/nss_cert_database.cc",
230         "cert/nss_cert_database.h",
231         "cert/x509_certificate_nss.cc",
232         "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
233         "third_party/mozilla_security_manager/nsKeygenHandler.h",
234         "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
235         "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
236         "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
237         "third_party/mozilla_security_manager/nsPKCS12Blob.h",
238       ]
239     }
240     if (is_ios) {
241       # Always removed for !ios below.
242       sources -= [
243         "cert/cert_verify_proc_nss.cc",
244         "cert/cert_verify_proc_nss.h",
245       ]
246     }
247     if (is_win) {
248       sources -= [ "cert/sha256_legacy_support_nss_win.cc" ]
249     }
250   } else {
251     sources -= [
252       "base/crypto_module_openssl.cc",
253       "cert/ct_log_verifier_openssl.cc",
254       "cert/ct_objects_extractor_openssl.cc",
255       "cert/jwk_serializer_openssl.cc",
256       "cert/x509_util_openssl.cc",
257       "cert/x509_util_openssl.h",
258       "quic/crypto/aead_base_decrypter_openssl.cc",
259       "quic/crypto/aead_base_encrypter_openssl.cc",
260       "quic/crypto/aes_128_gcm_12_decrypter_openssl.cc",
261       "quic/crypto/aes_128_gcm_12_encrypter_openssl.cc",
262       "quic/crypto/chacha20_poly1305_decrypter_openssl.cc",
263       "quic/crypto/chacha20_poly1305_encrypter_openssl.cc",
264       "quic/crypto/channel_id_openssl.cc",
265       "quic/crypto/p256_key_exchange_openssl.cc",
266       "quic/crypto/scoped_evp_aead_ctx.cc",
267       "quic/crypto/scoped_evp_aead_ctx.h",
268       "socket/ssl_client_socket_openssl.cc",
269       "socket/ssl_client_socket_openssl.h",
270       "socket/ssl_server_socket_openssl.cc",
271       "socket/ssl_server_socket_openssl.h",
272       "socket/ssl_session_cache_openssl.cc",
273       "socket/ssl_session_cache_openssl.h",
274       "ssl/openssl_platform_key.h",
275       "ssl/openssl_ssl_util.cc",
276       "ssl/openssl_ssl_util.h",
277     ]
278     if (is_mac) {
279       sources -= [ "ssl/openssl_platform_key_mac.cc" ]
280     }
281     if (is_win) {
282       sources -= [
283         "cert/sha256_legacy_support_openssl_win.cc",
284         "ssl/openssl_platform_key_win.cc",
285       ]
286     }
287   }
289   if (!use_openssl_certs) {
290     sources -= [
291       "base/keygen_handler_openssl.cc",
292       "base/openssl_private_key_store.h",
293       "base/openssl_private_key_store_memory.cc",
294       "cert/cert_database_openssl.cc",
295       "cert/cert_verify_proc_openssl.cc",
296       "cert/cert_verify_proc_openssl.h",
297       "cert/test_root_certs_openssl.cc",
298       "cert/x509_certificate_openssl.cc",
299       "ssl/openssl_client_key_store.cc",
300       "ssl/openssl_client_key_store.h",
301     ]
302     if (is_android) {
303       sources -= [ "base/openssl_private_key_store_android.cc" ]
304     }
305   } else if (is_android) {
306     # Android doesn't use these even when using OpenSSL.
307     sources -= [
308       "base/openssl_private_key_store_memory.cc",
309       "cert/cert_database_openssl.cc",
310       "cert/cert_verify_proc_openssl.cc",
311       "cert/test_root_certs_openssl.cc",
312     ]
313   }
315   if (use_glib && !is_chromeos) {
316     configs += [ "//build/config/linux:gconf" ]
317     deps += [ "//build/config/linux:gio" ]
318   }
320   if (is_linux) {
321     configs += [ "//build/config/linux:libresolv" ]
322   } else {
323     sources -= [
324       "base/crypto_module_nss.cc",
325       "base/keygen_handler_nss.cc",
326       "cert/cert_database_nss.cc",
327       "cert/nss_cert_database.cc",
328       "cert/nss_cert_database.h",
329       "cert/x509_certificate_nss.cc",
330       "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
331       "third_party/mozilla_security_manager/nsKeygenHandler.h",
332       "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
333       "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
334       "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
335       "third_party/mozilla_security_manager/nsPKCS12Blob.h",
336     ]
338     if (!is_ios && !use_openssl) {
339       # These files are part of the partial implementation of NSS on iOS so
340       # keep them in that case.
341       sources -= [
342         "cert/test_root_certs_nss.cc",
343         "ocsp/nss_ocsp.cc",
344         "ocsp/nss_ocsp.h",
345       ]
346     }
347   }
349   if (!use_nss_certs) {
350     sources -= [
351       "ssl/client_cert_store_nss.cc",
352       "ssl/client_cert_store_nss.h",
353     ]
354     if (!is_ios) {
355       # These files are part of the partial implementation of NSS on iOS so
356       # keep them in that case (even though use_nss_certs is not set).
357       sources -= [
358         "cert/cert_verify_proc_nss.cc",
359         "cert/cert_verify_proc_nss.h",
360       ]
361     }
362     if (is_chromeos) {
363       # These were already removed on non-ChromeOS.
364       sources -= [
365         "ssl/client_cert_store_chromeos.cc",
366         "ssl/client_cert_store_chromeos.h",
367       ]
368     }
369   }
371   if (!enable_websockets) {
372     sources -= [
373       "websockets/websocket_basic_handshake_stream.cc",
374       "websockets/websocket_basic_handshake_stream.h",
375       "websockets/websocket_basic_stream.cc",
376       "websockets/websocket_basic_stream.h",
377       "websockets/websocket_channel.cc",
378       "websockets/websocket_channel.h",
379       "websockets/websocket_deflate_predictor.h",
380       "websockets/websocket_deflate_predictor_impl.cc",
381       "websockets/websocket_deflate_predictor_impl.h",
382       "websockets/websocket_deflate_stream.cc",
383       "websockets/websocket_deflate_stream.h",
384       "websockets/websocket_deflater.cc",
385       "websockets/websocket_deflater.h",
386       "websockets/websocket_errors.cc",
387       "websockets/websocket_errors.h",
388       "websockets/websocket_extension.cc",
389       "websockets/websocket_extension.h",
390       "websockets/websocket_extension_parser.cc",
391       "websockets/websocket_extension_parser.h",
392       "websockets/websocket_frame.cc",
393       "websockets/websocket_frame.h",
394       "websockets/websocket_frame_parser.cc",
395       "websockets/websocket_frame_parser.h",
396       "websockets/websocket_handshake_challenge.cc",
397       "websockets/websocket_handshake_challenge.h",
398       "websockets/websocket_handshake_constants.cc",
399       "websockets/websocket_handshake_constants.h",
400       "websockets/websocket_handshake_request_info.cc",
401       "websockets/websocket_handshake_request_info.h",
402       "websockets/websocket_handshake_response_info.cc",
403       "websockets/websocket_handshake_response_info.h",
404       "websockets/websocket_handshake_stream_base.h",
405       "websockets/websocket_handshake_stream_create_helper.cc",
406       "websockets/websocket_handshake_stream_create_helper.h",
407       "websockets/websocket_inflater.cc",
408       "websockets/websocket_inflater.h",
409       "websockets/websocket_mux.h",
410       "websockets/websocket_stream.cc",
411       "websockets/websocket_stream.h",
412     ]
413   }
415   if (!enable_mdns) {
416     sources -= [
417       "dns/mdns_cache.cc",
418       "dns/mdns_cache.h",
419       "dns/mdns_client.cc",
420       "dns/mdns_client.h",
421       "dns/mdns_client_impl.cc",
422       "dns/mdns_client_impl.h",
423       "dns/record_parsed.cc",
424       "dns/record_parsed.h",
425       "dns/record_rdata.cc",
426       "dns/record_rdata.h",
427     ]
428   }
430   if (is_win) {
431     sources -= [
432       "http/http_auth_handler_ntlm_portable.cc",
433       "socket/socket_libevent.cc",
434       "socket/socket_libevent.h",
435       "socket/tcp_socket_libevent.cc",
436       "socket/tcp_socket_libevent.h",
437       "udp/udp_socket_libevent.cc",
438       "udp/udp_socket_libevent.h",
439     ]
440   } else {  # !is_win
441     sources -= [
442       "base/winsock_init.cc",
443       "base/winsock_init.h",
444       "base/winsock_util.cc",
445       "base/winsock_util.h",
446       "proxy/proxy_resolver_winhttp.cc",
447       "proxy/proxy_resolver_winhttp.h",
448     ]
449   }
451   if (is_mac) {
452     libs = [
453       "Foundation.framework",
454       "Security.framework",
455       "SystemConfiguration.framework",
456       "resolv",
457     ]
458   }
460   if (is_ios) {
461     # Add back some sources that were otherwise filtered out. iOS additionally
462     # doesn't set USE_NSS but needs some of the files.
463     set_sources_assignment_filter([])
464     sources += [
465       "base/net_util_mac.cc",
466       "base/net_util_mac.h",
467       "base/network_change_notifier_mac.cc",
468       "base/network_config_watcher_mac.cc",
469       "base/platform_mime_util_mac.mm",
470       "cert/cert_verify_proc_nss.cc",
471       "cert/cert_verify_proc_nss.h",
472       "cert/test_root_certs_nss.cc",
473       "cert/x509_util_nss.cc",
474       "cert/x509_util_nss.h",
475       "ocsp/nss_ocsp.cc",
476       "ocsp/nss_ocsp.h",
477       "proxy/proxy_resolver_mac.cc",
478       "proxy/proxy_server_mac.cc",
479     ]
480     set_sources_assignment_filter(sources_assignment_filter)
482     sources -= [ "disk_cache/blockfile/file_posix.cc" ]
483     libs = [
484       "CFNetwork.framework",
485       "MobileCoreServices.framework",
486       "Security.framework",
487       "SystemConfiguration.framework",
488       "resolv",
489     ]
490   }
492   if (is_ios || is_mac) {
493     sources += gypi_values.net_base_mac_ios_sources
494   }
496   if (is_android) {
497     # Add some Linux sources that were excluded by the filter, but which
498     # are needed.
499     set_sources_assignment_filter([])
500     sources += [
501       "base/address_tracker_linux.cc",
502       "base/address_tracker_linux.h",
503       "base/net_util_linux.cc",
504       "base/net_util_linux.h",
505       "base/platform_mime_util_linux.cc",
506     ]
507     set_sources_assignment_filter(sources_assignment_filter)
509     if (!is_android_webview_build) {
510       deps += [ ":net_jni_headers" ]
511     }
512   }
514   if (use_icu_alternatives_on_android) {
515     deps -= [
516       "//base:i18n",
517       "//third_party/icu",
518     ]
519     sources -= [
520       "base/filename_util_icu.cc",
521       "base/net_string_util_icu.cc",
522       "base/net_util_icu.cc",
523     ]
524     sources += [
525       "base/net_string_util_icu_alternatives_android.cc",
526       "base/net_string_util_icu_alternatives_android.h",
527     ]
528   }
531 grit("net_resources") {
532   source = "base/net_resources.grd"
533   use_qualified_include = true
534   outputs = [
535     "grit/net_resources.h",
536     "net_resources.pak",
537     "net_resources.rc",
538   ]
541 static_library("extras") {
542   sources = gypi_values.net_extras_sources
543   configs += [ "//build/config/compiler:wexit_time_destructors" ]
544   deps = [
545     ":net",
546     "//base",
547     "//sql:sql",
548   ]
551 static_library("http_server") {
552   sources = [
553     "server/http_connection.cc",
554     "server/http_connection.h",
555     "server/http_server.cc",
556     "server/http_server.h",
557     "server/http_server_request_info.cc",
558     "server/http_server_request_info.h",
559     "server/http_server_response_info.cc",
560     "server/http_server_response_info.h",
561     "server/web_socket.cc",
562     "server/web_socket.h",
563     "server/web_socket_encoder.cc",
564     "server/web_socket_encoder.h",
565   ]
566   configs += [
567     "//build/config/compiler:no_size_t_to_int_warning",
568     "//build/config/compiler:wexit_time_destructors",
569   ]
570   deps = [
571     ":net",
572     "//base",
573   ]
576 executable("dump_cache") {
577   testonly = true
578   sources = [
579     "tools/dump_cache/cache_dumper.cc",
580     "tools/dump_cache/cache_dumper.h",
581     "tools/dump_cache/dump_cache.cc",
582     "tools/dump_cache/dump_files.cc",
583     "tools/dump_cache/dump_files.h",
584     "tools/dump_cache/simple_cache_dumper.cc",
585     "tools/dump_cache/simple_cache_dumper.h",
586     "tools/dump_cache/url_to_filename_encoder.cc",
587     "tools/dump_cache/url_to_filename_encoder.h",
588     "tools/dump_cache/url_utilities.cc",
589     "tools/dump_cache/url_utilities.h",
590   ]
592   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
593   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
595   deps = [
596     "//base",
597     ":net",
598     ":test_support",
599   ]
602 source_set("test_support") {
603   testonly = true
604   sources = [
605     "base/captured_net_log_entry.cc",
606     "base/captured_net_log_entry.h",
607     "base/capturing_net_log.cc",
608     "base/capturing_net_log.h",
609     "base/capturing_net_log_observer.cc",
610     "base/capturing_net_log_observer.h",
611     "base/load_timing_info_test_util.cc",
612     "base/load_timing_info_test_util.h",
613     "base/mock_file_stream.cc",
614     "base/mock_file_stream.h",
615     "base/test_completion_callback.cc",
616     "base/test_completion_callback.h",
617     "base/test_data_directory.cc",
618     "base/test_data_directory.h",
619     "cert/mock_cert_verifier.cc",
620     "cert/mock_cert_verifier.h",
621     "cookies/cookie_monster_store_test.cc",
622     "cookies/cookie_monster_store_test.h",
623     "cookies/cookie_store_test_callbacks.cc",
624     "cookies/cookie_store_test_callbacks.h",
625     "cookies/cookie_store_test_helpers.cc",
626     "cookies/cookie_store_test_helpers.h",
627     "disk_cache/disk_cache_test_base.cc",
628     "disk_cache/disk_cache_test_base.h",
629     "disk_cache/disk_cache_test_util.cc",
630     "disk_cache/disk_cache_test_util.h",
631     "dns/dns_test_util.cc",
632     "dns/dns_test_util.h",
633     "dns/mock_host_resolver.cc",
634     "dns/mock_host_resolver.h",
635     "dns/mock_mdns_socket_factory.cc",
636     "dns/mock_mdns_socket_factory.h",
637     "http/http_transaction_test_util.cc",
638     "http/http_transaction_test_util.h",
639     "proxy/mock_proxy_resolver.cc",
640     "proxy/mock_proxy_resolver.h",
641     "proxy/mock_proxy_script_fetcher.cc",
642     "proxy/mock_proxy_script_fetcher.h",
643     "proxy/proxy_config_service_common_unittest.cc",
644     "proxy/proxy_config_service_common_unittest.h",
645     "socket/socket_test_util.cc",
646     "socket/socket_test_util.h",
647     "test/cert_test_util.cc",
648     "test/cert_test_util.h",
649     "test/cert_test_util_nss.cc",
650     "test/ct_test_util.cc",
651     "test/ct_test_util.h",
652     "test/embedded_test_server/embedded_test_server.cc",
653     "test/embedded_test_server/embedded_test_server.h",
654     "test/embedded_test_server/http_connection.cc",
655     "test/embedded_test_server/http_connection.h",
656     "test/embedded_test_server/http_request.cc",
657     "test/embedded_test_server/http_request.h",
658     "test/embedded_test_server/http_response.cc",
659     "test/embedded_test_server/http_response.h",
660     "test/event_waiter.h",
661     "test/net_test_suite.cc",
662     "test/net_test_suite.h",
663     "test/python_utils.cc",
664     "test/python_utils.h",
665     "test/spawned_test_server/base_test_server.cc",
666     "test/spawned_test_server/base_test_server.h",
667     "test/spawned_test_server/local_test_server.cc",
668     "test/spawned_test_server/local_test_server.h",
669     "test/spawned_test_server/local_test_server_posix.cc",
670     "test/spawned_test_server/local_test_server_win.cc",
671     "test/spawned_test_server/remote_test_server.cc",
672     "test/spawned_test_server/remote_test_server.h",
673     "test/spawned_test_server/spawned_test_server.h",
674     "test/spawned_test_server/spawner_communicator.cc",
675     "test/spawned_test_server/spawner_communicator.h",
676     "test/url_request/url_request_failed_job.cc",
677     "test/url_request/url_request_failed_job.h",
678     "test/url_request/url_request_mock_data_job.cc",
679     "test/url_request/url_request_mock_data_job.h",
680     "test/url_request/url_request_mock_http_job.cc",
681     "test/url_request/url_request_mock_http_job.h",
682     "test/url_request/url_request_slow_download_job.cc",
683     "test/url_request/url_request_slow_download_job.h",
684     "url_request/test_url_fetcher_factory.cc",
685     "url_request/test_url_fetcher_factory.h",
686     "url_request/test_url_request_interceptor.cc",
687     "url_request/test_url_request_interceptor.h",
688     "url_request/url_request_test_util.cc",
689     "url_request/url_request_test_util.h",
690   ]
692   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
693   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
695   public_deps = [
696     "//base",
697     "//base/test:test_support",
698     "//crypto",
699     "//net",
700     "//net/tools/tld_cleanup",
701     "//testing/gmock",
702     "//testing/gtest",
703     "//url",
704   ]
706   if (!use_openssl && (use_nss_certs || is_ios)) {
707     public_deps += [ "//crypto:platform" ]
708   }
710   if (!is_android) {
711     sources -= [
712       "test/spawned_test_server/remote_test_server.cc",
713       "test/spawned_test_server/remote_test_server.h",
714       "test/spawned_test_server/spawner_communicator.cc",
715       "test/spawned_test_server/spawner_communicator.h",
716     ]
717   }
719   if (use_v8_in_net) {
720     public_deps += [ ":net_with_v8" ]
721   }
723   if (!enable_mdns) {
724     sources -= [
725       "dns/mock_mdns_socket_factory.cc",
726       "dns/mock_mdns_socket_factory.h",
727     ]
728   }
730   if (!use_nss_certs) {
731     sources -= [ "test/cert_test_util_nss.cc" ]
732   }
735 source_set("balsa") {
736   sources = [
737     "tools/balsa/balsa_enums.h",
738     "tools/balsa/balsa_frame.cc",
739     "tools/balsa/balsa_frame.h",
740     "tools/balsa/balsa_headers.cc",
741     "tools/balsa/balsa_headers.h",
742     "tools/balsa/balsa_headers_token_utils.cc",
743     "tools/balsa/balsa_headers_token_utils.h",
744     "tools/balsa/balsa_visitor_interface.h",
745     "tools/balsa/http_message_constants.cc",
746     "tools/balsa/http_message_constants.h",
747     "tools/balsa/noop_balsa_visitor.h",
748     "tools/balsa/simple_buffer.cc",
749     "tools/balsa/simple_buffer.h",
750     "tools/balsa/split.cc",
751     "tools/balsa/split.h",
752     "tools/balsa/string_piece_utils.h",
753     "tools/quic/spdy_utils.cc",
754     "tools/quic/spdy_utils.h",
755   ]
756   deps = [
757     ":net",
758     "//base",
759     "//url",
760   ]
763 if (use_v8_in_net) {
764   component("net_with_v8") {
765     sources = [
766       "proxy/proxy_resolver_v8.cc",
767       "proxy/proxy_resolver_v8.h",
768       "proxy/proxy_resolver_v8_tracing.cc",
769       "proxy/proxy_resolver_v8_tracing.h",
770       "proxy/proxy_service_v8.cc",
771       "proxy/proxy_service_v8.h",
772     ]
774     defines = [ "NET_IMPLEMENTATION" ]
775     configs += [
776       "//build/config/compiler:no_size_t_to_int_warning",
777       "//build/config/compiler:wexit_time_destructors",
778     ]
780     public_deps = [
781       ":net",
782     ]
783     deps = [
784       "//base",
785       "//gin",
786       "//url",
787       "//v8",
788     ]
789   }
792 if (use_v8_in_net && !is_android) {
793   source_set("net_browser_services") {
794     sources = [
795       "dns/mojo_host_resolver_impl.cc",
796       "dns/mojo_host_resolver_impl.h",
797     ]
799     public_deps = [
800       ":mojo_type_converters",
801       ":net",
802       "//base",
803       "//net/interfaces",
804       "//third_party/mojo/src/mojo/public/cpp/bindings",
805     ]
806   }
808   source_set("mojo_type_converters") {
809     sources = [
810       "dns/mojo_host_type_converters.cc",
811       "dns/mojo_host_type_converters.h",
812       "proxy/mojo_proxy_type_converters.cc",
813       "proxy/mojo_proxy_type_converters.h",
814     ]
816     public_deps = [
817       ":net",
818       "//net/interfaces",
819       "//third_party/mojo/src/mojo/public/cpp/bindings",
820     ]
821   }
823   source_set("net_utility_services") {
824     sources = [
825       "dns/host_resolver_mojo.cc",
826       "dns/host_resolver_mojo.h",
827       "proxy/mojo_proxy_resolver_factory_impl.cc",
828       "proxy/mojo_proxy_resolver_factory_impl.h",
829       "proxy/mojo_proxy_resolver_impl.cc",
830       "proxy/mojo_proxy_resolver_impl.h",
831     ]
833     public_deps = [
834       ":mojo_type_converters",
835       ":net",
836       "//mojo/common",
837       "//net/interfaces",
838       "//third_party/mojo/src/mojo/public/cpp/bindings",
839     ]
840   }
843 if (!is_ios && !is_android) {
844   executable("crash_cache") {
845     testonly = true
846     sources = [
847       "tools/crash_cache/crash_cache.cc",
848     ]
850     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
851     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
852     deps = [
853       ":net",
854       ":test_support",
855       "//base",
856     ]
857   }
859   executable("crl_set_dump") {
860     testonly = true
861     sources = [
862       "tools/crl_set_dump/crl_set_dump.cc",
863     ]
865     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
866     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
867     deps = [
868       ":net",
869       "//base",
870     ]
871   }
873   executable("dns_fuzz_stub") {
874     testonly = true
875     sources = [
876       "tools/dns_fuzz_stub/dns_fuzz_stub.cc",
877     ]
879     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
880     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
881     deps = [
882       ":net",
883       "//base",
884     ]
885   }
887   executable("gdig") {
888     testonly = true
889     sources = [
890       "tools/gdig/file_net_log.cc",
891       "tools/gdig/gdig.cc",
892     ]
893     deps = [
894       ":net",
895       "//base",
896     ]
897   }
899   executable("get_server_time") {
900     testonly = true
901     sources = [
902       "tools/get_server_time/get_server_time.cc",
903     ]
905     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
906     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
907     deps = [
908       ":net",
909       "//base",
910       "//base:i18n",
911       "//url",
912     ]
913   }
915   if (use_v8_in_net) {
916     executable("net_watcher") {
917       testonly = true
918       sources = [
919         "tools/net_watcher/net_watcher.cc",
920       ]
921       deps = [
922         ":net",
923         ":net_with_v8",
924         "//base",
925       ]
927       if (is_desktop_linux) {
928         configs += [
929           "//build/config/linux:gconf",
930           "//build/config/linux:glib",
931         ]
932         deps += [ "//build/config/linux:gio" ]
933       }
934     }
935   }
937   executable("run_testserver") {
938     testonly = true
939     sources = [
940       "tools/testserver/run_testserver.cc",
941     ]
942     deps = [
943       ":net",  # TODO(brettw) bug 363749: this shouldn't be necessary. It's not
944                # in the GYP build, and can be removed when the bug is fixed.
946       ":test_support",
947       "//base",
948       "//base/test:test_support",
949       "//testing/gtest",
950     ]
951   }
953   executable("stress_cache") {
954     testonly = true
955     sources = [
956       "disk_cache/blockfile/stress_cache.cc",
957     ]
959     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
960     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
961     deps = [
962       ":net",
963       ":test_support",
964       "//base",
965     ]
966   }
968   executable("tld_cleanup") {
969     sources = [
970       "tools/tld_cleanup/tld_cleanup.cc",
971     ]
973     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
974     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
975     deps = [
976       "//base",
977       "//base:i18n",
978       "//net/tools/tld_cleanup",
979     ]
980   }
983 if (is_linux) {
984   static_library("epoll_server") {
985     sources = [
986       "tools/epoll_server/epoll_server.cc",
987       "tools/epoll_server/epoll_server.h",
988     ]
989     deps = [
990       ":net",
991       "//base",
992     ]
993   }
995   static_library("flip_in_mem_edsm_server_base") {
996     testonly = true
997     sources = [
998       "tools/dump_cache/url_to_filename_encoder.cc",
999       "tools/dump_cache/url_to_filename_encoder.h",
1000       "tools/dump_cache/url_utilities.cc",
1001       "tools/dump_cache/url_utilities.h",
1002       "tools/flip_server/acceptor_thread.cc",
1003       "tools/flip_server/acceptor_thread.h",
1004       "tools/flip_server/constants.h",
1005       "tools/flip_server/create_listener.cc",
1006       "tools/flip_server/create_listener.h",
1007       "tools/flip_server/flip_config.cc",
1008       "tools/flip_server/flip_config.h",
1009       "tools/flip_server/http_interface.cc",
1010       "tools/flip_server/http_interface.h",
1011       "tools/flip_server/loadtime_measurement.h",
1012       "tools/flip_server/mem_cache.cc",
1013       "tools/flip_server/mem_cache.h",
1014       "tools/flip_server/output_ordering.cc",
1015       "tools/flip_server/output_ordering.h",
1016       "tools/flip_server/ring_buffer.cc",
1017       "tools/flip_server/ring_buffer.h",
1018       "tools/flip_server/sm_connection.cc",
1019       "tools/flip_server/sm_connection.h",
1020       "tools/flip_server/sm_interface.h",
1021       "tools/flip_server/spdy_interface.cc",
1022       "tools/flip_server/spdy_interface.h",
1023       "tools/flip_server/spdy_ssl.cc",
1024       "tools/flip_server/spdy_ssl.h",
1025       "tools/flip_server/spdy_util.cc",
1026       "tools/flip_server/spdy_util.h",
1027       "tools/flip_server/streamer_interface.cc",
1028       "tools/flip_server/streamer_interface.h",
1029     ]
1030     deps = [
1031       ":balsa",
1032       ":epoll_server",
1033       ":net",
1034       "//base",
1035       "//third_party/boringssl",
1036     ]
1037   }
1039   executable("flip_in_mem_edsm_server_unittests") {
1040     testonly = true
1041     sources = [
1042       "tools/flip_server/flip_test_utils.cc",
1043       "tools/flip_server/flip_test_utils.h",
1044       "tools/flip_server/http_interface_test.cc",
1045       "tools/flip_server/mem_cache_test.cc",
1046       "tools/flip_server/run_all_tests.cc",
1047       "tools/flip_server/spdy_interface_test.cc",
1048     ]
1049     deps = [
1050       ":balsa",
1051       ":flip_in_mem_edsm_server_base",
1052       ":net",
1053       ":test_support",
1054       "//testing/gtest",
1055       "//testing/gmock",
1056       "//third_party/boringssl",
1057     ]
1058   }
1060   executable("flip_in_mem_edsm_server") {
1061     testonly = true
1062     sources = [
1063       "tools/flip_server/flip_in_mem_edsm_server.cc",
1064     ]
1065     deps = [
1066       ":balsa",
1067       ":flip_in_mem_edsm_server_base",
1068       ":net",
1069       "//base",
1070     ]
1071   }
1073   source_set("quic_base") {
1074     sources = [
1075       "tools/quic/quic_client.cc",
1076       "tools/quic/quic_client.h",
1077       "tools/quic/quic_client_session.cc",
1078       "tools/quic/quic_client_session.h",
1079       "tools/quic/quic_default_packet_writer.cc",
1080       "tools/quic/quic_default_packet_writer.h",
1081       "tools/quic/quic_dispatcher.cc",
1082       "tools/quic/quic_dispatcher.h",
1083       "tools/quic/quic_epoll_clock.cc",
1084       "tools/quic/quic_epoll_clock.h",
1085       "tools/quic/quic_epoll_connection_helper.cc",
1086       "tools/quic/quic_epoll_connection_helper.h",
1087       "tools/quic/quic_in_memory_cache.cc",
1088       "tools/quic/quic_in_memory_cache.h",
1089       "tools/quic/quic_packet_writer_wrapper.cc",
1090       "tools/quic/quic_packet_writer_wrapper.h",
1091       "tools/quic/quic_per_connection_packet_writer.cc",
1092       "tools/quic/quic_per_connection_packet_writer.h",
1093       "tools/quic/quic_server.cc",
1094       "tools/quic/quic_server.h",
1095       "tools/quic/quic_server_session.cc",
1096       "tools/quic/quic_server_session.h",
1097       "tools/quic/quic_socket_utils.cc",
1098       "tools/quic/quic_socket_utils.h",
1099       "tools/quic/quic_spdy_client_stream.cc",
1100       "tools/quic/quic_spdy_client_stream.h",
1101       "tools/quic/quic_spdy_server_stream.cc",
1102       "tools/quic/quic_spdy_server_stream.h",
1103       "tools/quic/quic_time_wait_list_manager.cc",
1104       "tools/quic/quic_time_wait_list_manager.h",
1105     ]
1106     deps = [
1107       ":balsa",
1108       ":epoll_server",
1109       ":net",
1110       "//base",
1111       "//base/third_party/dynamic_annotations",
1112       "//crypto",
1113       "//third_party/boringssl",
1114       "//url",
1115     ]
1116   }
1118   executable("quic_client") {
1119     sources = [
1120       "tools/quic/quic_client_bin.cc",
1121     ]
1122     deps = [
1123       ":balsa",
1124       ":epoll_server",
1125       ":quic_base",
1126       ":net",
1127       "//base",
1128       "//third_party/boringssl",
1129     ]
1130   }
1133 if (is_android) {
1134   generate_jni("net_jni_headers") {
1135     sources = [
1136       "android/java/src/org/chromium/net/AndroidCertVerifyResult.java",
1137       "android/java/src/org/chromium/net/AndroidKeyStore.java",
1138       "android/java/src/org/chromium/net/AndroidNetworkLibrary.java",
1139       "android/java/src/org/chromium/net/AndroidPrivateKey.java",
1140       "android/java/src/org/chromium/net/GURLUtils.java",
1141       "android/java/src/org/chromium/net/NetworkChangeNotifier.java",
1142       "android/java/src/org/chromium/net/ProxyChangeListener.java",
1143       "android/java/src/org/chromium/net/X509Util.java",
1144     ]
1145     jni_package = "net"
1146   }
1147   generate_jni("net_test_jni_headers") {
1148     sources = [
1149       "android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java",
1150     ]
1151     jni_package = "net"
1152   }
1155 if (is_android || is_linux) {
1156   executable("disk_cache_memory_test") {
1157     testonly = true
1158     sources = [
1159       "tools/disk_cache_memory_test/disk_cache_memory_test.cc",
1160     ]
1161     deps = [
1162       ":net",
1163       "//base",
1164     ]
1165   }
1168 # TODO(GYP) make this compile on Android, we need some native test deps done.
1169 # TODO(GYP) Also doesn't work on Windows; dependency on boringssl is wrong.
1170 # TODO(GYP) Also doesn't work on Mac, need to figure out why not.
1171 if (!is_android && !is_win && !is_mac) {
1172   source_set("quic_tools") {
1173     sources = [
1174       "quic/quic_dispatcher.cc",
1175       "quic/quic_dispatcher.h",
1176       "quic/quic_in_memory_cache.cc",
1177       "quic/quic_in_memory_cache.h",
1178       "quic/quic_per_connection_packet_writer.cc",
1179       "quic/quic_per_connection_packet_writer.h",
1180       "quic/quic_server.cc",
1181       "quic/quic_server.h",
1182       "quic/quic_server_packet_writer.cc",
1183       "quic/quic_server_packet_writer.h",
1184       "quic/quic_server_session.cc",
1185       "quic/quic_server_session.h",
1186       "quic/quic_spdy_server_stream.cc",
1187       "quic/quic_spdy_server_stream.h",
1188       "quic/quic_time_wait_list_manager.cc",
1189       "quic/quic_time_wait_list_manager.h",
1190     ]
1191     deps = [
1192       ":net",
1193       "//base",
1194       "//base/third_party/dynamic_annotations",
1195       "//url",
1196     ]
1197   }
1199   test("net_unittests") {
1200     sources = gypi_values.net_test_sources
1202     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1203     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1204     defines = []
1206     deps = [
1207       ":extras",
1208       ":http_server",
1209       ":net",
1210       ":quic_tools",
1211       ":test_support",
1212       "//base",
1213       "//base:i18n",
1214       "//base:prefs_test_support",
1215       "//base/allocator",
1216       "//base/third_party/dynamic_annotations",
1217       "//crypto",
1218       "//crypto:platform",
1219       "//crypto:test_support",
1220       "//gin",
1221       "//net/base/registry_controlled_domains",
1222       "//sql",
1223       "//testing/gmock",
1224       "//testing/gtest",
1225       "//third_party/zlib",
1226       "//url",
1227     ]
1229     if (is_linux) {
1230       sources += gypi_values.net_linux_test_sources
1231       deps += [
1232         ":balsa",
1233         ":epoll_server",
1234         ":flip_in_mem_edsm_server_base",
1235         ":quic_base",
1236       ]
1237     }
1239     if (is_mac || is_ios) {
1240       sources += gypi_values.net_base_test_mac_ios_sources
1241     }
1243     if (is_chromeos) {
1244       sources -= [ "proxy/proxy_config_service_linux_unittest.cc" ]
1245     }
1247     if (is_android) {
1248       sources -= [
1249         # See bug http://crbug.com/344533.
1250         "disk_cache/blockfile/index_table_v3_unittest.cc",
1252         # No res_ninit() et al on Android, so this doesn't make a lot of
1253         # sense.
1254         "dns/dns_config_service_posix_unittest.cc",
1255       ]
1256       deps += [
1257         ":net_javatests",  # FIXME(brettw)
1258         ":net_test_jni_headers",
1259       ]
1260     }
1262     if (v8_use_external_startup_data) {
1263       deps += [ "//gin" ]
1264     }
1266     if (!use_nss_certs) {
1267       sources -= [ "ssl/client_cert_store_nss_unittest.cc" ]
1268       if (is_chromeos) {  # Already removed for all non-ChromeOS builds.
1269         sources -= [ "ssl/client_cert_store_chromeos_unittest.cc" ]
1270       }
1271     }
1273     if (use_openssl) {
1274       # When building for OpenSSL, we need to exclude NSS specific tests
1275       # or functionality not supported by OpenSSL yet.
1276       # TODO(bulach): Add equivalent tests when the underlying
1277       #               functionality is ported to OpenSSL.
1278       sources -= [
1279         "cert/nss_cert_database_unittest.cc",
1280         "cert/x509_util_nss_unittest.cc",
1281         "quic/test_tools/crypto_test_utils_nss.cc",
1282       ]
1283       if (is_chromeos) {
1284         # These were already removed in the non-ChromeOS case.
1285         sources -= [
1286           "cert/nss_cert_database_chromeos_unittest.cc",
1287           "cert/nss_profile_filter_chromeos_unittest.cc",
1288         ]
1289       }
1290     } else {
1291       sources -= [
1292         "cert/x509_util_openssl_unittest.cc",
1293         "quic/test_tools/crypto_test_utils_openssl.cc",
1294         "socket/ssl_client_socket_openssl_unittest.cc",
1295         "socket/ssl_session_cache_openssl_unittest.cc",
1296       ]
1297       if (!is_desktop_linux && !is_chromeos) {
1298         sources -= [ "cert/nss_cert_database_unittest.cc" ]
1299       }
1300     }
1302     if (use_kerberos) {
1303       defines += [ "USE_KERBEROS" ]
1304     } else {
1305       sources -= [
1306         "http/http_auth_gssapi_posix_unittest.cc",
1307         "http/http_auth_handler_negotiate_unittest.cc",
1308         "http/mock_gssapi_library_posix.cc",
1309         "http/mock_gssapi_library_posix.h",
1310       ]
1311     }
1313     if (use_openssl || (!is_desktop_linux && !is_chromeos && !is_ios)) {
1314       # Only include this test when on Posix and using NSS for
1315       # cert verification or on iOS (which also uses NSS for certs).
1316       sources -= [ "ocsp/nss_ocsp_unittest.cc" ]
1317     }
1319     if (!use_openssl_certs) {
1320       sources -= [ "ssl/openssl_client_key_store_unittest.cc" ]
1321     }
1323     if (!enable_websockets) {
1324       sources -= [
1325         "server/http_connection_unittest.cc",
1326         "server/http_server_response_info_unittest.cc",
1327         "server/http_server_unittest.cc",
1328         "server/web_socket_encoder_unittest.cc",
1329         "websockets/websocket_basic_stream_test.cc",
1330         "websockets/websocket_channel_test.cc",
1331         "websockets/websocket_deflate_predictor_impl_test.cc",
1332         "websockets/websocket_deflate_stream_test.cc",
1333         "websockets/websocket_deflater_test.cc",
1334         "websockets/websocket_end_to_end_test.cc",
1335         "websockets/websocket_errors_test.cc",
1336         "websockets/websocket_extension_parser_test.cc",
1337         "websockets/websocket_frame_parser_test.cc",
1338         "websockets/websocket_frame_test.cc",
1339         "websockets/websocket_handshake_challenge_test.cc",
1340         "websockets/websocket_handshake_stream_create_helper_test.cc",
1341         "websockets/websocket_inflater_test.cc",
1342         "websockets/websocket_stream_test.cc",
1343         "websockets/websocket_test_util.cc",
1344         "websockets/websocket_test_util.h",
1345       ]
1346       deps -= [ ":http_server" ]
1347     }
1349     if (disable_file_support) {
1350       sources -= [
1351         "base/directory_lister_unittest.cc",
1352         "url_request/url_request_file_job_unittest.cc",
1353       ]
1354     }
1356     if (disable_ftp_support) {
1357       sources -= [
1358         "ftp/ftp_auth_cache_unittest.cc",
1359         "ftp/ftp_ctrl_response_buffer_unittest.cc",
1360         "ftp/ftp_directory_listing_parser_ls_unittest.cc",
1361         "ftp/ftp_directory_listing_parser_netware_unittest.cc",
1362         "ftp/ftp_directory_listing_parser_os2_unittest.cc",
1363         "ftp/ftp_directory_listing_parser_unittest.cc",
1364         "ftp/ftp_directory_listing_parser_unittest.h",
1365         "ftp/ftp_directory_listing_parser_vms_unittest.cc",
1366         "ftp/ftp_directory_listing_parser_windows_unittest.cc",
1367         "ftp/ftp_network_transaction_unittest.cc",
1368         "ftp/ftp_util_unittest.cc",
1369         "url_request/url_request_ftp_job_unittest.cc",
1370       ]
1371     }
1373     if (!enable_built_in_dns) {
1374       sources -= [
1375         "dns/address_sorter_posix_unittest.cc",
1376         "dns/address_sorter_unittest.cc",
1377       ]
1378     }
1380     # Always need use_v8_in_net to be 1 to run on Android, so just remove
1381     # net_unittest's dependency on v8 when using icu alternatives instead of
1382     # setting use_v8_in_net to 0.
1383     if (use_v8_in_net && !use_icu_alternatives_on_android) {
1384       deps += [ ":net_with_v8" ]
1385     } else {
1386       sources -= [
1387         "proxy/proxy_resolver_v8_tracing_unittest.cc",
1388         "proxy/proxy_resolver_v8_unittest.cc",
1389       ]
1390     }
1392     if (use_v8_in_net && !is_android) {
1393       deps += [
1394         ":net_browser_services",
1395         ":net_utility_services",
1396         "//mojo/environment:chromium",
1397         "//third_party/mojo/src/mojo/edk/system",
1398       ]
1399     } else {
1400       sources -= [
1401         "dns/host_resolver_mojo_unittest.cc",
1402         "dns/mojo_host_resolver_impl_unittest.cc",
1403         "proxy/mojo_proxy_resolver_factory_impl_unittest.cc",
1404         "proxy/mojo_proxy_resolver_impl_unittest.cc",
1405       ]
1406     }
1408     if (!enable_mdns) {
1409       sources -= [
1410         "dns/mdns_cache_unittest.cc",
1411         "dns/mdns_client_unittest.cc",
1412         "dns/record_parsed_unittest.cc",
1413         "dns/record_rdata_unittest.cc",
1414       ]
1415     }
1417     if (is_ios) {
1418       # TODO(GYP)
1419       #  'actions': [
1420       #    {
1421       #      'action_name': 'copy_test_data',
1422       #      'variables': {
1423       #        'test_data_files': [
1424       #          'data/ssl/certificates/',
1425       #          'data/test.html',
1426       #          'data/url_request_unittest/',
1427       #        ],
1428       #        'test_data_prefix': 'net',
1429       #      },
1430       #      'includes': [ '../build/copy_test_data_ios.gypi' ],
1431       #    },
1432       #  ],
1433       sources -= [
1434         # TODO(droger): The following tests are disabled because the
1435         # implementation is missing or incomplete.
1436         # KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS.
1437         "base/keygen_handler_unittest.cc",
1438         "disk_cache/backend_unittest.cc",
1439         "disk_cache/blockfile/block_files_unittest.cc",
1441         # Need to read input data files.
1442         "filter/gzip_filter_unittest.cc",
1443         "socket/ssl_server_socket_unittest.cc",
1444         "spdy/fuzzing/hpack_fuzz_util_test.cc",
1446         # Need TestServer.
1447         "proxy/proxy_script_fetcher_impl_unittest.cc",
1448         "socket/ssl_client_socket_unittest.cc",
1449         "url_request/url_fetcher_impl_unittest.cc",
1450         "url_request/url_request_context_builder_unittest.cc",
1452         # Needs GetAppOutput().
1453         "test/python_utils_unittest.cc",
1455         # The following tests are disabled because they don't apply to
1456         # iOS.
1457         # OS is not "linux" or "freebsd" or "openbsd".
1458         "socket/unix_domain_client_socket_posix_unittest.cc",
1459         "socket/unix_domain_listen_socket_posix_unittest.cc",
1460         "socket/unix_domain_server_socket_posix_unittest.cc",
1462         # See bug http://crbug.com/344533.
1463         "disk_cache/blockfile/index_table_v3_unittest.cc",
1464       ]
1465     }
1467     if (is_android) {
1468       sources -= [ "dns/dns_config_service_posix_unittest.cc" ]
1470       # TODO(GYP)
1471       # # TODO(mmenke):  This depends on test_support_base, which depends on
1472       # #                icu.  Figure out a way to remove that dependency.
1473       # 'dependencies': [
1474       #   '../testing/android/native_test.gyp:native_test_native_code',
1475       # ]
1477       set_sources_assignment_filter([])
1478       sources += [ "base/address_tracker_linux_unittest.cc" ]
1479       set_sources_assignment_filter(sources_assignment_filter)
1480     }
1482     if (use_icu_alternatives_on_android) {
1483       sources -= [
1484         "base/filename_util_unittest.cc",
1485         "base/net_util_icu_unittest.cc",
1486       ]
1487       deps -= [ "//base:i18n" ]
1488     }
1489   }
1491   executable("quic_server") {
1492     sources = [
1493       "quic/quic_server_bin.cc",
1494     ]
1495     deps = [
1496       ":quic_tools",
1497       ":net",
1498       "//base",
1499       "//third_party/boringssl",
1500     ]
1501   }
1502 }  # !is_android && !is_win && !is_mac