chromium/chromeos/ash/services/bluetooth_config/BUILD.gn

# Copyright 2021 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)

static_library("bluetooth_config") {
  sources = [
    "adapter_state_controller.cc",
    "adapter_state_controller.h",
    "adapter_state_controller_impl.cc",
    "adapter_state_controller_impl.h",
    "bluetooth_device_status_notifier.cc",
    "bluetooth_device_status_notifier.h",
    "bluetooth_device_status_notifier_impl.cc",
    "bluetooth_device_status_notifier_impl.h",
    "bluetooth_power_controller.h",
    "bluetooth_power_controller_impl.cc",
    "bluetooth_power_controller_impl.h",
    "cros_bluetooth_config.cc",
    "cros_bluetooth_config.h",
    "device_cache.cc",
    "device_cache.h",
    "device_cache_impl.cc",
    "device_cache_impl.h",
    "device_conversion_util.cc",
    "device_conversion_util.h",
    "device_name_manager.cc",
    "device_name_manager.h",
    "device_name_manager_impl.cc",
    "device_name_manager_impl.h",
    "device_operation_handler.cc",
    "device_operation_handler.h",
    "device_operation_handler_impl.cc",
    "device_operation_handler_impl.h",
    "device_pairing_handler.cc",
    "device_pairing_handler.h",
    "device_pairing_handler_impl.cc",
    "device_pairing_handler_impl.h",
    "discovered_devices_provider.cc",
    "discovered_devices_provider.h",
    "discovered_devices_provider_impl.cc",
    "discovered_devices_provider_impl.h",
    "discovery_session_manager.cc",
    "discovery_session_manager.h",
    "discovery_session_manager_impl.cc",
    "discovery_session_manager_impl.h",
    "discovery_session_status_notifier.cc",
    "discovery_session_status_notifier.h",
    "fast_pair_delegate.cc",
    "fast_pair_delegate.h",
    "initializer.h",
    "initializer_impl.cc",
    "initializer_impl.h",
    "system_properties_provider.cc",
    "system_properties_provider.h",
    "system_properties_provider_impl.cc",
    "system_properties_provider_impl.h",
  ]

  deps = [
    "//ash/constants",
    "//base",
    "//chromeos/ash/services/bluetooth_config/public/cpp",
    "//chromeos/ash/services/bluetooth_config/public/mojom",
    "//chromeos/ash/services/nearby/public/cpp",
    "//chromeos/dbus/power",
    "//components/device_event_log",
    "//components/pref_registry",
    "//components/prefs:prefs",
    "//components/session_manager/core",
    "//components/user_manager",
    "//device/bluetooth",
    "//device/bluetooth/public/cpp",
    "//mojo/public/cpp/bindings",
    "//third_party/re2",
  ]
}

component("in_process_bluetooth_config") {
  sources = [
    "in_process_instance.cc",
    "in_process_instance.h",
  ]

  defines = [ "IS_IN_PROCESS_BLUETOOTH_CONFIG_IMPL" ]

  public_deps = [
    "//ash/constants",
    "//chromeos/ash/services/bluetooth_config/public/mojom",
    "//mojo/public/cpp/bindings",
  ]

  deps = [
    ":bluetooth_config",
    "//components/device_event_log",
    "//device/bluetooth",
  ]
}

static_library("test_support") {
  testonly = true

  sources = [
    "fake_adapter_state_controller.cc",
    "fake_adapter_state_controller.h",
    "fake_bluetooth_device_status_notifier.cc",
    "fake_bluetooth_device_status_notifier.h",
    "fake_bluetooth_device_status_observer.cc",
    "fake_bluetooth_device_status_observer.h",
    "fake_bluetooth_discovery_delegate.cc",
    "fake_bluetooth_discovery_delegate.h",
    "fake_bluetooth_power_controller.cc",
    "fake_bluetooth_power_controller.h",
    "fake_device_cache.cc",
    "fake_device_cache.h",
    "fake_device_name_manager.cc",
    "fake_device_name_manager.h",
    "fake_device_operation_handler.cc",
    "fake_device_operation_handler.h",
    "fake_device_pairing_delegate.cc",
    "fake_device_pairing_delegate.h",
    "fake_device_pairing_handler.cc",
    "fake_device_pairing_handler.h",
    "fake_discovered_devices_provider.cc",
    "fake_discovered_devices_provider.h",
    "fake_discovery_session_manager.cc",
    "fake_discovery_session_manager.h",
    "fake_discovery_session_status_observer.cc",
    "fake_discovery_session_status_observer.h",
    "fake_fast_pair_delegate.cc",
    "fake_fast_pair_delegate.h",
    "fake_key_entered_handler.cc",
    "fake_key_entered_handler.h",
    "fake_system_properties_observer.cc",
    "fake_system_properties_observer.h",
    "scoped_bluetooth_config_test_helper.cc",
    "scoped_bluetooth_config_test_helper.h",
  ]

  deps = [
    ":bluetooth_config",
    ":in_process_bluetooth_config",
    "//base",
    "//chromeos/ash/services/bluetooth_config/public/cpp",
    "//chromeos/ash/services/bluetooth_config/public/mojom",
    "//components/session_manager/core",
    "//device/bluetooth",
    "//mojo/public/cpp/bindings",
  ]
}

source_set("unit_tests") {
  testonly = true

  sources = [
    "adapter_state_controller_impl_unittest.cc",
    "bluetooth_device_status_notifier_impl_unittest.cc",
    "bluetooth_power_controller_impl_unittest.cc",
    "cros_bluetooth_config_unittest.cc",
    "device_cache_impl_unittest.cc",
    "device_conversion_util_unittest.cc",
    "device_name_manager_impl_unittest.cc",
    "device_operation_handler_impl_unittest.cc",
    "device_pairing_handler_impl_unittest.cc",
    "discovered_devices_provider_impl_unittest.cc",
    "discovery_session_manager_impl_unittest.cc",
    "system_properties_provider_impl_unittest.cc",
  ]

  deps = [
    ":bluetooth_config",
    ":test_support",
    "//ash/constants",
    "//base",
    "//base/test:test_support",
    "//chromeos/ash/services/bluetooth_config/public/cpp",
    "//chromeos/ash/services/bluetooth_config/public/cpp:unit_tests",
    "//chromeos/ash/services/nearby/public/cpp",
    "//chromeos/dbus/power",
    "//components/session_manager/core",
    "//components/sync_preferences:test_support",
    "//components/user_manager:test_support",
    "//device/bluetooth:mocks",
    "//mojo/public/cpp/bindings",
    "//testing/gmock",
    "//testing/gtest",
  ]
}