chromium/chromeos/ash/components/network/BUILD.gn

# Copyright 2022 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")

assert(is_chromeos_ash, "Non-ChromeOS builds cannot depend on //chromeos/ash")

config("network_config") {
  defines = [ "IS_CHROMEOS_NETWORK_IMPL" ]
}

component("network") {
  configs += [ ":network_config" ]
  deps = [
    "//ash/components/arc:prefs",
    "//ash/constants",
    "//base",
    "//chromeos/ash/components/cryptohome",
    "//chromeos/ash/components/dbus/hermes",
    "//chromeos/ash/components/dbus/shill",
    "//chromeos/ash/components/feature_usage",
    "//chromeos/ash/components/install_attributes",
    "//chromeos/ash/components/login/login_state",
    "//chromeos/ash/components/network/metrics",
    "//chromeos/ash/components/network/onc",
    "//chromeos/ash/components/network/proxy",
    "//chromeos/ash/services/cellular_setup/public/mojom",
    "//chromeos/ash/services/hotspot_config/public/cpp",
    "//chromeos/ash/services/hotspot_config/public/mojom",
    "//chromeos/components/onc",
    "//chromeos/dbus/common",
    "//chromeos/dbus/permission_broker",
    "//chromeos/dbus/power",
    "//chromeos/dbus/power:power_manager_proto",
    "//chromeos/services/network_config/public/mojom",
    "//components/account_id",
    "//components/device_event_log",
    "//components/onc",
    "//components/pref_registry",
    "//components/prefs",
    "//components/url_formatter",
    "//components/user_manager",
    "//crypto",
    "//dbus",
    "//net",
    "//services/preferences/public/cpp",
    "//third_party/abseil-cpp:absl",
    "//third_party/re2",
    "//url",
  ]

  public_deps = [
    "//chromeos/ash/components/network/metrics",
    "//chromeos/ash/components/network/onc",
    "//chromeos/ash/components/network/proxy",
  ]

  # Allow circular dependency from sub-directories of
  # chromeos/ash/components/network.
  allow_circular_includes_from = [
    "//chromeos/ash/components/network/metrics",
    "//chromeos/ash/components/network/onc",
    "//chromeos/ash/components/network/proxy",
    "//chromeos/services/network_config/public/mojom",
    "//components/device_event_log",
  ]
  sources = [
    "auto_connect_handler.cc",
    "auto_connect_handler.h",
    "cellular_connection_handler.cc",
    "cellular_connection_handler.h",
    "cellular_esim_installer.cc",
    "cellular_esim_installer.h",
    "cellular_esim_profile.cc",
    "cellular_esim_profile.h",
    "cellular_esim_profile_handler.cc",
    "cellular_esim_profile_handler.h",
    "cellular_esim_profile_handler_impl.cc",
    "cellular_esim_profile_handler_impl.h",
    "cellular_esim_profile_waiter.cc",
    "cellular_esim_profile_waiter.h",
    "cellular_esim_uninstall_handler.cc",
    "cellular_esim_uninstall_handler.h",
    "cellular_inhibitor.cc",
    "cellular_inhibitor.h",
    "cellular_metrics_logger.cc",
    "cellular_metrics_logger.h",
    "cellular_policy_handler.cc",
    "cellular_policy_handler.h",
    "cellular_utils.cc",
    "cellular_utils.h",
    "certificate_helper.cc",
    "certificate_helper.h",
    "client_cert_resolver.cc",
    "client_cert_resolver.h",
    "client_cert_util.cc",
    "client_cert_util.h",
    "device_state.cc",
    "device_state.h",
    "enterprise_managed_metadata_store.cc",
    "enterprise_managed_metadata_store.h",
    "ephemeral_network_configuration_handler.cc",
    "ephemeral_network_configuration_handler.h",
    "ephemeral_network_policies_enablement_handler.cc",
    "ephemeral_network_policies_enablement_handler.h",
    "fake_network_state_handler.cc",
    "fake_network_state_handler.h",
    "fast_transition_observer.cc",
    "fast_transition_observer.h",
    "geolocation_handler.cc",
    "geolocation_handler.h",
    "hermes_metrics_util.cc",
    "hermes_metrics_util.h",
    "hidden_network_handler.cc",
    "hidden_network_handler.h",
    "hotspot_allowed_flag_handler.cc",
    "hotspot_allowed_flag_handler.h",
    "hotspot_capabilities_provider.cc",
    "hotspot_capabilities_provider.h",
    "hotspot_configuration_handler.cc",
    "hotspot_configuration_handler.h",
    "hotspot_controller.cc",
    "hotspot_controller.h",
    "hotspot_enabled_state_notifier.cc",
    "hotspot_enabled_state_notifier.h",
    "hotspot_state_handler.cc",
    "hotspot_state_handler.h",
    "hotspot_util.cc",
    "hotspot_util.h",
    "managed_cellular_pref_handler.cc",
    "managed_cellular_pref_handler.h",
    "managed_network_configuration_handler.cc",
    "managed_network_configuration_handler.h",
    "managed_network_configuration_handler_impl.cc",
    "managed_network_configuration_handler_impl.h",
    "managed_state.cc",
    "managed_state.h",
    "network_3gpp_handler.cc",
    "network_3gpp_handler.h",
    "network_activation_handler.h",
    "network_activation_handler_impl.cc",
    "network_activation_handler_impl.h",
    "network_cert_loader.cc",
    "network_cert_loader.h",
    "network_certificate_handler.cc",
    "network_certificate_handler.h",
    "network_config.cc",
    "network_config.h",
    "network_configuration_handler.cc",
    "network_configuration_handler.h",
    "network_configuration_observer.cc",
    "network_configuration_observer.h",
    "network_connect.cc",
    "network_connect.h",
    "network_connection_handler.cc",
    "network_connection_handler.h",
    "network_connection_handler_impl.cc",
    "network_connection_handler_impl.h",
    "network_connection_observer.cc",
    "network_connection_observer.h",
    "network_device_handler.cc",
    "network_device_handler.h",
    "network_device_handler_impl.cc",
    "network_device_handler_impl.h",
    "network_event_log.cc",
    "network_event_log.h",
    "network_handler.cc",
    "network_handler.h",
    "network_handler_callbacks.cc",
    "network_handler_callbacks.h",
    "network_ip_config.cc",
    "network_ip_config.h",
    "network_metadata_observer.cc",
    "network_metadata_observer.h",
    "network_metadata_store.cc",
    "network_metadata_store.h",
    "network_name_util.cc",
    "network_name_util.h",
    "network_profile.cc",
    "network_profile.h",
    "network_profile_handler.cc",
    "network_profile_handler.h",
    "network_profile_observer.h",
    "network_sms_handler.cc",
    "network_sms_handler.h",
    "network_state.cc",
    "network_state.h",
    "network_state_handler.cc",
    "network_state_handler.h",
    "network_state_handler_observer.cc",
    "network_state_handler_observer.h",
    "network_type_pattern.cc",
    "network_type_pattern.h",
    "network_ui_data.cc",
    "network_ui_data.h",
    "network_util.cc",
    "network_util.h",
    "policy_applicator.cc",
    "policy_applicator.h",
    "policy_certificate_provider.h",
    "policy_util.cc",
    "policy_util.h",
    "profile_policies.cc",
    "profile_policies.h",
    "prohibited_technologies_handler.cc",
    "prohibited_technologies_handler.h",
    "shill_property_handler.cc",
    "shill_property_handler.h",
    "shill_property_util.cc",
    "shill_property_util.h",
    "stub_cellular_networks_provider.cc",
    "stub_cellular_networks_provider.h",
    "system_token_cert_db_storage.cc",
    "system_token_cert_db_storage.h",
    "technology_state_controller.cc",
    "technology_state_controller.h",
    "tether_constants.cc",
    "tether_constants.h",
    "text_message_provider.cc",
    "text_message_provider.h",
    "text_message_suppression_state.h",
    "traffic_counters_handler.cc",
    "traffic_counters_handler.h",
  ]
}

