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

# Copyright 2018 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("secure_channel") {
  sources = [
    "active_connection_manager.cc",
    "active_connection_manager.h",
    "active_connection_manager_impl.cc",
    "active_connection_manager_impl.h",
    "authenticated_channel.cc",
    "authenticated_channel.h",
    "authenticated_channel_impl.cc",
    "authenticated_channel_impl.h",
    "authenticator.cc",
    "authenticator.h",
    "background_eid_generator.cc",
    "background_eid_generator.h",
    "ble_advertisement_generator.cc",
    "ble_advertisement_generator.h",
    "ble_advertiser.cc",
    "ble_advertiser.h",
    "ble_advertiser_impl.cc",
    "ble_advertiser_impl.h",
    "ble_characteristics_finder.cc",
    "ble_characteristics_finder.h",
    "ble_connection_manager.cc",
    "ble_connection_manager.h",
    "ble_connection_manager_impl.cc",
    "ble_connection_manager_impl.h",
    "ble_initiator_connection_attempt.cc",
    "ble_initiator_connection_attempt.h",
    "ble_initiator_failure_type.cc",
    "ble_initiator_failure_type.h",
    "ble_initiator_operation.cc",
    "ble_initiator_operation.h",
    "ble_listener_connection_attempt.cc",
    "ble_listener_connection_attempt.h",
    "ble_listener_failure_type.cc",
    "ble_listener_failure_type.h",
    "ble_listener_operation.cc",
    "ble_listener_operation.h",
    "ble_scanner.cc",
    "ble_scanner.h",
    "ble_scanner_impl.cc",
    "ble_scanner_impl.h",
    "ble_synchronizer.cc",
    "ble_synchronizer.h",
    "ble_synchronizer_base.cc",
    "ble_synchronizer_base.h",
    "ble_weave_client_connection.cc",
    "ble_weave_client_connection.h",
    "ble_weave_defines.h",
    "ble_weave_packet_generator.cc",
    "ble_weave_packet_generator.h",
    "ble_weave_packet_receiver.cc",
    "ble_weave_packet_receiver.h",
    "bluetooth_helper.cc",
    "bluetooth_helper.h",
    "bluetooth_helper_impl.cc",
    "bluetooth_helper_impl.h",
    "channel_impl.cc",
    "channel_impl.h",
    "client_connection_parameters.cc",
    "client_connection_parameters.h",
    "client_connection_parameters_impl.cc",
    "client_connection_parameters_impl.h",
    "connect_to_device_operation.h",
    "connect_to_device_operation_base.h",
    "connection.cc",
    "connection.h",
    "connection_attempt.h",
    "connection_attempt_base.h",
    "connection_attempt_delegate.h",
    "connection_attempt_details.cc",
    "connection_attempt_details.h",
    "connection_details.cc",
    "connection_details.h",
    "connection_metrics_logger.cc",
    "connection_metrics_logger.h",
    "connection_observer.h",
    "connection_role.cc",
    "connection_role.h",
    "data_with_timestamp.cc",
    "data_with_timestamp.h",
    "device_id_pair.cc",
    "device_id_pair.h",
    "device_to_device_authenticator.cc",
    "device_to_device_authenticator.h",
    "device_to_device_initiator_helper.cc",
    "device_to_device_initiator_helper.h",
    "device_to_device_secure_context.cc",
    "device_to_device_secure_context.h",
    "error_tolerant_ble_advertisement.cc",
    "error_tolerant_ble_advertisement.h",
    "error_tolerant_ble_advertisement_impl.cc",
    "error_tolerant_ble_advertisement_impl.h",
    "file_transfer_update_callback.h",
    "foreground_eid_generator.cc",
    "foreground_eid_generator.h",
    "multiplexed_channel.cc",
    "multiplexed_channel.h",
    "multiplexed_channel_impl.cc",
    "multiplexed_channel_impl.h",
    "nearby_connection.cc",
    "nearby_connection.h",
    "nearby_connection_manager.cc",
    "nearby_connection_manager.h",
    "nearby_connection_manager_impl.cc",
    "nearby_connection_manager_impl.h",
    "nearby_connection_metrics_recorder.cc",
    "nearby_connection_metrics_recorder.h",
    "nearby_initiator_connection_attempt.cc",
    "nearby_initiator_connection_attempt.h",
    "nearby_initiator_failure_type.cc",
    "nearby_initiator_failure_type.h",
    "nearby_initiator_operation.cc",
    "nearby_initiator_operation.h",
    "pending_ble_connection_request_base.h",
    "pending_ble_initiator_connection_request.cc",
    "pending_ble_initiator_connection_request.h",
    "pending_ble_listener_connection_request.cc",
    "pending_ble_listener_connection_request.h",
    "pending_connection_manager.cc",
    "pending_connection_manager.h",
    "pending_connection_manager_impl.cc",
    "pending_connection_manager_impl.h",
    "pending_connection_request.h",
    "pending_connection_request_base.h",
    "pending_connection_request_delegate.cc",
    "pending_connection_request_delegate.h",
    "pending_nearby_initiator_connection_request.cc",
    "pending_nearby_initiator_connection_request.h",
    "presence_monitor_delegate.cc",
    "presence_monitor_delegate.h",
    "presence_monitor_impl.cc",
    "presence_monitor_impl.h",
    "raw_eid_generator.h",
    "raw_eid_generator_impl.cc",
    "raw_eid_generator_impl.h",
    "remote_attribute.h",
    "secure_channel.cc",
    "secure_channel.h",
    "secure_channel_base.cc",
    "secure_channel_base.h",
    "secure_channel_disconnector.h",
    "secure_channel_disconnector_impl.cc",
    "secure_channel_disconnector_impl.h",
    "secure_channel_impl.cc",
    "secure_channel_impl.h",
    "secure_channel_initializer.cc",
    "secure_channel_initializer.h",
    "secure_context.h",
    "session_keys.cc",
    "session_keys.h",
    "shared_resource_scheduler.cc",
    "shared_resource_scheduler.h",
    "single_client_proxy.cc",
    "single_client_proxy.h",
    "single_client_proxy_impl.cc",
    "single_client_proxy_impl.h",
    "wire_message.cc",
    "wire_message.h",
  ]

  deps = [
    "//ash/constants",
    "//base",
    "//chromeos",
    "//chromeos/ash/components/multidevice",
    "//chromeos/ash/components/multidevice/logging",
    "//chromeos/ash/components/timer_factory",
    "//chromeos/ash/services/device_sync/proto",
    "//chromeos/ash/services/secure_channel/public/cpp/shared",
    "//chromeos/ash/services/secure_channel/public/mojom",
    "//crypto",
    "//device/bluetooth",
    "//device/bluetooth/public/cpp",
  ]

  public_deps = [
    "//third_party/securemessage/proto",
    "//third_party/ukey2:proto",
  ]

  visibility = [
    ":*",
    "//chrome/browser/ash",
    "//chrome/browser/ash/eche_app",
    "//chrome/browser/ash/secure_channel",
    "//chrome/browser/chromeos",
    "//chromeos/ash/services/secure_channel/public/cpp/client:unit_tests",
  ]
}

