chromium/components/webauthn/core/browser/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/features.gni")

source_set("browser") {
  sources = [
    "passkey_data_type_controller.cc",
    "passkey_data_type_controller.h",
  ]
  deps = [ "//components/sync" ]

  if (!is_ios) {
    sources += [ "internal_authenticator.h" ]

    deps += [
      "//third_party/blink/public/common",
      "//url",
    ]
  }

  if (!is_android) {
    sources += [
      "passkey_sync_bridge.cc",
      "passkey_sync_bridge.h",
    ]
    deps += [
      ":passkey_model",
      "//base",
    ]
  }
}

source_set("passkey_model") {
  sources = [
    "passkey_model.cc",
    "passkey_model.h",
    "passkey_model_change.cc",
    "passkey_model_change.h",
    "passkey_model_utils.cc",
    "passkey_model_utils.h",
  ]
  deps = [
    "//base",
    "//components/cbor",
    "//components/keyed_service/core",
    "//components/sync/protocol",
    "//crypto",
    "//device/fido",
  ]
  frameworks = [ "Foundation.framework" ]
}

source_set("unit_tests") {
  testonly = true
  sources = []
  deps = []

  if (!is_ios && !is_android) {
    sources += [ "passkey_model_utils_unittest.cc" ]
    deps += [
      ":browser",
      ":passkey_model",
      "//base/test:test_support",
      "//components/sync/protocol",
      "//crypto",
    ]
  }
}

static_library("test_support") {
  testonly = true
  sources = []
  deps = []

  if (use_blink) {
    sources += [
      "mock_internal_authenticator.cc",
      "mock_internal_authenticator.h",
    ]
    deps += [
      ":browser",
      "//content/public/browser",
      "//testing/gmock",
    ]
  }
  if (!is_android) {
    sources += [
      "test_passkey_model.cc",
      "test_passkey_model.h",
    ]
    deps += [
      ":passkey_model",
      "//base",
      "//components/sync",
    ]
  }
}