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

# Copyright 2023 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/config/chromeos/ui_mode.gni")
import("//third_party/protobuf/proto_library.gni")

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

component("carrier_lock") {
  output_name = "ash_carrier_lock"
  defines = [ "IS_CHROMEOS_ASH_COMPONENTS_CARRIER_LOCK_IMPL" ]

  deps = [
    ":carrier_lock_proto",
    "//ash/constants:constants",
    "//base",
    "//chromeos/ash/components/network",
    "//chromeos/ash/components/system",
    "//components/gcm_driver",
    "//components/prefs:prefs",
    "//components/session_manager/core",
    "//google_apis",
    "//services/network/public/cpp",
    "//third_party/private_membership:private_membership",
    "//third_party/private_membership:private_membership_proto",
    "//url",
  ]

  sources = [
    "carrier_lock_manager.cc",
    "carrier_lock_manager.h",
    "common.h",
    "fake_fcm_topic_subscriber.cc",
    "fake_fcm_topic_subscriber.h",
    "fake_provisioning_config_fetcher.cc",
    "fake_provisioning_config_fetcher.h",
    "fake_psm_claim_verifier.cc",
    "fake_psm_claim_verifier.h",
    "fcm_topic_subscriber.h",
    "fcm_topic_subscriber_impl.cc",
    "fcm_topic_subscriber_impl.h",
    "metrics.h",
    "provisioning_config_fetcher.h",
    "provisioning_config_fetcher_impl.cc",
    "provisioning_config_fetcher_impl.h",
    "psm_claim_verifier.h",
    "psm_claim_verifier_impl.cc",
    "psm_claim_verifier_impl.h",
    "topic_subscription_request.cc",
    "topic_subscription_request.h",
  ]
}

source_set("unit_tests") {
  testonly = true

  sources = [
    "carrier_lock_manager_unittest.cc",
    "fcm_topic_subscriber_unittest.cc",
    "provisioning_config_fetcher_unittest.cc",
    "psm_claim_verifier_unittest.cc",
    "psm_claim_verifier_unittest.h",
    "topic_subscription_request_unittest.cc",
  ]

  deps = [
    ":carrier_lock",
    ":carrier_lock_proto",
    "//ash/constants:constants",
    "//base",
    "//base/test:test_support",
    "//chromeos/ash/components/network",
    "//chromeos/ash/components/network:test_support",
    "//components/gcm_driver/instance_id:test_support",
    "//components/prefs:test_support",
    "//services/network:test_support",
    "//services/network/public/cpp",
    "//testing/gmock",
    "//testing/gtest",
    "//third_party/private_membership:private_membership",
    "//third_party/private_membership:private_membership_proto",
    "//url",
  ]
}

proto_library("carrier_lock_proto") {
  sources = [ "carrier_lock.proto" ]

  extra_configs =
      [ "//third_party/private_membership:private_membership_config" ]

  import_dirs = [
    "//third_party/private_membership/src",
    "//third_party/shell-encryption/src",
    ".",
  ]

  link_deps = [ "//third_party/private_membership:private_membership_proto" ]

  proto_out_dir = "chromeos/ash/components/carrier_lock"
}