static_library("test_support") {
  testonly = true

  sources = [
    "device_to_device_responder_operations.cc",
    "device_to_device_responder_operations.h",
    "fake_active_connection_manager.cc",
    "fake_active_connection_manager.h",
    "fake_authenticated_channel.cc",
    "fake_authenticated_channel.h",
    "fake_authenticator.cc",
    "fake_authenticator.h",
    "fake_background_eid_generator.cc",
    "fake_background_eid_generator.h",
    "fake_ble_advertisement_generator.cc",
    "fake_ble_advertisement_generator.h",
    "fake_ble_advertiser.cc",
    "fake_ble_advertiser.h",
    "fake_ble_connection_manager.cc",
    "fake_ble_connection_manager.h",
    "fake_ble_scanner.cc",
    "fake_ble_scanner.h",
    "fake_ble_synchronizer.cc",
    "fake_ble_synchronizer.h",
    "fake_bluetooth_helper.cc",
    "fake_bluetooth_helper.h",
    "fake_channel.cc",
    "fake_channel.h",
    "fake_client_connection_parameters.cc",
    "fake_client_connection_parameters.h",
    "fake_connect_to_device_operation.h",
    "fake_connection.cc",
    "fake_connection.h",
    "fake_connection_attempt.h",
    "fake_connection_attempt_delegate.cc",
    "fake_connection_attempt_delegate.h",
    "fake_connection_delegate.cc",
    "fake_connection_delegate.h",
    "fake_error_tolerant_ble_advertisement.cc",
    "fake_error_tolerant_ble_advertisement.h",
    "fake_file_payload_listener.cc",
    "fake_file_payload_listener.h",
    "fake_message_receiver.cc",
    "fake_message_receiver.h",
    "fake_multiplexed_channel.cc",
    "fake_multiplexed_channel.h",
    "fake_nearby_connection_manager.cc",
    "fake_nearby_connection_manager.h",
    "fake_nearby_connection_state_listener.cc",
    "fake_nearby_connection_state_listener.h",
    "fake_pending_connection_manager.cc",
    "fake_pending_connection_manager.h",
    "fake_pending_connection_request.h",
    "fake_pending_connection_request_delegate.cc",
    "fake_pending_connection_request_delegate.h",
    "fake_secure_channel.cc",
    "fake_secure_channel.h",
    "fake_secure_channel_connection.cc",
    "fake_secure_channel_connection.h",
    "fake_secure_channel_disconnector.cc",
    "fake_secure_channel_disconnector.h",
    "fake_secure_context.cc",
    "fake_secure_context.h",
    "fake_single_client_proxy.cc",
    "fake_single_client_proxy.h",
    "fake_wire_message.cc",
    "fake_wire_message.h",
    "mock_foreground_eid_generator.cc",
    "mock_foreground_eid_generator.h",
    "register_payload_file_request.cc",
    "register_payload_file_request.h",
  ]

  public_deps = [ ":secure_channel" ]

  deps = [
    "//base",
    "//base/test:test_support",
    "//chromeos/ash/components/multidevice",
    "//chromeos/ash/components/multidevice/logging",
    "//chromeos/ash/components/timer_factory",
    "//chromeos/ash/services/secure_channel/public/cpp/shared",
    "//chromeos/ash/services/secure_channel/public/mojom",
    "//device/bluetooth",
    "//testing/gmock",
  ]
}

