blob: b17c8ad9e5e8b6a69070a60a17464707549febc3 [file] [log] [blame]
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/buildflag_header.gni")
import("//build/config/chromecast_build.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/crypto.gni")
import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//build_overrides/v8.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni")
import("//third_party/icu/config.gni")
import("//third_party/protobuf/proto_library.gni")
import("//tools/grit/grit_rule.gni")
import("//url/features.gni")
if (is_android) {
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
} else if (is_mac) {
import("//build/config/mac/mac_sdk.gni")
}
# The list of net files is kept in net.gypi. Read it.
gypi_values = exec_script("//build/gypi_to_gn.py",
[ rebase_path("net.gypi") ],
"scope",
[ "net.gypi" ])
# The way the cache uses mmap() is inefficient on some Android devices. If
# this flag is set, we hackily avoid using mmap() in the disk cache. We are
# pretty confident that mmap-ing the index would not hurt any existing x86
# android devices, but we cannot be so sure about the variety of ARM devices.
# So enable it for x86 only for now.
posix_avoid_mmap = is_android && current_cpu != "x86"
use_v8_in_net = !is_ios
enable_built_in_dns = !is_ios
declare_args() {
# Disables support for file URLs. File URL support requires use of icu.
disable_file_support = false
# WebSockets and socket stream code are not used on iOS and are optional in
# cronet.
enable_websockets = !is_ios
disable_ftp_support = is_ios || is_chromecast
# Enable Kerberos authentication. It is disabled by default on ChromeOS, iOS,
# Chromecast, at least for now. This feature needs configuration (krb5.conf
# and so on).
use_kerberos = !is_chromeos && !is_ios && !is_chromecast
# Do not disable brotli filter by default.
disable_brotli_filter = false
}
config("net_config") {
defines = []
if (posix_avoid_mmap) {
defines += [ "POSIX_AVOID_MMAP" ]
}
if (disable_file_support) {
defines += [ "DISABLE_FILE_SUPPORT" ]
}
if (disable_ftp_support) {
defines += [ "DISABLE_FTP_SUPPORT=1" ]
}
if (enable_websockets) {
defines += [ "ENABLE_WEBSOCKETS" ]
}
}
config("net_internal_config") {
defines = [
"DLOPEN_KERBEROS",
"NET_IMPLEMENTATION",
]
if (use_kerberos) {
defines += [ "USE_KERBEROS" ]
if (is_android) {
include_dirs = [ "/usr/include/kerberosV" ]
}
}
if (enable_built_in_dns) {
defines += [ "ENABLE_BUILT_IN_DNS" ]
}
}
net_configs = [
":net_internal_config",
"//build/config:precompiled_headers",
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
"//build/config/compiler:no_size_t_to_int_warning",
"//build/config/compiler:wexit_time_destructors",
]
if (use_glib && use_gconf && !is_chromeos) {
net_configs += [ "//build/config/linux/gconf" ]
}
if (is_linux) {
net_configs += [ "//build/config/linux:libresolv" ]
}
component("net") {
sources = gypi_values.net_nacl_common_sources
net_unfiltered_sources = []
deps = [
":net_resources",
"//base",
"//net/base/registry_controlled_domains",
"//third_party/protobuf:protobuf_lite",
"//url:url_features",
]
public_deps = [
":net_quic_proto",
"//crypto",
"//crypto:platform",
]
if (!is_nacl) {
sources += gypi_values.net_non_nacl_sources
deps += [
"//base/third_party/dynamic_annotations",
"//components/prefs",
"//sdch",
"//third_party/zlib",
]
if (!use_kerberos) {
sources -= [
"http/http_auth_handler_negotiate.cc",
"http/http_auth_handler_negotiate.h",
]
}
if (is_posix) {
if (posix_avoid_mmap) {
sources -= [ "disk_cache/blockfile/mapped_file_posix.cc" ]
} else {
sources -= [ "disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc" ]
}
}
if (!enable_built_in_dns) {
sources -= [
"dns/address_sorter_posix.cc",
"dns/address_sorter_posix.h",
"dns/dns_client.cc",
]
}
if (!use_openssl_certs) {
sources -= [
"base/crypto_module_openssl.cc",
"base/keygen_handler_openssl.cc",
"base/openssl_private_key_store.h",
"base/openssl_private_key_store_memory.cc",
"cert/cert_database_openssl.cc",
"cert/cert_verify_proc_openssl.cc",
"cert/cert_verify_proc_openssl.h",
"cert/test_root_certs_openssl.cc",
"cert/x509_certificate_openssl.cc",
"ssl/openssl_client_key_store.cc",
"ssl/openssl_client_key_store.h",
]
if (is_android) {
sources -= [ "base/openssl_private_key_store_android.cc" ]
}
} else {
if (is_android) {
# Android doesn't use these even when using OpenSSL.
sources -= [
"base/openssl_private_key_store_memory.cc",
"cert/cert_database_openssl.cc",
"cert/cert_verify_proc_openssl.cc",
"cert/test_root_certs_openssl.cc",
]
}
}
if (!use_kerberos || is_android) {
sources -= [
"http/http_auth_gssapi_posix.cc",
"http/http_auth_gssapi_posix.h",
]
}
if (use_glib && use_gconf && !is_chromeos) {
deps += [ "//build/linux/libgio" ]
}
if (!use_nss_certs) {
sources -= [
"base/crypto_module_nss.cc",
"base/keygen_handler_nss.cc",
"cert/cert_database_nss.cc",
"cert/nss_cert_database.cc",
"cert/nss_cert_database.h",
"cert/x509_certificate_nss.cc",
"ssl/client_cert_store_nss.cc",
"ssl/client_cert_store_nss.h",
"third_party/mozilla_security_manager/nsKeygenHandler.cpp",
"third_party/mozilla_security_manager/nsKeygenHandler.h",
"third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
"third_party/mozilla_security_manager/nsNSSCertificateDB.h",
"third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
"third_party/mozilla_security_manager/nsPKCS12Blob.h",
]
if (is_chromeos) {
# These were already removed on non-ChromeOS.
sources -= [
"cert/nss_cert_database_chromeos.cc",
"cert/nss_cert_database_chromeos.h",
"cert/nss_profile_filter_chromeos.cc",
"cert/nss_profile_filter_chromeos.h",
]
}
sources -= [
"ssl/client_key_store.cc",
"ssl/client_key_store.h",
"ssl/ssl_platform_key_nss.cc",
]
} else {
# client_cert_store_nss.c requires NSS_CmpCertChainWCANames from NSS's
# libssl, but our bundled copy is not built in OpenSSL ports. Pull that
# file in directly.
sources += [ "third_party/nss/ssl/cmpcert.c" ]
}
if (!use_nss_certs) {
# These files are part of the partial implementation of NSS for
# cert verification, so keep them in that case.
sources -= [
"cert/cert_verify_proc_nss.cc",
"cert/cert_verify_proc_nss.h",
"cert/test_root_certs_nss.cc",
"cert/x509_util_nss.cc",
"cert_net/nss_ocsp.cc",
"cert_net/nss_ocsp.h",
]
}
if (is_chromecast && use_nss_certs) {
sources += [ "ssl/ssl_platform_key_chromecast.cc" ]
sources -= [ "ssl/ssl_platform_key_nss.cc" ]
}
if (!enable_mdns) {
sources -= [
"dns/mdns_cache.cc",
"dns/mdns_cache.h",
"dns/mdns_client.cc",
"dns/mdns_client.h",
"dns/mdns_client_impl.cc",
"dns/mdns_client_impl.h",
"dns/record_parsed.cc",
"dns/record_parsed.h",
"dns/record_rdata.cc",
"dns/record_rdata.h",
]
}
if (is_win) {
sources -= [ "http/http_auth_handler_ntlm_portable.cc" ]
} else { # !is_win
sources -= [
"base/winsock_init.cc",
"base/winsock_init.h",
"base/winsock_util.cc",
"base/winsock_util.h",
"proxy/proxy_resolver_winhttp.cc",
"proxy/proxy_resolver_winhttp.h",
]
}
if (is_ios) {
# Add back some sources that were otherwise filtered out.
# iOS needs some Mac files.
net_unfiltered_sources += [
"base/mac/url_conversions.h",
"base/mac/url_conversions.mm",
"base/network_change_notifier_mac.cc",
"base/network_config_watcher_mac.cc",
"base/network_interfaces_mac.cc",
"base/network_interfaces_mac.h",
"base/platform_mime_util_mac.mm",
"cert/test_root_certs_mac.cc",
"proxy/proxy_resolver_mac.cc",
"proxy/proxy_server_mac.cc",
]
sources -= [ "disk_cache/blockfile/file_posix.cc" ]
}
if (is_ios || is_mac) {
sources += gypi_values.net_base_mac_ios_sources
}
if (is_android) {
deps += [ ":net_jni_headers" ]
# Add some Linux sources that were excluded by the filter, but which
# are needed.
net_unfiltered_sources += [
"base/address_tracker_linux.cc",
"base/address_tracker_linux.h",
"base/network_interfaces_linux.cc",
"base/network_interfaces_linux.h",
"base/platform_mime_util_linux.cc",
]
}
} else {
public_deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
}
# Add back some sources that were otherwise filtered out.
set_sources_assignment_filter([])
sources += net_unfiltered_sources
set_sources_assignment_filter(sources_assignment_filter)
cflags = []
configs += net_configs
public_configs = [ ":net_config" ]
public_deps += [ "//url" ]
if (is_mac) {
libs = [
"CFNetwork.framework",
"CoreServices.framework",
"Foundation.framework",
"Security.framework",
"SystemConfiguration.framework",
"resolv",
]
}
if (is_ios) {
libs = [
"CFNetwork.framework",
"MobileCoreServices.framework",
"Security.framework",
"SystemConfiguration.framework",
"resolv",
]
}
if (is_win) {
libs = [
"crypt32.lib",
"dhcpcsvc.lib",
"iphlpapi.lib",
"rpcrt4.lib",
"secur32.lib",
"urlmon.lib",
"winhttp.lib",
]
}
if (!is_nacl) {
if (!disable_file_support) {
sources += gypi_values.net_file_support_sources
}
if (!disable_ftp_support) {
sources += gypi_values.net_ftp_support_sources
}
if (enable_websockets) {
sources += gypi_values.net_websockets_sources
}
# ICU support.
if (use_platform_icu_alternatives) {
if (is_android) {
# Use ICU alternative on Android.
sources += [
"base/net_string_util_icu_alternatives_android.cc",
"base/net_string_util_icu_alternatives_android.h",
]
deps += [ ":net_jni_headers" ]
} else if (is_ios) {
# Use ICU alternative on iOS.
sources += [ "base/net_string_util_icu_alternatives_ios.mm" ]
} else {
assert(false,
"ICU alternative is not implemented for platform: " + target_os)
}
} else {
# Use ICU.
deps += [
"//base:i18n",
"//third_party/icu",
]
sources += [
"base/filename_util_icu.cc",
"base/net_string_util_icu.cc",
]
}
# Brotli support.
if (!disable_brotli_filter) {
sources += [ "filter/brotli_filter.cc" ]
deps += [ "//third_party/brotli" ]
} else {
sources += [ "filter/brotli_filter_disabled.cc" ]
}
}
}
grit("net_resources") {
source = "base/net_resources.grd"
use_qualified_include = true
outputs = [
"grit/net_resources.h",
"net_resources.pak",
]
}
proto_library("net_quic_proto") {
visibility = [ ":net" ]
sources = [
"quic/proto/cached_network_parameters.proto",
"quic/proto/source_address_token.proto",
]
cc_generator_options = "dllexport_decl=NET_EXPORT_PRIVATE:"
cc_include = "net/base/net_export.h"
component_build_force_source_set = true
defines = [ "NET_IMPLEMENTATION" ]
extra_configs = [ "//build/config/compiler:wexit_time_destructors" ]
}
static_library("extras") {
sources = gypi_values.net_extras_sources
configs += [ "//build/config/compiler:wexit_time_destructors" ]
deps = [
":net",
"//base",
"//sql:sql",
]
}
static_library("http_server") {
sources = [
"server/http_connection.cc",
"server/http_connection.h",
"server/http_server.cc",
"server/http_server.h",
"server/http_server_request_info.cc",
"server/http_server_request_info.h",
"server/http_server_response_info.cc",
"server/http_server_response_info.h",
"server/web_socket.cc",
"server/web_socket.h",
"server/web_socket_encoder.cc",
"server/web_socket_encoder.h",
]
configs += [
"//build/config/compiler:no_size_t_to_int_warning",
"//build/config/compiler:wexit_time_destructors",
]
deps = [
":net",
"//base",
]
}
if (!is_ios) {
executable("dump_cache") {
testonly = true
sources = [
"tools/dump_cache/dump_cache.cc",
"tools/dump_cache/dump_files.cc",
"tools/dump_cache/dump_files.h",
]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
":net",
":test_support",
"//base",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
]
}
}
bundle_data("test_support_bundle_data") {
visibility = [ ":test_support" ]
testonly = true
sources = gypi_values.net_test_support_data_sources
outputs = [
"{{bundle_resources_dir}}/" +
"{{source_root_relative_dir}}/{{source_file_part}}",
]
}
source_set("test_support") {
testonly = true
sources = [
"base/load_timing_info_test_util.cc",
"base/load_timing_info_test_util.h",
"base/mock_file_stream.cc",
"base/mock_file_stream.h",
"base/test_completion_callback.cc",
"base/test_completion_callback.h",
"cert/mock_cert_verifier.cc",
"cert/mock_cert_verifier.h",
"cert/mock_client_cert_verifier.cc",
"cert/mock_client_cert_verifier.h",
"cookies/cookie_monster_store_test.cc",
"cookies/cookie_monster_store_test.h",
"cookies/cookie_store_test_callbacks.cc",
"cookies/cookie_store_test_callbacks.h",
"cookies/cookie_store_test_helpers.cc",
"cookies/cookie_store_test_helpers.h",
"cookies/cookie_store_unittest.h",
"disk_cache/disk_cache_test_base.cc",
"disk_cache/disk_cache_test_base.h",
"disk_cache/disk_cache_test_util.cc",
"disk_cache/disk_cache_test_util.h",
"dns/dns_test_util.cc",
"dns/dns_test_util.h",
"dns/mock_host_resolver.cc",
"dns/mock_host_resolver.h",
"dns/mock_mdns_socket_factory.cc",
"dns/mock_mdns_socket_factory.h",
"http/http_stream_factory_test_util.cc",
"http/http_stream_factory_test_util.h",
"http/http_transaction_test_util.cc",
"http/http_transaction_test_util.h",
"log/test_net_log.cc",
"log/test_net_log.h",
"log/test_net_log_entry.cc",
"log/test_net_log_entry.h",
"log/test_net_log_util.cc",
"log/test_net_log_util.h",
"proxy/mock_proxy_resolver.cc",
"proxy/mock_proxy_resolver.h",
"proxy/mock_proxy_script_fetcher.cc",
"proxy/mock_proxy_script_fetcher.h",
"proxy/proxy_config_service_common_unittest.cc",
"proxy/proxy_config_service_common_unittest.h",
"socket/socket_test_util.cc",
"socket/socket_test_util.h",
"test/cert_test_util.cc",
"test/cert_test_util.h",
"test/cert_test_util_nss.cc",
"test/channel_id_test_util.cc",
"test/channel_id_test_util.h",
"test/ct_test_util.cc",
"test/ct_test_util.h",
"test/embedded_test_server/default_handlers.cc",
"test/embedded_test_server/default_handlers.h",
"test/embedded_test_server/embedded_test_server.cc",
"test/embedded_test_server/embedded_test_server.h",
"test/embedded_test_server/http_connection.cc",
"test/embedded_test_server/http_connection.h",
"test/embedded_test_server/http_request.cc",
"test/embedded_test_server/http_request.h",
"test/embedded_test_server/http_response.cc",
"test/embedded_test_server/http_response.h",
"test/embedded_test_server/request_handler_util.cc",
"test/embedded_test_server/request_handler_util.h",
"test/event_waiter.h",
"test/gtest_util.h",
"test/net_test_suite.cc",
"test/net_test_suite.h",
"test/python_utils.cc",
"test/python_utils.h",
"test/scoped_disable_exit_on_dfatal.cc",
"test/scoped_disable_exit_on_dfatal.h",
"test/test_certificate_data.h",
"test/test_data_directory.cc",
"test/test_data_directory.h",
"test/url_request/ssl_certificate_error_job.cc",
"test/url_request/ssl_certificate_error_job.h",
"test/url_request/url_request_failed_job.cc",
"test/url_request/url_request_failed_job.h",
"test/url_request/url_request_hanging_read_job.cc",
"test/url_request/url_request_hanging_read_job.h",
"test/url_request/url_request_mock_data_job.cc",
"test/url_request/url_request_mock_data_job.h",
"test/url_request/url_request_slow_download_job.cc",
"test/url_request/url_request_slow_download_job.h",
"url_request/test_url_fetcher_factory.cc",
"url_request/test_url_fetcher_factory.h",
"url_request/url_request_test_util.cc",
"url_request/url_request_test_util.h",
]
if (!is_ios) {
sources += [
"test/spawned_test_server/base_test_server.cc",
"test/spawned_test_server/base_test_server.h",
"test/spawned_test_server/local_test_server.cc",
"test/spawned_test_server/local_test_server.h",
"test/spawned_test_server/local_test_server_posix.cc",
"test/spawned_test_server/local_test_server_win.cc",
"test/spawned_test_server/spawned_test_server.h",
]
}
configs += [
"//build/config:precompiled_headers",
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
"//build/config/compiler:no_size_t_to_int_warning",
]
public_deps = [
"//base",
"//base/test:test_support",
"//crypto",
"//net",
"//net/tools/tld_cleanup",
"//testing/gmock",
"//testing/gtest",
"//url",
]
deps = [
":test_support_bundle_data",
]
data = [
"data/",
]
if (!is_ios) {
public_deps += [ "//third_party/protobuf:py_proto" ]
}
if (use_nss_certs) {
public_deps += [ "//crypto:platform" ]
}
if (is_android) {
sources += [
"test/spawned_test_server/remote_test_server.cc",
"test/spawned_test_server/remote_test_server.h",
"test/spawned_test_server/spawner_communicator.cc",
"test/spawned_test_server/spawner_communicator.h",
]
}
if (use_v8_in_net) {
public_deps += [ ":net_with_v8" ]
}
if (!enable_mdns) {
sources -= [
"dns/mock_mdns_socket_factory.cc",
"dns/mock_mdns_socket_factory.h",
]
}
if (!use_nss_certs) {
sources -= [ "test/cert_test_util_nss.cc" ]
}
if (!disable_file_support) {
sources += [
"test/url_request/url_request_mock_http_job.cc",
"test/url_request/url_request_mock_http_job.h",
"url_request/test_url_request_interceptor.cc",
"url_request/test_url_request_interceptor.h",
]
}
}
source_set("balsa") {
sources = [
"tools/balsa/balsa_enums.h",
"tools/balsa/balsa_frame.cc",
"tools/balsa/balsa_frame.h",
"tools/balsa/balsa_headers.cc",
"tools/balsa/balsa_headers.h",
"tools/balsa/balsa_headers_token_utils.cc",
"tools/balsa/balsa_headers_token_utils.h",
"tools/balsa/balsa_visitor_interface.h",
"tools/balsa/http_message_constants.cc",
"tools/balsa/http_message_constants.h",
"tools/balsa/noop_balsa_visitor.h",
"tools/balsa/simple_buffer.cc",
"tools/balsa/simple_buffer.h",
"tools/balsa/string_piece_utils.h",
"tools/quic/spdy_balsa_utils.cc",
"tools/quic/spdy_balsa_utils.h",
]
deps = [
":net",
"//base",
"//url",
]
}
if (use_v8_in_net) {
component("net_with_v8") {
sources = [
"proxy/proxy_resolver_v8.cc",
"proxy/proxy_resolver_v8.h",
"proxy/proxy_resolver_v8_tracing.cc",
"proxy/proxy_resolver_v8_tracing.h",
"proxy/proxy_resolver_v8_tracing_wrapper.cc",
"proxy/proxy_resolver_v8_tracing_wrapper.h",
"proxy/proxy_service_v8.cc",
"proxy/proxy_service_v8.h",
]
defines = [ "NET_IMPLEMENTATION" ]
configs += [
"//build/config/compiler:no_size_t_to_int_warning",
"//build/config/compiler:wexit_time_destructors",
"//v8:external_startup_data",
]
public_deps = [
":net",
]
deps = [
"//base",
"//gin",
"//url",
"//v8",
]
}
}
if (use_v8_in_net && !is_android) {
source_set("net_browser_services") {
sources = [
"dns/mojo_host_resolver_impl.cc",
"dns/mojo_host_resolver_impl.h",
"proxy/in_process_mojo_proxy_resolver_factory.cc",
"proxy/in_process_mojo_proxy_resolver_factory.h",
"proxy/mojo_proxy_resolver_factory.h",
"proxy/proxy_resolver_factory_mojo.cc",
"proxy/proxy_resolver_factory_mojo.h",
"proxy/proxy_service_mojo.cc",
"proxy/proxy_service_mojo.h",
]
public_deps = [
":mojo_type_converters",
":net_with_v8",
"//base",
"//mojo/common",
"//mojo/public/cpp/bindings",
"//net/interfaces",
# NOTE(amistry): As long as we support in-process Mojo v8 PAC, we need
# this dependency since in_process_mojo_proxy_resolver_factory creates
# the utility process side Mojo services in the browser process.
# Ultimately, this will go away when we only support out-of-process.
":net_utility_services",
]
}
source_set("mojo_type_converters") {
sources = [
"dns/mojo_host_type_converters.cc",
"dns/mojo_host_type_converters.h",
"proxy/mojo_proxy_type_converters.cc",
"proxy/mojo_proxy_type_converters.h",
]
public_deps = [
":net",
"//base",
"//mojo/public/cpp/bindings",
"//net/interfaces",
]
}
source_set("net_utility_services") {
sources = [
"dns/host_resolver_mojo.cc",
"dns/host_resolver_mojo.h",
"proxy/mojo_proxy_resolver_factory_impl.cc",
"proxy/mojo_proxy_resolver_factory_impl.h",
"proxy/mojo_proxy_resolver_impl.cc",
"proxy/mojo_proxy_resolver_impl.h",
"proxy/mojo_proxy_resolver_v8_tracing_bindings.h",
]
deps = [
":net_with_v8",
"//base",
]
public_deps = [
":mojo_type_converters",
":net",
"//mojo/common",
"//mojo/public/cpp/bindings",
"//net/interfaces",
]
}
}
if (!is_ios && !is_android) {
executable("cert_verify_tool") {
testonly = true
sources = [
"tools/cert_verify_tool/cert_verify_tool.cc",
"tools/cert_verify_tool/cert_verify_tool_util.cc",
"tools/cert_verify_tool/cert_verify_tool_util.h",
"tools/cert_verify_tool/verify_using_cert_verify_proc.cc",
"tools/cert_verify_tool/verify_using_cert_verify_proc.h",
]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
":net",
":test_support",
"//base",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
]
}
executable("crash_cache") {
testonly = true
sources = [
"tools/crash_cache/crash_cache.cc",
]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
":net",
":test_support",
"//base",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
]
}
executable("crl_set_dump") {
testonly = true
sources = [
"tools/crl_set_dump/crl_set_dump.cc",
]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
":net",
"//base",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
]
}
executable("dns_fuzz_stub") {
testonly = true
sources = [
"tools/dns_fuzz_stub/dns_fuzz_stub.cc",
]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
":net",
"//base",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
]
}
executable("gdig") {
testonly = true
sources = [
"tools/gdig/file_net_log.cc",
"tools/gdig/gdig.cc",
]
deps = [
":net",
"//base",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
]
}
executable("get_server_time") {
testonly = true
sources = [
"tools/get_server_time/get_server_time.cc",
]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
":net",
"//base",
"//base:i18n",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
"//url",
]
}
executable("hpack_example_generator") {
testonly = true
sources = [
"spdy/fuzzing/hpack_example_generator.cc",
]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
":net",
"//base",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
]
}
executable("hpack_fuzz_mutator") {
testonly = true
sources = [
"spdy/fuzzing/hpack_fuzz_mutator.cc",
]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
":net",
"//base",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
]
}
executable("hpack_fuzz_wrapper") {
testonly = true
sources = [
"spdy/fuzzing/hpack_fuzz_wrapper.cc",
]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
":net",
"//base",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
]
}
if (use_v8_in_net) {
executable("net_watcher") {
testonly = true
sources = [
"tools/net_watcher/net_watcher.cc",
]
deps = [
":net",
":net_with_v8",
"//base",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
]
if (is_desktop_linux && use_gconf && use_glib) {
configs += [
"//build/config/linux/gconf",
"//build/config/linux:glib",
]
deps += [ "//build/linux/libgio" ]
}
}
}
executable("run_testserver") {
testonly = true
sources = [
"tools/testserver/run_testserver.cc",
]
deps = [
":test_support",
"//base",
"//base/test:test_support",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
"//testing/gtest",
]
}
executable("stress_cache") {
testonly = true
sources = [
"tools/stress_cache/stress_cache.cc",
]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
":net",
":test_support",
"//base",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
]
}
executable("tld_cleanup") {
sources = [
"tools/tld_cleanup/tld_cleanup.cc",
]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
"//base",
"//base:i18n",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
"//net/tools/tld_cleanup",
]
}
}
if (is_linux || is_mac) {
executable("cachetool") {
testonly = true
sources = [
"tools/cachetool/cachetool.cc",
]
deps = [
":net",
":test_support",
"//base",
]
}
executable("content_decoder_tool") {
testonly = true
sources = [
"filter/mock_filter_context.cc",
"filter/mock_filter_context.h",
"tools/content_decoder_tool/content_decoder_tool.cc",
]
deps = [
":net",
":test_support",
"//base",
"//url",
]
}
}
if (is_linux) {
static_library("epoll_server") {
sources = [
"tools/epoll_server/epoll_server.cc",
"tools/epoll_server/epoll_server.h",
]
deps = [
":net",
"//base",
]
}
static_library("flip_in_mem_edsm_server_base") {
testonly = true
sources = [
"tools/flip_server/acceptor_thread.cc",
"tools/flip_server/acceptor_thread.h",
"tools/flip_server/constants.h",
"tools/flip_server/flip_config.cc",
"tools/flip_server/flip_config.h",
"tools/flip_server/http_interface.cc",
"tools/flip_server/http_interface.h",
"tools/flip_server/mem_cache.cc",
"tools/flip_server/mem_cache.h",
"tools/flip_server/output_ordering.cc",
"tools/flip_server/output_ordering.h",
"tools/flip_server/ring_buffer.cc",
"tools/flip_server/ring_buffer.h",
"tools/flip_server/sm_connection.cc",
"tools/flip_server/sm_connection.h",
"tools/flip_server/sm_interface.h",
"tools/flip_server/spdy_interface.cc",
"tools/flip_server/spdy_interface.h",
"tools/flip_server/spdy_ssl.cc",
"tools/flip_server/spdy_ssl.h",
"tools/flip_server/spdy_util.cc",
"tools/flip_server/spdy_util.h",
"tools/flip_server/streamer_interface.cc",
"tools/flip_server/streamer_interface.h",
"tools/flip_server/tcp_socket_util.cc",
"tools/flip_server/tcp_socket_util.h",
"tools/flip_server/url_to_filename_encoder.cc",
"tools/flip_server/url_to_filename_encoder.h",
"tools/flip_server/url_utilities.cc",
"tools/flip_server/url_utilities.h",
]
deps = [
":balsa",
":epoll_server",
":net",
"//base",
"//third_party/boringssl",
]
}
executable("flip_in_mem_edsm_server_unittests") {
testonly = true
sources = [
"tools/flip_server/flip_test_utils.cc",
"tools/flip_server/flip_test_utils.h",
"tools/flip_server/http_interface_test.cc",
"tools/flip_server/mem_cache_test.cc",
"tools/flip_server/run_all_tests.cc",
"tools/flip_server/spdy_interface_test.cc",
"tools/flip_server/url_to_filename_encoder_unittest.cc",
"tools/flip_server/url_utilities_unittest.cc",
]
deps = [
":balsa",
":flip_in_mem_edsm_server_base",
":net",
":test_support",
"//build/config/sanitizers:deps",
"//testing/gmock",
"//testing/gtest",
"//third_party/boringssl",
]
}
executable("flip_in_mem_edsm_server") {
testonly = true
sources = [
"tools/flip_server/flip_in_mem_edsm_server.cc",
]
deps = [
":balsa",
":flip_in_mem_edsm_server_base",
":net",
"//base",
"//build/config/sanitizers:deps",
]
}
source_set("epoll_quic_tools") {
sources = [
"tools/quic/quic_client.cc",
"tools/quic/quic_client.h",
"tools/quic/quic_default_packet_writer.cc",
"tools/quic/quic_default_packet_writer.h",
"tools/quic/quic_epoll_alarm_factory.cc",
"tools/quic/quic_epoll_alarm_factory.h",
"tools/quic/quic_epoll_clock.cc",
"tools/quic/quic_epoll_clock.h",
"tools/quic/quic_epoll_connection_helper.cc",
"tools/quic/quic_epoll_connection_helper.h",
"tools/quic/quic_packet_reader.cc",
"tools/quic/quic_packet_reader.h",
"tools/quic/quic_packet_writer_wrapper.cc",
"tools/quic/quic_packet_writer_wrapper.h",
"tools/quic/quic_server.cc",
"tools/quic/quic_server.h",
"tools/quic/quic_socket_utils.cc",
"tools/quic/quic_socket_utils.h",
]
deps = [
":balsa",
":epoll_server",
":net",
":simple_quic_tools",
"//base",
"//base/third_party/dynamic_annotations",
"//crypto",
"//third_party/boringssl",
"//url",
]
}
executable("epoll_quic_client") {
sources = [
"tools/quic/quic_client_bin.cc",
]
deps = [
":balsa",
":epoll_quic_tools",
":epoll_server",
":net",
":simple_quic_tools",
"//base",
"//build/config/sanitizers:deps",
"//third_party/boringssl",
]
}
executable("epoll_quic_server") {
sources = [
"tools/quic/quic_server_bin.cc",
]
deps = [
":balsa",
":epoll_quic_tools",
":epoll_server",
":net",
":simple_quic_tools",
"//base",
"//build/config/sanitizers:deps",
"//third_party/boringssl",
]
}
}
if (is_android) {
generate_jni("net_jni_headers") {
sources = [
"android/java/src/org/chromium/net/AndroidCellularSignalStrength.java",
"android/java/src/org/chromium/net/AndroidCertVerifyResult.java",
"android/java/src/org/chromium/net/AndroidKeyStore.java",
"android/java/src/org/chromium/net/AndroidNetworkLibrary.java",
"android/java/src/org/chromium/net/AndroidTrafficStats.java",
"android/java/src/org/chromium/net/GURLUtils.java",
"android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java",
"android/java/src/org/chromium/net/NetStringUtil.java",
"android/java/src/org/chromium/net/NetworkChangeNotifier.java",
"android/java/src/org/chromium/net/ProxyChangeListener.java",
"android/java/src/org/chromium/net/X509Util.java",
]
jni_package = "net"
}
generate_jni("net_test_jni_headers") {
sources = [
"android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java",
"test/android/javatests/src/org/chromium/net/test/DummySpnegoAuthenticator.java",
"test/android/javatests/src/org/chromium/net/test/EmbeddedTestServerImpl.java",
]
jni_package = "net/test"
}
}
if (is_android || is_linux) {
executable("disk_cache_memory_test") {
testonly = true
sources = [
"tools/disk_cache_memory_test/disk_cache_memory_test.cc",
]
deps = [
":net",
"//base",
"//build/config/sanitizers:deps",
]
}
}
source_set("simple_quic_tools") {
sources = [
"tools/quic/chlo_extractor.cc",
"tools/quic/chlo_extractor.h",
"tools/quic/quic_client_base.cc",
"tools/quic/quic_client_base.h",
"tools/quic/quic_client_session.cc",
"tools/quic/quic_client_session.h",
"tools/quic/quic_dispatcher.cc",
"tools/quic/quic_dispatcher.h",
"tools/quic/quic_in_memory_cache.cc",
"tools/quic/quic_in_memory_cache.h",
"tools/quic/quic_per_connection_packet_writer.cc",
"tools/quic/quic_per_connection_packet_writer.h",
"tools/quic/quic_process_packet_interface.h",
"tools/quic/quic_simple_client.cc",
"tools/quic/quic_simple_client.h",
"tools/quic/quic_simple_per_connection_packet_writer.cc",
"tools/quic/quic_simple_per_connection_packet_writer.h",
"tools/quic/quic_simple_server.cc",
"tools/quic/quic_simple_server.h",
"tools/quic/quic_simple_server_packet_writer.cc",
"tools/quic/quic_simple_server_packet_writer.h",
"tools/quic/quic_simple_server_session.cc",
"tools/quic/quic_simple_server_session.h",
"tools/quic/quic_simple_server_session_helper.cc",
"tools/quic/quic_simple_server_session_helper.h",
"tools/quic/quic_simple_server_stream.cc",
"tools/quic/quic_simple_server_stream.h",
"tools/quic/quic_spdy_client_stream.cc",
"tools/quic/quic_spdy_client_stream.h",
"tools/quic/quic_time_wait_list_manager.cc",
"tools/quic/quic_time_wait_list_manager.h",
"tools/quic/stateless_rejector.cc",
"tools/quic/stateless_rejector.h",
"tools/quic/synchronous_host_resolver.cc",
"tools/quic/synchronous_host_resolver.h",
]
deps = [
":balsa",
":net",
"//base",
"//base/third_party/dynamic_annotations",
"//url",
]
}
action_foreach("stale_while_revalidate_experiment_domains_dafsa") {
script = "//net/tools/dafsa/make_dafsa.py"
sources = [
"base/stale_while_revalidate_experiment_domains.gperf",
]
outputs = [
"${target_gen_dir}/base/{{source_name_part}}-inc.cc",
]
args = [
"{{source}}",
rebase_path("${target_gen_dir}/base/{{source_name_part}}-inc.cc",
root_build_dir),
]
}
source_set("stale_while_revalidate_experiment_domains") {
sources = [
"base/stale_while_revalidate_experiment_domains.cc",
"base/stale_while_revalidate_experiment_domains.h",
]
deps = [
":net",
":stale_while_revalidate_experiment_domains_dafsa",
"//base",
]
configs += net_configs
}
if (!is_ios) {
executable("quic_client") {
sources = [
"tools/quic/quic_simple_client_bin.cc",
]
deps = [
":net",
":simple_quic_tools",
"//base",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
"//url",
]
}
executable("quic_server") {
sources = [
"tools/quic/quic_simple_server_bin.cc",
]
deps = [
":net",
":simple_quic_tools",
"//base",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
"//third_party/boringssl",
"//third_party/protobuf:protobuf_lite",
]
}
executable("quic_packet_printer") {
sources = [
"tools/quic/quic_packet_printer_bin.cc",
]
deps = [
":net",
":simple_quic_tools",
"//base",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
"//third_party/boringssl",
"//third_party/protobuf:protobuf_lite",
]
}
executable("crypto_message_printer") {
sources = [
"tools/quic/crypto_message_printer_bin.cc",
]
deps = [
":net",
"//base",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
]
}
}
bundle_data("net_unittests_bundle_data") {
testonly = true
sources = gypi_values.net_unittests_data_sources
outputs = [
"{{bundle_resources_dir}}/" +
"{{source_root_relative_dir}}/{{source_file_part}}",
]
}
test("net_unittests") {
sources = gypi_values.net_test_sources
configs += [
"//build/config:precompiled_headers",
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
"//build/config/compiler:no_size_t_to_int_warning",
]
defines = []
deps = [
":balsa",
":extras",
":net",
":net_unittests_bundle_data",
":simple_quic_tools",
":stale_while_revalidate_experiment_domains",
":test_support",
"//base",
"//base:i18n",
"//base/third_party/dynamic_annotations",
"//crypto",
"//crypto:platform",
"//crypto:test_support",
"//net/base/registry_controlled_domains",
"//sql",
"//testing/gmock",
"//testing/gtest",
"//third_party/zlib",
"//url",
"//url:url_features",
]
data = []
data_deps = [
"third_party/nist-pkits/",
]
if (is_linux || is_mac || is_win) {
deps += [
"//third_party/pyftpdlib/",
"//third_party/pywebsocket/",
"//third_party/tlslite/",
]
data_deps += [
"//third_party/pyftpdlib/",
"//third_party/pywebsocket/",
"//third_party/tlslite/",
]
data += [
"tools/testserver/",
"//third_party/pyftpdlib/",
"//third_party/pywebsocket/",
"//third_party/tlslite/",
"$root_out_dir/pyproto/google/",
]
}
if (is_desktop_linux) {
deps += [ ":epoll_quic_tools" ]
}
if (is_linux) {
sources += gypi_values.net_linux_test_sources
deps += [
":epoll_quic_tools",
":epoll_server",
":flip_in_mem_edsm_server_base",
]
}
if (is_mac || is_ios) {
sources += gypi_values.net_base_test_mac_ios_sources
}
if (is_chromeos) {
sources -= [ "proxy/proxy_config_service_linux_unittest.cc" ]
}
if (v8_use_external_startup_data) {
deps += [ "//gin" ]
}
if (!use_nss_certs) {
sources -= [
"cert/nss_cert_database_unittest.cc",
"ssl/client_cert_store_nss_unittest.cc",
]
if (is_chromeos) { # Already removed for all non-ChromeOS builds.
sources -= [
"cert/nss_cert_database_chromeos_unittest.cc",
"cert/nss_profile_filter_chromeos_unittest.cc",
]
}
}
if (use_kerberos) {
defines += [ "USE_KERBEROS" ]
}
# These are excluded on Android, because the actual Kerberos support, which
# these test, is in a separate app on Android.
if (!use_kerberos || is_android) {
sources -= [
"http/http_auth_gssapi_posix_unittest.cc",
"http/mock_gssapi_library_posix.cc",
"http/mock_gssapi_library_posix.h",
]
}
if (!use_kerberos) {
sources -= [ "http/http_auth_handler_negotiate_unittest.cc" ]
}
if (!use_nss_certs) {
# Only include this test when using NSS for cert verification.
sources -= [ "cert_net/nss_ocsp_unittest.cc" ]
}
if (!use_openssl_certs) {
sources -= [ "ssl/openssl_client_key_store_unittest.cc" ]
}
if (enable_websockets) {
sources += gypi_values.net_websockets_test_sources
deps += [ ":http_server" ]
}
if (disable_file_support) {
sources -= [
"base/directory_lister_unittest.cc",
"base/directory_listing_unittest.cc",
"url_request/url_request_file_dir_job_unittest.cc",
"url_request/url_request_file_job_unittest.cc",
]
}
if (disable_ftp_support) {
sources -= [
"ftp/ftp_auth_cache_unittest.cc",
"ftp/ftp_ctrl_response_buffer_unittest.cc",
"ftp/ftp_directory_listing_parser_ls_unittest.cc",
"ftp/ftp_directory_listing_parser_unittest.cc",
"ftp/ftp_directory_listing_parser_unittest.h",
"ftp/ftp_directory_listing_parser_vms_unittest.cc",
"ftp/ftp_directory_listing_parser_windows_unittest.cc",
"ftp/ftp_network_transaction_unittest.cc",
"ftp/ftp_util_unittest.cc",
"url_request/url_request_ftp_job_unittest.cc",
]
}
if (!enable_built_in_dns) {
sources -= [
"dns/address_sorter_posix_unittest.cc",
"dns/address_sorter_unittest.cc",
]
}
if (use_v8_in_net) {
deps += [ ":net_with_v8" ]
} else {
sources -= [
"proxy/proxy_resolver_v8_tracing_unittest.cc",
"proxy/proxy_resolver_v8_tracing_wrapper_unittest.cc",
"proxy/proxy_resolver_v8_unittest.cc",
]
}
if (use_v8_in_net && !is_android) {
deps += [
":net_browser_services",
":net_utility_services",
"//mojo/edk/system",
]
} else {
sources -= [
"dns/host_resolver_mojo_unittest.cc",
"dns/mojo_host_resolver_impl_unittest.cc",
"proxy/mojo_proxy_resolver_factory_impl_unittest.cc",
"proxy/mojo_proxy_resolver_impl_unittest.cc",
"proxy/mojo_proxy_resolver_v8_tracing_bindings_unittest.cc",
"proxy/proxy_resolver_factory_mojo_unittest.cc",
"proxy/proxy_service_mojo_unittest.cc",
]
}
if (!enable_mdns) {
sources -= [
"dns/mdns_cache_unittest.cc",
"dns/mdns_client_unittest.cc",
"dns/record_parsed_unittest.cc",
"dns/record_rdata_unittest.cc",
]
}
if (is_ios) {
sources -= [
# TODO(droger): The following tests are disabled because the
# implementation is missing or incomplete.
# KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS.
"base/keygen_handler_unittest.cc",
"disk_cache/backend_unittest.cc",
"disk_cache/blockfile/block_files_unittest.cc",
# Need to read input data files.
"filter/gzip_filter_unittest.cc",
"socket/ssl_server_socket_unittest.cc",
"spdy/fuzzing/hpack_fuzz_util_test.cc",
# Need TestServer.
"cert_net/cert_net_fetcher_impl_unittest.cc",
"proxy/proxy_script_fetcher_impl_unittest.cc",
"socket/ssl_client_socket_unittest.cc",
"url_request/url_fetcher_impl_unittest.cc",
"url_request/url_request_context_builder_unittest.cc",
# Needs GetAppOutput().
"test/python_utils_unittest.cc",
# The following tests are disabled because they don't apply to
# iOS.
# OS is not "linux" or "freebsd" or "openbsd".
"socket/unix_domain_client_socket_posix_unittest.cc",
"socket/unix_domain_server_socket_posix_unittest.cc",
]
}
# Unit tests that aren't supported by the current ICU alternatives on Android.
if (is_android && use_platform_icu_alternatives) {
sources -= [
"base/filename_util_unittest.cc",
"base/url_util_unittest.cc",
"cert/x509_certificate_unittest.cc",
"proxy/proxy_resolver_v8_unittest.cc",
"url_request/url_request_job_unittest.cc",
]
}
# Unit tests that are not supported by the current ICU alternatives on iOS.
if (is_ios && use_platform_icu_alternatives) {
sources -= [
"base/filename_util_unittest.cc",
"base/url_util_unittest.cc",
"cert/x509_certificate_unittest.cc",
"http/http_auth_handler_basic_unittest.cc",
"http/http_auth_handler_digest_unittest.cc",
"http/http_auth_handler_factory_unittest.cc",
"http/http_auth_unittest.cc",
"http/http_content_disposition_unittest.cc",
"http/http_network_transaction_unittest.cc",
"http/http_proxy_client_socket_pool_unittest.cc",
"socket/ssl_client_socket_pool_unittest.cc",
"spdy/spdy_network_transaction_unittest.cc",
"spdy/spdy_proxy_client_socket_unittest.cc",
"url_request/url_request_job_unittest.cc",
"url_request/url_request_unittest.cc",
]
}
# Exclude brotli test if the support for brotli is disabled.
# Also, exclude the test from iOS for now (needs to read input data files).
if (disable_brotli_filter || is_ios) {
sources -= [ "filter/brotli_filter_unittest.cc" ]
}
if (is_android) {
data_deps += [ "//net/tools/testserver:testserver_py" ]
deps += [
":net_test_jni_headers",
"//base:base_java_unittest_support",
"//net/android:net_java",
"//net/android:net_java_test_support",
"//net/android:net_javatests",
"//net/android:net_unittests_apk_resources",
# TODO(mmenke): This depends on test_support_base, which depends on
# icu. Figure out a way to remove that dependency.
"//testing/android/native_test:native_test_native_code",
"//v8:v8_external_startup_data_assets",
]
android_manifest = "//net/android/unittest_support/AndroidManifest.xml"
set_sources_assignment_filter([])
sources += [ "base/address_tracker_linux_unittest.cc" ]
set_sources_assignment_filter(sources_assignment_filter)
shard_timeout = 300
}
# Symbols for crashes when running tests on swarming.
if (symbol_level > 0) {
if (is_win) {
data += [ "$root_out_dir/net_unittests.exe.pdb" ]
} else if (is_mac) {
# TODO(crbug.com/330301): make this conditional on mac_strip_release.
# data += [ "$root_out_dir/net_unittests.dSYM/" ]
}
}
if (is_win) {
libs = [ "iphlpapi.lib" ]
}
}
# !is_android && !is_win && !is_mac
if (!is_ios) {
# TODO(crbug.com/594965): this should be converted to "app" template and
# enabled on iOS too.
executable("net_perftests") {
testonly = true
sources = [
"base/mime_sniffer_perftest.cc",
"cookies/cookie_monster_perftest.cc",
"disk_cache/disk_cache_perftest.cc",
"extras/sqlite/sqlite_persistent_cookie_store_perftest.cc",
"proxy/proxy_resolver_perftest.cc",
"udp/udp_socket_perftest.cc",
]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
":extras",
":net",
":test_support",
"//base",
"//base:i18n",
"//base/test:test_support_perf",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
"//testing/gtest",
"//url",
]
if (enable_websockets) {
sources += [ "websockets/websocket_frame_perftest.cc" ]
}
if (use_v8_in_net) {
deps += [ ":net_with_v8" ]
} else {
sources -= [ "proxy/proxy_resolver_perftest.cc" ]
}
}
}
# Fuzzers
source_set("net_fuzzer_test_support") {
testonly = true
sources = [
"base/fuzzed_data_provider.cc",
"base/fuzzed_data_provider.h",
"base/fuzzer_test_support.cc",
"socket/fuzzed_socket.cc",
"socket/fuzzed_socket.h",
"socket/fuzzed_socket_factory.cc",
"socket/fuzzed_socket_factory.h",
"udp/fuzzed_datagram_client_socket.cc",
"udp/fuzzed_datagram_client_socket.h",
]
deps = [
"//base",
"//base:i18n",
"//net",
]
}
fuzzer_test("net_data_job_fuzzer") {
sources = [
"url_request/url_request_data_job_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
":test_support",
"//base",
"//net",
]
}
fuzzer_test("net_mime_sniffer_fuzzer") {
sources = [
"base/mime_sniffer_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
"//base",
"//net",
]
}
fuzzer_test("net_parse_proxy_list_pac_fuzzer") {
sources = [
"proxy/parse_proxy_list_pac_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
"//net",
]
}
fuzzer_test("net_parse_proxy_list_fuzzer") {
sources = [
"proxy/parse_proxy_list_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
"//net",
]
}
fuzzer_test("net_parse_proxy_bypass_rules_fuzzer") {
sources = [
"proxy/parse_proxy_bypass_rules_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
"//net",
]
}
fuzzer_test("net_parse_proxy_rules_fuzzer") {
sources = [
"proxy/parse_proxy_rules_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
"//net",
]
}
fuzzer_test("net_parse_data_url_fuzzer") {
sources = [
"base/parse_data_url_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
"//base",
"//net",
]
}
fuzzer_test("net_parse_ip_pattern_fuzzer") {
sources = [
"base/parse_ip_pattern_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
"//net",
]
}
fuzzer_test("net_get_domain_and_registry_fuzzer") {
sources = [
"base/registry_controlled_domains/get_domain_and_registry_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
"//base",
"//net",
]
}
fuzzer_test("net_cert_verify_name_match_fuzzer") {
sources = [
"cert/internal/verify_name_match_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
"//base",
"//net",
]
}
fuzzer_test("net_cert_normalize_name_fuzzer") {
sources = [
"cert/internal/verify_name_match_normalizename_fuzzer.cc",
]
deps = [
"//base",
"//net",
]
}
fuzzer_test("net_cert_verify_name_in_subtree_fuzzer") {
sources = [
"cert/internal/verify_name_match_verifynameinsubtree_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
"//base",
"//net",
]
}
fuzzer_test("net_cert_parse_certificate_fuzzer") {
sources = [
"cert/internal/parse_certificate_fuzzer.cc",
]
deps = [
"//base",
"//net",
]
}
fuzzer_test("net_parse_cookie_line_fuzzer") {
sources = [
"cookies/parse_cookie_line_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
"//net",
]
}
fuzzer_test("net_dns_record_fuzzer") {
sources = [
"dns/dns_record_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
"//base",
"//net",
]
}
fuzzer_test("net_dns_hosts_parse_fuzzer") {
sources = [
"dns/dns_hosts_parse_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
"//base",
"//net",
]
}
fuzzer_test("net_host_resolver_impl_fuzzer") {
sources = [
"dns/fuzzed_host_resolver.cc",
"dns/fuzzed_host_resolver.h",
"dns/host_resolver_impl_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
":test_support",
"//base",
"//net",
]
dict = "data/dns/dns.dict"
}
fuzzer_test("net_http_stream_parser_fuzzer") {
sources = [
"http/http_stream_parser_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
":test_support",
"//base",
"//net",
]
dict = "data/http/http.dict"
}
fuzzer_test("net_ftp_ctrl_response_fuzzer") {
sources = [
"ftp/ftp_ctrl_response_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
"//base",
"//net",
]
}
fuzzer_test("net_ftp_directory_listing_fuzzer") {
sources = [
"ftp/ftp_directory_listing_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
"//base",
"//net",
]
}
fuzzer_test("net_unescape_url_component_fuzzer") {
sources = [
"base/unescape_url_component_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
"//base",
"//net",
]
dict = "base/unescape_url_component_fuzzer.dict"
libfuzzer_options = [ "max_len = 2048" ]
}
fuzzer_test("net_websocket_frame_parser_fuzzer") {
sources = [
"websockets/websocket_frame_parser_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
"//net",
]
}
fuzzer_test("net_http_chunked_decoder_fuzzer") {
sources = [
"http/http_chunked_decoder_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
"//net",
]
dict = "http/http_chunked_decoder_fuzzer.dict"
}
fuzzer_test("net_http_proxy_client_socket_fuzzer") {
sources = [
"http/http_proxy_client_socket_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
":test_support",
"//base",
"//net",
]
dict = "data/http/http.dict"
}
fuzzer_test("net_quic_crypto_framer_parse_message_fuzzer") {
sources = [
"quic/quic_crypto_framer_parse_message_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
"//base",
"//net",
]
}
fuzzer_test("net_socks_client_socket_fuzzer") {
sources = [
"socket/socks_client_socket_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
":test_support",
"//base",
"//net",
]
}
fuzzer_test("net_socks5_client_socket_fuzzer") {
sources = [
"socket/socks5_client_socket_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
":test_support",
"//base",
"//net",
]
}
fuzzer_test("net_url_request_fuzzer") {
sources = [
"url_request/url_request_fuzzer.cc",
]
deps = [
":net_fuzzer_test_support",
":test_support",
"//base",
"//net",
]
dict = "data/http/http.dict"
}