source_set("test_support") {
  testonly = true
  public_deps = [
    ":network",
    "//chromeos/ash/components/dbus/hermes",
    "//chromeos/components/onc",
    "//dbus",
  ]
  deps = [
    "//ash/constants",
    "//base",
    "//chromeos:test_utils",
    "//chromeos/ash/components/dbus/shill",
    "//chromeos/ash/components/install_attributes:test_support",
    "//chromeos/components/onc:test_support",
    "//chromeos/services/network_config/public/mojom",
    "//components/onc",
    "//components/prefs",
    "//components/sync_preferences:test_support",
    "//dbus",
    "//net:test_support",
    "//testing/gmock",
    "//testing/gtest",
  ]
  sources = [
    "fake_network_3gpp_handler.cc",
    "fake_network_3gpp_handler.h",
    "fake_network_activation_handler.cc",
    "fake_network_activation_handler.h",
    "fake_network_connection_handler.cc",
    "fake_network_connection_handler.h",
    "fake_network_device_handler.cc",
    "fake_network_device_handler.h",
    "fake_network_metadata_store.cc",
    "fake_network_metadata_store.h",
    "fake_stub_cellular_networks_provider.cc",
    "fake_stub_cellular_networks_provider.h",
    "mock_managed_cellular_pref_handler.cc",
    "mock_managed_cellular_pref_handler.h",
    "mock_managed_network_configuration_handler.cc",
    "mock_managed_network_configuration_handler.h",
    "mock_network_device_handler.cc",
    "mock_network_device_handler.h",
    "mock_network_metadata_store.cc",
    "mock_network_metadata_store.h",
    "mock_network_state_handler.cc",
    "mock_network_state_handler.h",
    "network_handler_test_helper.cc",
    "network_handler_test_helper.h",
    "network_state_test_helper.cc",
    "network_state_test_helper.h",
    "network_test_helper_base.cc",
    "network_test_helper_base.h",
    "system_token_cert_db_storage_test_util.cc",
    "system_token_cert_db_storage_test_util.h",
    "test_cellular_esim_profile_handler.cc",
    "test_cellular_esim_profile_handler.h",
  ]
}

