chromium/chrome/browser/ash/drive/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")

assert(is_chromeos_ash)

static_library("drive") {
  sources = [
    "drive_integration_service.cc",
    "drive_integration_service.h",
    "drivefs_native_message_host_ash.cc",
    "drivefs_native_message_host_ash.h",
    "file_system_util.cc",
    "file_system_util.h",
  ]

  public_deps = [
    "//base",
    "//chrome/browser:browser_public_dependencies",
    "//chrome/browser/profiles:profile",
    "//chromeos/ash/components/drivefs",
    "//chromeos/ash/components/drivefs/mojom",
    "//chromeos/ash/components/network",
    "//chromeos/crosapi/mojom",
    "//components/drive",
    "//components/keyed_service/core",
    "//components/prefs",
    "//google_apis/common",
    "//mojo/public/cpp/bindings",
    "//third_party/abseil-cpp:absl",
  ]

  deps = [
    "//ash/constants",
    "//chrome/browser:browser_process",
    "//chrome/browser/ash/crosapi:browser_util",
    "//chrome/browser/ash/profiles",
    "//chrome/browser/chromeos/drivefs",
    "//chrome/browser/chromeos/drivefs:native_message_host_origins",
    "//chrome/browser/profiles",
    "//chrome/common:constants",
    "//chromeos/ash/components/drivefs/mojom:mojom_shared",
    "//chromeos/ash/components/drivefs/mojom:mojom_shared_cpp_sources",
    "//chromeos/ash/components/login/login_state",
    "//chromeos/components/drivefs/mojom",
    "//chromeos/constants",
    "//components/metrics:metrics_pref_names",
    "//components/pref_registry",
    "//components/signin/public/identity_manager",
    "//components/user_manager",
    "//content/public/browser",
    "//extensions/browser/api/messaging:native_messaging",
    "//google_apis",
    "//services/network/public/cpp",
    "//storage/browser",
    "//ui/base",
    "//ui/chromeos/strings",
  ]
}

static_library("test_support") {
  testonly = true

  sources = [
    "drive_integration_service_browser_test_base.cc",
    "drive_integration_service_browser_test_base.h",
    "drivefs_test_support.cc",
    "drivefs_test_support.h",
  ]

  public_deps = [
    ":drive",
    "//base",
    "//chrome/test:test_support_ui",
    "//chromeos/ash/components/drivefs",
    "//chromeos/ash/components/drivefs:test_support",
    "//components/account_id",
  ]

  deps = [
    "//base/test:test_support",
    "//chrome/browser/ash/profiles",
    "//chrome/browser/profiles:profile",
    "//chrome/common:constants",
    "//chrome/common:non_code_constants",
    "//components/drive",
    "//components/prefs",
    "//components/user_manager",
  ]
}

source_set("browser_tests") {
  testonly = true

  defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]

  sources = [ "drive_integration_service_browsertest.cc" ]

  deps = [
    ":drive",
    ":test_support",
    "//ash/constants",
    "//base",
    "//base/test:test_support",
    "//chrome/browser",
    "//chrome/browser/ash/file_manager",
    "//chrome/browser/profiles:profile",
    "//chrome/browser/ui",
    "//chromeos/ash/components/drivefs:test_support",
    "//chromeos/ash/components/drivefs/mojom",
    "//chromeos/components/drivefs/mojom",
    "//chromeos/crosapi/mojom",
    "//components/drive",
    "//components/prefs",
    "//components/prefs:test_support",
    "//content/test:test_support",
    "//mojo/public/cpp/bindings",
    "//storage/browser",
  ]
}

source_set("unit_tests") {
  testonly = true

  sources = [
    "drive_integration_service_unittest.cc",
    "file_system_util_unittest.cc",
  ]

  deps = [
    ":drive",
    "//ash/constants",
    "//base",
    "//chrome/browser/ash/login/users:test_support",
    "//chrome/test:test_support",
    "//chrome/test:test_support_ui",
    "//chromeos/ash/components/login/login_state",
    "//components/account_id",
    "//components/drive",
    "//components/prefs",
    "//components/user_manager",
    "//content/test:test_support",
    "//testing/gtest",
  ]
}