chromium/services/network/BUILD.gn

# Copyright 2017 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/chromeos/ui_mode.gni")
import("//build/config/features.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//net/features.gni")
import("//services/network/public/cpp/features.gni")
import("//testing/libfuzzer/fuzzer_test.gni")

component("network_service") {
  sources = [
    "ad_heuristic_cookie_overrides.cc",
    "ad_heuristic_cookie_overrides.h",
    "chunked_data_pipe_upload_data_stream.cc",
    "chunked_data_pipe_upload_data_stream.h",
    "conditional_cache_deletion_helper.cc",
    "conditional_cache_deletion_helper.h",
    "cookie_access_delegate_impl.cc",
    "cookie_access_delegate_impl.h",
    "cookie_manager.cc",
    "cookie_manager.h",
    "cookie_settings.cc",
    "cookie_settings.h",
    "cors/cors_url_loader.cc",
    "cors/cors_url_loader.h",
    "cors/cors_url_loader_factory.cc",
    "cors/cors_url_loader_factory.h",
    "cors/cors_util.cc",
    "cors/cors_util.h",
    "cors/preflight_cache.cc",
    "cors/preflight_cache.h",
    "cors/preflight_controller.cc",
    "cors/preflight_controller.h",
    "cors/preflight_result.cc",
    "cors/preflight_result.h",
    "data_pipe_element_reader.cc",
    "data_pipe_element_reader.h",
    "data_remover_util.cc",
    "data_remover_util.h",
    "disk_cache/mojo_backend_file_operations.cc",
    "disk_cache/mojo_backend_file_operations.h",
    "disk_cache/mojo_backend_file_operations_factory.cc",
    "disk_cache/mojo_backend_file_operations_factory.h",
    "dns_config_change_manager.cc",
    "dns_config_change_manager.h",
    "host_resolver.cc",
    "host_resolver.h",
    "host_resolver_mdns_listener.cc",
    "host_resolver_mdns_listener.h",
    "http_auth_cache_copier.cc",
    "http_auth_cache_copier.h",
    "http_cache_data_counter.cc",
    "http_cache_data_counter.h",
    "http_cache_data_remover.cc",
    "http_cache_data_remover.h",
    "http_server_properties_pref_delegate.cc",
    "http_server_properties_pref_delegate.h",
    "ignore_errors_cert_verifier.cc",
    "ignore_errors_cert_verifier.h",
    "ip_protection/ip_protection_config_cache.h",
    "ip_protection/ip_protection_config_cache_impl.cc",
    "ip_protection/ip_protection_config_cache_impl.h",
    "ip_protection/ip_protection_config_getter.h",
    "ip_protection/ip_protection_config_getter_mojo_impl.cc",
    "ip_protection/ip_protection_config_getter_mojo_impl.h",
    "ip_protection/ip_protection_geo_utils.cc",
    "ip_protection/ip_protection_geo_utils.h",
    "ip_protection/ip_protection_proxy_delegate.cc",
    "ip_protection/ip_protection_proxy_delegate.h",
    "ip_protection/ip_protection_proxy_list_manager.h",
    "ip_protection/ip_protection_proxy_list_manager_impl.cc",
    "ip_protection/ip_protection_proxy_list_manager_impl.h",
    "ip_protection/ip_protection_token_cache_manager.h",
    "ip_protection/ip_protection_token_cache_manager_impl.cc",
    "ip_protection/ip_protection_token_cache_manager_impl.h",
    "is_browser_initiated.h",
    "keepalive_statistics_recorder.cc",
    "keepalive_statistics_recorder.h",
    "mojo_host_resolver_impl.cc",
    "mojo_host_resolver_impl.h",
    "net_log_exporter.cc",
    "net_log_exporter.h",
    "net_log_proxy_sink.cc",
    "net_log_proxy_sink.h",
    "network_change_manager.cc",
    "network_change_manager.h",
    "network_context.cc",
    "network_context.h",
    "network_qualities_pref_delegate.cc",
    "network_qualities_pref_delegate.h",
    "network_quality_estimator_manager.cc",
    "network_quality_estimator_manager.h",
    "network_service.cc",
    "network_service.h",
    "network_service_network_delegate.cc",
    "network_service_network_delegate.h",
    "network_service_proxy_delegate.cc",
    "network_service_proxy_delegate.h",
    "oblivious_http_request_handler.cc",
    "oblivious_http_request_handler.h",
    "orb/orb_api.cc",
    "orb/orb_impl.cc",
    "orb/orb_impl.h",
    "orb/orb_mimetypes.cc",
    "orb/orb_mimetypes.h",
    "orb/orb_sniffers.cc",
    "orb/orb_sniffers.h",
    "pending_callback_chain.cc",
    "pending_callback_chain.h",
    "prefetch_cache.cc",
    "prefetch_cache.h",
    "prefetch_matching_url_loader_factory.cc",
    "prefetch_matching_url_loader_factory.h",
    "prefetch_url_loader_client.cc",
    "prefetch_url_loader_client.h",
    "private_network_access_checker.cc",
    "private_network_access_checker.h",
    "proxy_auto_config_library.cc",
    "proxy_auto_config_library.h",
    "proxy_config_service_mojo.cc",
    "proxy_config_service_mojo.h",
    "proxy_lookup_request.cc",
    "proxy_lookup_request.h",
    "proxy_resolver_factory_mojo.cc",
    "proxy_resolver_factory_mojo.h",
    "proxy_resolving_client_socket.cc",
    "proxy_resolving_client_socket.h",
    "proxy_resolving_client_socket_factory.cc",
    "proxy_resolving_client_socket_factory.h",
    "proxy_resolving_socket_factory_mojo.cc",
    "proxy_resolving_socket_factory_mojo.h",
    "proxy_resolving_socket_mojo.cc",
    "proxy_resolving_socket_mojo.h",
    "proxy_service_mojo.cc",
    "proxy_service_mojo.h",
    "resolve_host_request.cc",
    "resolve_host_request.h",
    "resource_scheduler/resource_scheduler.cc",
    "resource_scheduler/resource_scheduler.h",
    "resource_scheduler/resource_scheduler_client.cc",
    "resource_scheduler/resource_scheduler_client.h",
    "resource_scheduler/resource_scheduler_params_manager.cc",
    "resource_scheduler/resource_scheduler_params_manager.h",
    "restricted_cookie_manager.cc",
    "restricted_cookie_manager.h",
    "restricted_udp_socket.cc",
    "restricted_udp_socket.h",
    "sec_header_helpers.cc",
    "sec_header_helpers.h",
    "session_cleanup_cookie_store.cc",
    "session_cleanup_cookie_store.h",
    "shared_dictionary/shared_dictionary_access_checker.cc",
    "shared_dictionary/shared_dictionary_access_checker.h",
    "shared_dictionary/shared_dictionary_constants.cc",
    "shared_dictionary/shared_dictionary_constants.h",
    "shared_dictionary/shared_dictionary_data_pipe_writer.cc",
    "shared_dictionary/shared_dictionary_data_pipe_writer.h",
    "shared_dictionary/shared_dictionary_disk_cache.cc",
    "shared_dictionary/shared_dictionary_disk_cache.h",
    "shared_dictionary/shared_dictionary_in_memory.cc",
    "shared_dictionary/shared_dictionary_in_memory.h",
    "shared_dictionary/shared_dictionary_manager.cc",
    "shared_dictionary/shared_dictionary_manager.h",
    "shared_dictionary/shared_dictionary_manager_in_memory.cc",
    "shared_dictionary/shared_dictionary_manager_in_memory.h",
    "shared_dictionary/shared_dictionary_manager_on_disk.cc",
    "shared_dictionary/shared_dictionary_manager_on_disk.h",
    "shared_dictionary/shared_dictionary_on_disk.cc",
    "shared_dictionary/shared_dictionary_on_disk.h",
    "shared_dictionary/shared_dictionary_storage.cc",
    "shared_dictionary/shared_dictionary_storage.h",
    "shared_dictionary/shared_dictionary_storage_in_memory.cc",
    "shared_dictionary/shared_dictionary_storage_in_memory.h",
    "shared_dictionary/shared_dictionary_storage_on_disk.cc",
    "shared_dictionary/shared_dictionary_storage_on_disk.h",
    "shared_dictionary/shared_dictionary_writer.h",
    "shared_dictionary/shared_dictionary_writer_in_memory.cc",
    "shared_dictionary/shared_dictionary_writer_in_memory.h",
    "shared_dictionary/shared_dictionary_writer_on_disk.cc",
    "shared_dictionary/shared_dictionary_writer_on_disk.h",
    "shared_dictionary/simple_url_pattern_matcher.cc",
    "shared_dictionary/simple_url_pattern_matcher.h",
    "slop_bucket.cc",
    "slop_bucket.h",
    "socket_data_pump.cc",
    "socket_data_pump.h",
    "socket_factory.cc",
    "socket_factory.h",
    "ssl_config_service_mojo.cc",
    "ssl_config_service_mojo.h",
    "ssl_config_type_converter.cc",
    "ssl_config_type_converter.h",
    "tcp_bound_socket.cc",
    "tcp_bound_socket.h",
    "tcp_connected_socket.cc",
    "tcp_connected_socket.h",
    "tcp_server_socket.cc",
    "tcp_server_socket.h",
    "throttling/network_conditions.cc",
    "throttling/network_conditions.h",
    "throttling/scoped_throttling_token.cc",
    "throttling/scoped_throttling_token.h",
    "throttling/throttling_controller.cc",
    "throttling/throttling_controller.h",
    "throttling/throttling_network_interceptor.cc",
    "throttling/throttling_network_interceptor.h",
    "throttling/throttling_network_transaction.cc",
    "throttling/throttling_network_transaction.h",
    "throttling/throttling_network_transaction_factory.cc",
    "throttling/throttling_network_transaction_factory.h",
    "throttling/throttling_upload_data_stream.cc",
    "throttling/throttling_upload_data_stream.h",
    "tls_client_socket.cc",
    "tls_client_socket.h",
    "tls_socket_factory.cc",
    "tls_socket_factory.h",
    "transitional_url_loader_factory_owner.cc",
    "transitional_url_loader_factory_owner.h",
    "udp_socket.cc",
    "udp_socket.h",
    "upload_progress_tracker.cc",
    "upload_progress_tracker.h",
    "url_loader.cc",
    "url_loader.h",
    "url_loader_context.h",
    "url_loader_factory.cc",
    "url_loader_factory.h",
    "url_request_context_builder_mojo.cc",
    "url_request_context_builder_mojo.h",
    "url_request_context_owner.cc",
    "url_request_context_owner.h",
    "web_bundle/web_bundle_chunked_buffer.cc",
    "web_bundle/web_bundle_chunked_buffer.h",
    "web_bundle/web_bundle_manager.cc",
    "web_bundle/web_bundle_manager.h",
    "web_bundle/web_bundle_memory_quota_consumer.h",
    "web_bundle/web_bundle_url_loader_factory.cc",
    "web_bundle/web_bundle_url_loader_factory.h",
    "web_transport.cc",
    "web_transport.h",
  ]

  if (is_p2p_enabled) {
    sources += [
      "p2p/socket.cc",
      "p2p/socket.h",
      "p2p/socket_manager.cc",
      "p2p/socket_manager.h",
      "p2p/socket_tcp.cc",
      "p2p/socket_tcp.h",
      "p2p/socket_throttler.cc",
      "p2p/socket_throttler.h",
      "p2p/socket_udp.cc",
      "p2p/socket_udp.h",
      "throttling/throttling_p2p_network_interceptor.cc",
      "throttling/throttling_p2p_network_interceptor.h",
    ]
  }

  if (enable_mdns) {
    sources += [
      "mdns_responder.cc",
      "mdns_responder.h",
    ]
  }

  if (enable_websockets) {
    sources += [
      "websocket.cc",
      "websocket.h",
      "websocket_factory.cc",
      "websocket_factory.h",
      "websocket_interceptor.cc",
      "websocket_interceptor.h",
      "websocket_throttler.cc",
      "websocket_throttler.h",
    ]
  }

  if (is_chromeos) {
    sources += [
      "cert_verifier_with_trust_anchors.cc",
      "cert_verifier_with_trust_anchors.h",
    ]
  }

  if (is_chromeos_ash) {
    sources += [
      "dhcp_pac_file_fetcher_mojo.cc",
      "dhcp_pac_file_fetcher_mojo.h",
    ]
  }

  if (is_win) {
    sources += [
      "broker_helper_win.cc",
      "broker_helper_win.h",
      "brokered_client_socket_factory.cc",
      "brokered_client_socket_factory.h",
      "brokered_tcp_client_socket.cc",
      "brokered_tcp_client_socket.h",
      "brokered_udp_client_socket.cc",
      "brokered_udp_client_socket.h",
      "windows_system_proxy_resolver_mojo.cc",
      "windows_system_proxy_resolver_mojo.h",
    ]
  }

  if (is_linux) {
    sources += [
      "network_change_notifier_passive_factory.cc",
      "network_change_notifier_passive_factory.h",
    ]
  }

  configs += [ "//build/config/compiler:wexit_time_destructors" ]

  deps = [
    "//base",
    "//build:chromecast_buildflags",
    "//build:chromeos_buildflags",
    "//components/content_settings/core/common",
    "//components/cookie_config",
    "//components/domain_reliability",
    "//components/ip_protection:ip_protection",
    "//components/miracle_parameter/common",
    "//components/network_session_configurator/browser",
    "//components/network_session_configurator/common",
    "//components/os_crypt/async/common",
    "//components/os_crypt/sync",
    "//components/prefs",
    "//components/privacy_sandbox/masked_domain_list:masked_domain_list_proto",
    "//components/url_matcher",
    "//components/url_pattern",
    "//components/web_package",
    "//components/webrtc:fake_ssl_socket",
    "//mojo/public/cpp/base",
    "//mojo/public/cpp/base:protobuf_support",
    "//mojo/public/cpp/bindings",
    "//mojo/public/cpp/system",
    "//net",
    "//net:extras",
    "//services/network/attribution",
    "//services/network/first_party_sets:first_party_sets_manager",
    "//services/network/public/cpp",
    "//services/network/public/cpp:crash_keys",
    "//services/network/public/cpp/cert_verifier:mojo_cert_verifier",
    "//services/network/public/mojom",
    "//services/network/public/proto",
    "//services/network/shared_storage",
    "//services/network/tpcd/metadata:manager",
    "//services/network/trust_tokens",
    "//services/service_manager/public/cpp",
    "//services/service_manager/public/mojom",
    "//third_party/liburlpattern",
    "//third_party/re2",
    "//url",
  ]

  if (is_linux || is_chromeos) {
    deps += [
      ":network_sandbox_hook",
      "//sandbox/linux:sandbox_services",  # TODO(crbug.com/40220505): remove.
    ]
  }

  public_deps = [ "//services/network/public/cpp:buildflags" ]

  if (is_ct_supported) {
    sources += [
      "sct_auditing/sct_auditing_cache.cc",
      "sct_auditing/sct_auditing_cache.h",
      "sct_auditing/sct_auditing_handler.cc",
      "sct_auditing/sct_auditing_handler.h",
      "sct_auditing/sct_auditing_reporter.cc",
      "sct_auditing/sct_auditing_reporter.h",
    ]
    deps += [
      "//components/certificate_transparency",
      "//components/version_info",
    ]
  }

  if (is_p2p_enabled) {
    deps += [ "//third_party/webrtc_overrides:webrtc_component" ]
  }

  if (is_android) {
    deps += [
      "//crypto",
      "//third_party/boringssl",
    ]
  }

  if (is_win) {
    deps += [ "//sandbox/win:sandbox" ]
  }

  defines = [ "IS_NETWORK_SERVICE_IMPL" ]
}