source_set("unit_tests") {
  testonly = true
  deps = [
    ":network",
    ":test_support",
    "//ash/components/arc:prefs",
    "//ash/constants",
    "//base",
    "//base:i18n",
    "//base/test:test_support",
    "//chromeos/ash/components/dbus:test_support",
    "//chromeos/ash/components/dbus/shill",
    "//chromeos/ash/components/feature_usage",
    "//chromeos/ash/components/install_attributes",
    "//chromeos/ash/components/install_attributes:test_support",
    "//chromeos/ash/components/login/login_state",
    "//chromeos/ash/components/network/metrics:test_support",
    "//chromeos/ash/components/network/metrics:unit_tests",
    "//chromeos/ash/components/network/onc:unit_tests",
    "//chromeos/ash/components/network/proxy:unit_tests",
    "//chromeos/ash/services/cellular_setup/public/mojom",
    "//chromeos/ash/services/hotspot_config/public/cpp",
    "//chromeos/ash/services/hotspot_config/public/cpp:test_support",
    "//chromeos/ash/services/hotspot_config/public/mojom",
    "//chromeos/ash/services/network_config:in_process_instance",
    "//chromeos/ash/services/network_config/public/cpp:test_support",
    "//chromeos/components/onc",
    "//chromeos/components/onc:test_support",
    "//chromeos/dbus/permission_broker",
    "//chromeos/dbus/power",
    "//chromeos/dbus/power:power_manager_proto",
    "//components/onc",
    "//components/prefs",
    "//components/prefs:test_support",
    "//components/proxy_config",
    "//components/sync_preferences:test_support",
    "//components/user_manager:test_support",
    "//crypto",
    "//crypto:test_support",
    "//dbus",
    "//net",
    "//net:test_support",
    "//testing/gmock",
    "//testing/gtest",
    "//third_party/abseil-cpp:absl",
  ]
  sources = [
    "auto_connect_handler_unittest.cc",
    "cellular_connection_handler_unittest.cc",
    "cellular_esim_installer_unittest.cc",
    "cellular_esim_profile_handler_impl_unittest.cc",
    "cellular_esim_profile_unittest.cc",
    "cellular_esim_profile_waiter_unittest.cc",
    "cellular_esim_uninstall_handler_unittest.cc",
    "cellular_inhibitor_unittest.cc",
    "cellular_metrics_logger_unittest.cc",
    "cellular_policy_handler_unittest.cc",
    "cellular_utils_unittest.cc",
    "certificate_helper_unittest.cc",
    "client_cert_resolver_unittest.cc",
    "client_cert_util_unittest.cc",
    "device_state_unittest.cc",
    "ephemeral_network_configuration_handler_unittest.cc",
    "ephemeral_network_policies_enablement_handler_unittest.cc",
    "fast_transition_observer_unittest.cc",
    "geolocation_handler_unittest.cc",
    "hidden_network_handler_unittest.cc",
    "hotspot_allowed_flag_handler_unittest.cc",
    "hotspot_capabilities_provider_unittest.cc",
    "hotspot_configuration_handler_unittest.cc",
    "hotspot_controller_concurrency_api_unittest.cc",
    "hotspot_controller_unittest.cc",
    "hotspot_enabled_state_notifier_unittest.cc",
    "hotspot_state_handler_unittest.cc",
    "managed_cellular_pref_handler_unittest.cc",
    "managed_network_configuration_handler_unittest.cc",
    "network_3gpp_handler_unittest.cc",
    "network_cert_loader_unittest.cc",
    "network_config_unittest.cc",
    "network_configuration_handler_unittest.cc",
    "network_connect_unittest.cc",
    "network_connection_handler_impl_unittest.cc",
    "network_device_handler_unittest.cc",
    "network_event_log_unittest.cc",
    "network_metadata_store_unittest.cc",
    "network_name_util_unittest.cc",
    "network_sms_handler_unittest.cc",
    "network_state_handler_unittest.cc",
    "network_state_unittest.cc",
    "network_type_pattern_unittest.cc",
    "network_ui_data_unittest.cc",
    "network_util_unittest.cc",
    "policy_util_unittest.cc",
    "profile_policies_unittest.cc",
    "prohibited_technologies_handler_unittest.cc",
    "shill_property_handler_unittest.cc",
    "shill_property_util_unittest.cc",
    "stub_cellular_networks_provider_unittest.cc",
    "system_token_cert_db_storage_unittest.cc",
    "technology_state_controller_unittest.cc",
    "text_message_provider_unittest.cc",
    "traffic_counters_handler_unittest.cc",
  ]
}