chromium/chrome/browser/ash/dbus/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/chromebox_for_meetings/buildflags.gni")
import("//build/config/chromeos/ui_mode.gni")

assert(is_chromeos_ash)

static_library("dbus") {
  sources = [
    "arc_tracing_service_provider.cc",
    "arc_tracing_service_provider.h",
    "ash_dbus_helper.cc",
    "ash_dbus_helper.h",
    "chrome_features_service_provider.cc",
    "chrome_features_service_provider.h",
    "component_updater_service_provider.cc",
    "component_updater_service_provider.h",
    "cryptohome_key_delegate_service_provider.cc",
    "cryptohome_key_delegate_service_provider.h",
    "dlp_files_policy_service_provider.cc",
    "dlp_files_policy_service_provider.h",
    "drive_file_stream_service_provider.cc",
    "drive_file_stream_service_provider.h",
    "encrypted_reporting_service_provider.cc",
    "encrypted_reporting_service_provider.h",
    "fusebox_service_provider.cc",
    "fusebox_service_provider.h",
    "kiosk_info_service_provider.cc",
    "kiosk_info_service_provider.h",
    "libvda_service_provider.cc",
    "libvda_service_provider.h",
    "lock_to_single_user_service_provider.cc",
    "lock_to_single_user_service_provider.h",
    "machine_learning_decision_service_provider.cc",
    "machine_learning_decision_service_provider.h",
    "metrics_event_service_provider.cc",
    "metrics_event_service_provider.h",
    "mojo_connection_service_provider.cc",
    "mojo_connection_service_provider.h",
    "printers_service_provider.cc",
    "printers_service_provider.h",
    "proxy_resolution_service_provider.cc",
    "proxy_resolution_service_provider.h",
    "screen_lock_service_provider.cc",
    "screen_lock_service_provider.h",
    "smb_fs_service_provider.cc",
    "smb_fs_service_provider.h",
    "virtual_file_request_service_provider.cc",
    "virtual_file_request_service_provider.h",
  ]

  public_deps = [
    "//base",
    "//chrome/browser:browser_public_dependencies",
    "//chrome/browser/ash/fusebox",
    "//chrome/browser/policy/messaging_layer/storage_selector",
    "//chrome/browser/resource_coordinator:tab_lifecycle_observer",
    "//chromeos/ash/components/dbus:metrics_event_proto",
    "//chromeos/ash/components/dbus/services",
    "//chromeos/dbus/missive",
    "//components/reporting/proto:record_proto",
    "//components/reporting/resources:resource_manager",
    "//dbus",
    "//mojo/public/cpp/platform",
    "//mojo/public/cpp/system",
    "//net",
    "//storage/browser",
  ]

  deps = [
    "//ash/components/arc:arc_features",
    "//ash/constants",
    "//ash/webui/shimless_rma",
    "//build:chromeos_buildflags",
    "//build/config/chromebox_for_meetings:buildflags",
    "//chrome/browser:browser_process",
    "//chrome/browser/ash/app_mode",
    "//chrome/browser/ash/arc/fileapi",
    "//chrome/browser/ash/arc/session",
    "//chrome/browser/ash/arc/tracing",
    "//chrome/browser/ash/arc/video",
    "//chrome/browser/ash/crostini",
    "//chrome/browser/ash/login/lock",
    "//chrome/browser/ash/net",
    "//chrome/browser/ash/net/rollback_network_config",
    "//chrome/browser/ash/plugin_vm",
    "//chrome/browser/ash/policy/dlp",
    "//chrome/browser/ash/policy/handlers",
    "//chrome/browser/ash/power/ml",
    "//chrome/browser/ash/printing",
    "//chrome/browser/ash/profiles",
    "//chrome/browser/ash/settings",
    "//chrome/browser/chromeos",
    "//chrome/browser/chromeos/policy/dlp",
    "//chrome/browser/profiles:profile",
    "//chrome/common:chrome_features",
    "//chrome/common:constants",
    "//chromeos/ash/components/attestation",
    "//chromeos/ash/components/browser_context_helper",
    "//chromeos/ash/components/cryptohome",
    "//chromeos/ash/components/dbus",
    "//chromeos/ash/components/dbus/anomaly_detector",
    "//chromeos/ash/components/dbus/arc",
    "//chromeos/ash/components/dbus/attestation",
    "//chromeos/ash/components/dbus/audio",
    "//chromeos/ash/components/dbus/biod",
    "//chromeos/ash/components/dbus/cdm_factory_daemon",
    "//chromeos/ash/components/dbus/cec_service",
    "//chromeos/ash/components/dbus/chaps",
    "//chromeos/ash/components/dbus/chunneld",
    "//chromeos/ash/components/dbus/cicerone",
    "//chromeos/ash/components/dbus/concierge",
    "//chromeos/ash/components/dbus/cros_disks",
    "//chromeos/ash/components/dbus/cryptohome:cryptohome_proto",
    "//chromeos/ash/components/dbus/cups_proxy",
    "//chromeos/ash/components/dbus/debug_daemon",
    "//chromeos/ash/components/dbus/device_management",
    "//chromeos/ash/components/dbus/dlcservice",
    "//chromeos/ash/components/dbus/easy_unlock",
    "//chromeos/ash/components/dbus/featured",
    "//chromeos/ash/components/dbus/federated",
    "//chromeos/ash/components/dbus/gnubby",
    "//chromeos/ash/components/dbus/hermes",
    "//chromeos/ash/components/dbus/human_presence",
    "//chromeos/ash/components/dbus/image_burner",
    "//chromeos/ash/components/dbus/image_loader",
    "//chromeos/ash/components/dbus/kerberos",
    "//chromeos/ash/components/dbus/lorgnette_manager",
    "//chromeos/ash/components/dbus/media_analytics",
    "//chromeos/ash/components/dbus/oobe_config",
    "//chromeos/ash/components/dbus/os_install",
    "//chromeos/ash/components/dbus/patchpanel",
    "//chromeos/ash/components/dbus/pciguard",
    "//chromeos/ash/components/dbus/printscanmgr",
    "//chromeos/ash/components/dbus/private_computing",
    "//chromeos/ash/components/dbus/resourced",
    "//chromeos/ash/components/dbus/rgbkbd",
    "//chromeos/ash/components/dbus/rmad",
    "//chromeos/ash/components/dbus/runtime_probe",
    "//chromeos/ash/components/dbus/seneschal",
    "//chromeos/ash/components/dbus/session_manager",
    "//chromeos/ash/components/dbus/shill",
    "//chromeos/ash/components/dbus/smbprovider",
    "//chromeos/ash/components/dbus/spaced",
    "//chromeos/ash/components/dbus/swap_management",
    "//chromeos/ash/components/dbus/system_clock",
    "//chromeos/ash/components/dbus/system_proxy",
    "//chromeos/ash/components/dbus/typecd",
    "//chromeos/ash/components/dbus/update_engine",
    "//chromeos/ash/components/dbus/upstart",
    "//chromeos/ash/components/dbus/userdataauth",
    "//chromeos/ash/components/dbus/virtual_file_provider",
    "//chromeos/ash/components/dbus/vm_plugin_dispatcher",
    "//chromeos/ash/components/install_attributes",
    "//chromeos/ash/components/language_packs",
    "//chromeos/ash/components/settings",
    "//chromeos/ash/services/rollback_network_config/public/mojom",
    "//chromeos/components/mojo_bootstrap",
    "//chromeos/dbus/constants",
    "//chromeos/dbus/dlp",
    "//chromeos/dbus/dlp:dlp_proto",
    "//chromeos/dbus/init",
    "//chromeos/dbus/ip_peripheral",
    "//chromeos/dbus/machine_learning",
    "//chromeos/dbus/missive:history_tracker",
    "//chromeos/dbus/permission_broker",
    "//chromeos/dbus/power",
    "//chromeos/dbus/regmon",
    "//chromeos/dbus/tpm_manager",
    "//chromeos/dbus/u2f",
    "//components/account_id",
    "//components/prefs",
    "//components/reporting/proto:interface_proto",
    "//components/reporting/proto:status_proto",
    "//components/reporting/util:status",
    "//components/user_manager",
    "//content/public/browser",
    "//device/bluetooth",
    "//extensions/common",
    "//mojo/public/cpp/bindings",
    "//services/network/public/mojom",
    "//third_party/boringssl",
    "//ui/aura",
    "//url",
  ]

  if (is_cfm) {
    deps += [
      "//chromeos/ash/components/chromebox_for_meetings",
      "//chromeos/ash/components/dbus/chromebox_for_meetings",
    ]
  }
}