if (is_linux || is_chromeos) {
  source_set("network_sandbox_hook") {
    sources = [
      "network_sandbox_hook_linux.cc",
      "network_sandbox_hook_linux.h",
    ]
    deps = [
      "//base:base",
      "//sandbox/linux:sandbox_services",
      "//sandbox/policy:policy",
    ]
    configs += [ "//build/config/compiler:wexit_time_destructors" ]
  }
}

source_set("tests") {
  testonly = true

  sources = [
    "chunked_data_pipe_upload_data_stream_unittest.cc",
    "cookie_access_delegate_impl_unittest.cc",
    "cookie_manager_unittest.cc",
    "cookie_settings_unittest.cc",
    "cors/cors_url_loader_factory_unittest.cc",
    "cors/cors_url_loader_private_network_access_unittest.cc",
    "cors/cors_url_loader_shared_dictionary_unittest.cc",
    "cors/cors_url_loader_tao_unittest.cc",
    "cors/cors_url_loader_test_util.cc",
    "cors/cors_url_loader_test_util.h",
    "cors/cors_url_loader_unittest.cc",
    "cors/cors_util_unittest.cc",
    "cors/preflight_cache_unittest.cc",
    "cors/preflight_controller_unittest.cc",
    "cors/preflight_result_unittest.cc",
    "data_pipe_element_reader_unittest.cc",
    "data_remover_util_unittest.cc",
    "dns_config_change_manager_unittest.cc",
    "host_resolver_unittest.cc",
    "http_cache_data_counter_unittest.cc",
    "http_cache_data_remover_unittest.cc",
    "ignore_errors_cert_verifier_unittest.cc",
    "ip_protection/ip_protection_config_cache_impl_unittest.cc",
    "ip_protection/ip_protection_geo_utils_unittest.cc",
    "ip_protection/ip_protection_proxy_delegate_unittest.cc",
    "ip_protection/ip_protection_proxy_list_manager_impl_unittest.cc",
    "ip_protection/ip_protection_token_cache_manager_impl_unittest.cc",
    "keepalive_statistics_recorder_unittest.cc",
    "mojo_host_resolver_impl_unittest.cc",
    "net_log_proxy_sink_unittest.cc",
    "network_change_manager_unittest.cc",
    "network_context_unittest.cc",
    "network_qualities_pref_delegate_unittest.cc",
    "network_quality_estimator_manager_unittest.cc",
    "network_service_proxy_delegate_unittest.cc",
    "network_service_unittest.cc",
    "oblivious_http_request_handler_unittest.cc",
    "orb/orb_impl_unittest.cc",
    "orb/orb_mimetypes_unittest.cc",
    "orb/orb_sniffers_unittest.cc",
    "pending_callback_chain_unittest.cc",
    "prefetch_cache_unittest.cc",
    "prefetch_url_loader_client_unittest.cc",
    "private_network_access_checker_unittest.cc",
    "proxy_auto_config_library_unittest.cc",
    "proxy_config_service_mojo_unittest.cc",
    "proxy_resolving_client_socket_unittest.cc",
    "proxy_resolving_socket_mojo_unittest.cc",
    "resource_scheduler/resource_scheduler_params_manager_unittest.cc",
    "resource_scheduler/resource_scheduler_unittest.cc",
    "restricted_cookie_manager_unittest.cc",
    "sec_header_helpers_unittest.cc",
    "session_cleanup_cookie_store_unittest.cc",
    "shared_dictionary/shared_dictionary_data_pipe_writer_unittest.cc",
    "shared_dictionary/shared_dictionary_disk_cache_unittest.cc",
    "shared_dictionary/shared_dictionary_manager_on_disk_unittest.cc",
    "shared_dictionary/shared_dictionary_manager_unittest.cc",
    "shared_dictionary/shared_dictionary_on_disk_unittest.cc",
    "shared_dictionary/shared_dictionary_writer_in_memory_unittest.cc",
    "shared_dictionary/shared_dictionary_writer_on_disk_unittest.cc",
    "shared_dictionary/simple_url_pattern_matcher_unittest.cc",
    "socket_data_pump_unittest.cc",
    "ssl_config_service_mojo_unittest.cc",
    "tcp_bound_socket_unittest.cc",
    "tcp_socket_unittest.cc",
    "test/test_url_loader_factory_unittest.cc",
    "test_chunked_data_pipe_getter.cc",
    "test_chunked_data_pipe_getter.h",
    "throttling/throttling_controller_unittest.cc",
    "tls_client_socket_unittest.cc",
    "transitional_url_loader_factory_owner_unittest.cc",
    "udp_socket_unittest.cc",
    "upload_progress_tracker_unittest.cc",
    "url_loader_unittest.cc",
    "web_bundle/web_bundle_chunked_buffer_unittest.cc",
    "web_bundle/web_bundle_manager_unittest.cc",
    "web_bundle/web_bundle_url_loader_factory_unittest.cc",
    "web_transport_unittest.cc",
  ]

  if (is_p2p_enabled) {
    sources += [
      "p2p/socket_manager_unittest.cc",
      "p2p/socket_tcp_unittest.cc",
      "p2p/socket_test_utils.cc",
      "p2p/socket_test_utils.h",
      "p2p/socket_udp_unittest.cc",
    ]
  }

  if (enable_mdns) {
    sources += [ "mdns_responder_unittest.cc" ]
  }

  if (enable_websockets) {
    sources += [
      "proxy_resolver_factory_mojo_unittest.cc",
      "proxy_service_mojo_unittest.cc",
      "test_mojo_proxy_resolver_factory.cc",
      "test_mojo_proxy_resolver_factory.h",
      "url_request_context_builder_mojo_unittest.cc",
      "websocket_interceptor_unittest.cc",
      "websocket_throttler_unittest.cc",
    ]

    data = [
      "//net/tools/testserver/",
      "//services/test/data",
      "//third_party/pywebsocket3/src/mod_pywebsocket/",
    ]
  }

  if (is_chromeos_ash) {
    sources += [
      "cert_verifier_with_trust_anchors_unittest.cc",
      "dhcp_pac_file_fetcher_mojo_unittest.cc",
    ]
  }

  if (is_win) {
    sources += [
      "broker_helper_win_unittest.cc",
      "brokered_tcp_client_socket_unittest.cc",
      "brokered_udp_client_socket_unittest.cc",
      "windows_system_proxy_resolver_mojo_unittest.cc",
    ]
  }

  deps = [
    ":network_service",
    ":test_support",
    "//base",
    "//build:chromeos_buildflags",
    "//components/ip_protection:ip_protection",
    "//components/network_session_configurator/browser",
    "//components/os_crypt/async/browser:test_support",
    "//components/os_crypt/sync:test_support",
    "//components/prefs:test_support",
    "//components/privacy_sandbox:features",
    "//components/privacy_sandbox/masked_domain_list:masked_domain_list_proto",
    "//components/variations:test_support",
    "//components/web_package",
    "//components/webrtc:fake_ssl_socket",
    "//crypto",
    "//mojo/public/cpp/bindings",
    "//mojo/public/cpp/system",
    "//mojo/public/cpp/test_support:test_utils",
    "//net",
    "//net:extras",
    "//net:quic_test_tools",
    "//net:simple_quic_tools",
    "//net:test_support",
    "//net/http:transport_security_state_unittest_data_default",
    "//services/network/attribution",
    "//services/network/attribution:tests",
    "//services/network/first_party_sets:first_party_sets_manager",
    "//services/network/first_party_sets:tests",
    "//services/network/public/cpp",
    "//services/network/public/cpp:buildflags",
    "//services/network/public/mojom",
    "//services/network/public/proto",
    "//services/network/shared_storage",
    "//services/network/shared_storage:test_support",
    "//services/network/shared_storage:tests",
    "//services/network/tpcd/metadata:manager",
    "//services/network/tpcd/metadata:unit_tests",
    "//services/network/trust_tokens",
    "//services/network/trust_tokens:tests",
    "//services/service_manager/public/cpp",
    "//services/service_manager/public/cpp/test:test_support",
    "//sql:test_support",
    "//testing/gmock",
    "//testing/gtest",
  ]

  if (is_ct_supported) {
    sources += [
      "sct_auditing/sct_auditing_cache_unittest.cc",
      "sct_auditing/sct_auditing_handler_unittest.cc",
      "sct_auditing/sct_auditing_reporter_unittest.cc",
    ]
    deps += [ "//components/certificate_transparency" ]
  }

  if (use_blink) {
    deps += [ "//services/proxy_resolver:lib" ]
  }
}

