chromium/chrome/browser/enterprise/connectors/device_trust/key_management/core/network/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.

source_set("common") {
  public = [
    "key_network_delegate.h",
    "key_upload_request.h",
    "util.h",
  ]

  sources = [
    "key_upload_request.cc",
    "util.cc",
  ]

  public_deps = [
    "//base",
    "//third_party/abseil-cpp:absl",
    "//url",
  ]

  deps = [
    "//chrome/browser/enterprise/connectors/device_trust/key_management/core",
    "//components/policy/proto",
    "//crypto",
  ]
}

source_set("network") {
  public = [ "mojo_key_network_delegate.h" ]

  sources = [ "mojo_key_network_delegate.cc" ]

  public_deps = [
    ":common",
    "//base",
    "//components/enterprise/client_certificates/core",
    "//net",
    "//url",
  ]

  deps = [
    "//chrome/browser/enterprise/connectors/device_trust/common",
    "//components/policy/proto",
    "//mojo/public/cpp/bindings",
    "//mojo/public/cpp/platform",
    "//services/network/public/cpp",
    "//services/network/public/mojom",
  ]
}

if (is_win) {
  source_set("win_key_network_delegate") {
    public = [ "win_key_network_delegate.h" ]

    sources = [ "win_key_network_delegate.cc" ]

    public_deps = [
      ":common",
      "//base",
      "//components/winhttp",
      "//net",
      "//url",
    ]

    deps = [ "//chrome/browser/enterprise/connectors/device_trust/key_management/core/network/fetcher" ]
  }
}

source_set("test_support") {
  testonly = true
  public = [ "mock_key_network_delegate.h" ]

  sources = [ "mock_key_network_delegate.cc" ]

  public_deps = [
    ":common",
    "//testing/gmock",
    "//url",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [ "mojo_key_network_delegate_unittest.cc" ]

  deps = [
    ":common",
    ":network",
    ":test_support",
    "//base",
    "//base/test:test_support",
    "//components/policy/proto",
    "//mojo/public/cpp/bindings",
    "//net",
    "//services/network:test_support",
    "//testing/gtest",
  ]

  if (is_win) {
    sources += [ "win_key_network_delegate_unittest.cc" ]

    deps += [
      ":win_key_network_delegate",
      "//chrome/browser/enterprise/connectors/device_trust/key_management/core/network/fetcher:test_support",
    ]
  }
}