action("dbus_service_files") {
  sources = [
    "org.chromium.ArcTracing.conf",
    "org.chromium.ChromeFeaturesService.conf",
    "org.chromium.ComponentUpdaterService.conf",
    "org.chromium.CryptohomeKeyDelegate.conf",
    "org.chromium.DlpFilesPolicyService.conf",
    "org.chromium.DriveFileStreamService.conf",
    "org.chromium.EncryptedReportingUploadService.conf",
    "org.chromium.FuseBoxService.conf",
    "org.chromium.KioskAppService.conf",
    "org.chromium.LibvdaService.conf",
    "org.chromium.LockToSingleUser.conf",
    "org.chromium.MachineLearningDecisionService.conf",
    "org.chromium.MetricsEventService.conf",
    "org.chromium.MojoConnectionService.conf",
    "org.chromium.NetworkProxyService.conf",
    "org.chromium.PrintersService.conf",
    "org.chromium.ProfilerStatusService.conf",
    "org.chromium.ScreenLockService.conf",
    "org.chromium.SmbFsService.conf",
    "org.chromium.VirtualFileRequestService.conf",
    "vm/org.chromium.PluginVmService.conf",
    "vm/org.chromium.VmApplicationsService.conf",
    "vm/org.chromium.VmLaunchService.conf",
    "vm/org.chromium.VmPermissionService.conf",
    "vm/org.chromium.VmSKForwardingService.conf",
    "vm/org.chromium.VmWlService.conf",
  ]
  output_conf_file = "$root_out_dir/dbus/chrome_dbus_services.conf"
  outputs = [ output_conf_file ]

  script = "//chromeos/tools/concat_dbus_conf_files.py"
  args = [ rebase_path(output_conf_file, root_build_dir) ]
  args += rebase_path(sources, root_build_dir)
}