source_set("test_support") {
  testonly = true

  sources = [
    "mojo_socket_test_util.cc",
    "mojo_socket_test_util.h",
    "test/client_security_state_builder.cc",
    "test/client_security_state_builder.h",
    "test/fake_test_cert_verifier_params_factory.cc",
    "test/fake_test_cert_verifier_params_factory.h",
    "test/mock_devtools_observer.cc",
    "test/mock_devtools_observer.h",
    "test/mock_url_loader_client.cc",
    "test/mock_url_loader_client.h",
    "test/oblivious_http_request_test_helper.cc",
    "test/oblivious_http_request_test_helper.h",
    "test/test_cookie_manager.cc",
    "test/test_cookie_manager.h",
    "test/test_data_pipe_getter.cc",
    "test/test_data_pipe_getter.h",
    "test/test_dns_util.cc",
    "test/test_dns_util.h",
    "test/test_network_connection_tracker.cc",
    "test/test_network_connection_tracker.h",
    "test/test_network_context.h",
    "test/test_network_context_client.cc",
    "test/test_network_context_client.h",
    "test/test_network_context_with_host_resolver.cc",
    "test/test_network_context_with_host_resolver.h",
    "test/test_network_quality_tracker.cc",
    "test/test_network_quality_tracker.h",
    "test/test_restricted_udp_socket.cc",
    "test/test_restricted_udp_socket.h",
    "test/test_shared_url_loader_factory.cc",
    "test/test_shared_url_loader_factory.h",
    "test/test_socket_broker_impl.cc",
    "test/test_socket_broker_impl.h",
    "test/test_udp_socket.cc",
    "test/test_udp_socket.h",
    "test/test_url_loader_client.cc",
    "test/test_url_loader_client.h",
    "test/test_url_loader_factory.cc",
    "test/test_url_loader_factory.h",
    "test/test_url_loader_network_observer.cc",
    "test/test_url_loader_network_observer.h",
    "test/test_utils.cc",
    "test/test_utils.h",
    "test/trust_token_request_handler.cc",
    "test/trust_token_request_handler.h",
    "test/trust_token_test_server_handler_registration.cc",
    "test/trust_token_test_server_handler_registration.h",
    "test/trust_token_test_util.cc",
    "test/trust_token_test_util.h",
    "test/udp_socket_test_util.cc",
    "test/udp_socket_test_util.h",
    "test/url_loader_context_for_tests.cc",
    "test/url_loader_context_for_tests.h",
  ]

  if (is_chromeos_ash) {
    sources += [
      "mock_mojo_dhcp_wpad_url_client.cc",
      "mock_mojo_dhcp_wpad_url_client.h",
    ]
  }

  public_deps = [
    "//services/network/public/cpp",
    "//services/network/public/cpp:buildflags",
    "//services/network/public/mojom",
    "//services/network/trust_tokens:test_support",
    "//services/network/trust_tokens:trust_tokens",
  ]

  deps = [
    "//base",
    "//build:chromeos_buildflags",
    "//components/cbor:cbor",
    "//mojo/public/cpp/bindings",
    "//net",
    "//net:test_support",
    "//services/network:network_service",
    "//testing/gtest",
  ]
}

fuzzer_test("network_content_security_policy_fuzzer") {
  sources = [ "content_security_policy_fuzzer.cc" ]
  deps = [
    "//base",
    "//net",
    "//services/network:network_service",
    "//services/network/public/cpp",
    "//services/network/public/mojom",
  ]
  dict = "//testing/libfuzzer/fuzzers/dicts/content_security_policy.dict"
  seed_corpus = "//testing/libfuzzer/fuzzers/content_security_policy_corpus"
}