chromium/chrome/browser/chromeos/extensions/odfs_config_private/BUILD.gn

# Copyright 2024 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")
import("//extensions/buildflags/buildflags.gni")

assert(enable_extensions)
assert(is_chromeos)

static_library("odfs_config_private") {
  sources = [
    "odfs_config_private_api.cc",
    "odfs_config_private_api.h",
  ]

  public_deps = [ "//extensions/browser" ]

  deps = [
    "//chrome/browser/profiles:profile",
    "//chrome/common/extensions/api",
    "//chromeos/constants",
  ]

  if (is_chromeos_ash) {
    deps += [ "//chrome/browser/ui/webui/ash/cloud_upload" ]
  }

  if (is_chromeos_lacros) {
    deps += [ "//chromeos/lacros" ]
  }
}

if (is_chromeos_ash) {
  source_set("browser_tests") {
    testonly = true

    defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]

    sources = [ "odfs_config_private_api_browsertest.cc" ]

    deps = [
      ":odfs_config_private",
      "//base",
      "//base/test:test_support",
      "//chrome/browser",
      "//chrome/browser/profiles:profile",
      "//chrome/test:test_support",
      "//chromeos/crosapi/mojom",
      "//content/test:test_support",
      "//extensions:test_support",
      "//testing/gmock",
      "//third_party/abseil-cpp:absl",
      "//ui/message_center/public/cpp",
    ]
  }
}

if (is_chromeos_lacros) {
  source_set("lacros_chrome_browsertests") {
    testonly = true

    defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]

    sources = [ "odfs_config_private_api_browsertest.cc" ]

    deps = [
      ":odfs_config_private",
      "//base",
      "//base/test:test_support",
      "//chrome/browser",
      "//chrome/browser/profiles:profile",
      "//chrome/test:test_support",
      "//chromeos/crosapi/mojom",
      "//chromeos/lacros",
      "//content/test:test_support",
      "//extensions:test_support",
      "//testing/gmock",
      "//third_party/abseil-cpp:absl",
      "//ui/message_center/public/cpp",
    ]
  }
}

source_set("unit_tests") {
  testonly = true

  sources = [ "odfs_config_private_api_unittest.cc" ]

  deps = [
    ":odfs_config_private",
    "//chrome/browser/profiles:profile",
    "//chrome/common:constants",
    "//chrome/common/extensions/api",
    "//chrome/test:test_support",
    "//chromeos/constants",
    "//components/prefs",
    "//testing/gmock",
    "//testing/gtest",
  ]

  if (is_chromeos_lacros) {
    deps += [ "//chromeos/startup" ]
  }
}