source_set("unit_tests") {
  testonly = true

  sources = [
    "arc_tracing_service_provider_unittest.cc",
    "chrome_features_service_provider_unittest.cc",
    "dlp_files_policy_service_provider_unittest.cc",
    "encrypted_reporting_service_provider_unittest.cc",
    "proxy_resolution_service_provider_unittest.cc",
  ]

  deps = [
    ":dbus",
    "//ash/components/arc:arc_test_support",
    "//ash/constants",
    "//base",
    "//base/test:test_support",
    "//chrome/browser",
    "//chrome/browser/ash/arc/tracing",
    "//chrome/browser/ash/arc/tracing/test:test_support",
    "//chrome/browser/ash/net",
    "//chrome/browser/ash/policy/dlp",
    "//chrome/browser/ash/policy/dlp/test:test_support",
    "//chrome/browser/chromeos",
    "//chrome/browser/chromeos/policy/dlp",
    "//chrome/browser/chromeos/policy/dlp/test:test_support",
    "//chrome/test:test_support",
    "//chromeos/ash/components/dbus/services:test_support",
    "//chromeos/ash/components/dbus/system_proxy",
    "//chromeos/ash/components/install_attributes:test_support",
    "//chromeos/ash/components/network:test_support",
    "//chromeos/dbus/dlp:dlp_proto",
    "//chromeos/dbus/missive",
    "//components/exo",
    "//components/policy/core/common:test_support",
    "//components/reporting/proto:interface_proto",
    "//content/test:test_support",
    "//dbus",
    "//mojo/public/cpp/bindings",
    "//net",
    "//services/network:test_support",
    "//services/network/public/mojom",
    "//testing/gmock",
    "//testing/gtest",
  ]
}

source_set("browser_tests") {
  testonly = true

  defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]

  sources = [
    "cryptohome_key_delegate_service_provider_browsertest.cc",
    "proxy_resolution_service_provider_browsertest.cc",
  ]

  deps = [
    ":dbus",
    "//ash/constants",
    "//base",
    "//base/test:test_support",
    "//chrome/browser",
    "//chrome/browser/ash/login:test_support",
    "//chrome/browser/ash/net",
    "//chrome/browser/profiles:profile",
    "//chrome/browser/ui",
    "//chrome/common:non_code_constants",
    "//chrome/test:test_support",
    "//chrome/test:test_support_ui",
    "//chromeos/ash/components/cryptohome",
    "//chromeos/ash/components/dbus/constants",
    "//chromeos/ash/components/dbus/cryptohome:cryptohome_proto",
    "//chromeos/ash/components/dbus/services:test_support",
    "//components/account_id",
    "//components/user_manager",
    "//content/public/browser",
    "//content/public/common",
    "//content/test:test_support",
    "//crypto",
    "//dbus",
    "//extensions/common",
    "//net",
    "//testing/gtest",
  ]
}