source_set("unit_tests") {
  testonly = true

  sources = [
    "active_connection_manager_impl_unittest.cc",
    "authenticated_channel_impl_unittest.cc",
    "background_eid_generator_unittest.cc",
    "ble_advertisement_generator_unittest.cc",
    "ble_advertiser_impl_unittest.cc",
    "ble_characteristics_finder_unittest.cc",
    "ble_connection_manager_impl_unittest.cc",
    "ble_initiator_operation_unittest.cc",
    "ble_listener_operation_unittest.cc",
    "ble_scanner_impl_unittest.cc",
    "ble_synchronizer_unittest.cc",
    "ble_weave_client_connection_unittest.cc",
    "ble_weave_packet_generator_unittest.cc",
    "ble_weave_packet_receiver_unittest.cc",
    "bluetooth_helper_impl_unittest.cc",
    "client_connection_parameters_impl_unittest.cc",
    "connect_to_device_operation_base_unittest.cc",
    "connection_attempt_base_unittest.cc",
    "connection_unittest.cc",
    "device_to_device_authenticator_unittest.cc",
    "device_to_device_operations_unittest.cc",
    "device_to_device_secure_context_unittest.cc",
    "error_tolerant_ble_advertisement_impl_unittest.cc",
    "foreground_eid_generator_unittest.cc",
    "multiplexed_channel_impl_unittest.cc",
    "nearby_connection_manager_impl_unittest.cc",
    "nearby_connection_metrics_recorder_unittest.cc",
    "nearby_connection_unittest.cc",
    "nearby_initiator_operation_unittest.cc",
    "pending_ble_connection_request_base_unittest.cc",
    "pending_ble_initiator_connection_request_unittest.cc",
    "pending_ble_listener_connection_request_unittest.cc",
    "pending_connection_manager_impl_unittest.cc",
    "pending_connection_request_base_unittest.cc",
    "pending_nearby_initiator_connection_request_unittest.cc",
    "raw_eid_generator_impl_unittest.cc",
    "secure_channel_disconnector_impl_unittest.cc",
    "secure_channel_service_unittest.cc",
    "secure_channel_unittest.cc",
    "session_keys_unittest.cc",
    "shared_resource_scheduler_unittest.cc",
    "single_client_proxy_impl_unittest.cc",
    "wire_message_unittest.cc",
  ]

  public_deps = [ ":secure_channel" ]

  deps = [
    ":test_support",
    "//base/test:test_support",
    "//chromeos/ash/components/multidevice",
    "//chromeos/ash/components/multidevice:test_support",
    "//chromeos/ash/components/multidevice/logging",
    "//chromeos/ash/components/timer_factory:test_support",
    "//chromeos/ash/components/timer_factory:timer_factory",
    "//chromeos/ash/services/secure_channel/public/cpp/client:test_support",
    "//chromeos/ash/services/secure_channel/public/cpp/client:unit_tests",
    "//chromeos/ash/services/secure_channel/public/cpp/shared",
    "//chromeos/ash/services/secure_channel/public/mojom",
    "//chromeos/ash/services/secure_channel/public/mojom:unit_tests",
    "//device/bluetooth:mocks",
    "//testing/gmock",
    "//testing/gtest",
  ]
}