chromium/chrome/browser/ash/crostini/BUILD.gn

# Copyright 2019 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("//mojo/public/tools/bindings/mojom.gni")

assert(is_chromeos_ash)

mojom("crostini_installer_types_mojom") {
  webui_module_path = "/"

  # For Closure Compiler targets in chrome/browser/resources/chromeos/crostini
  generate_webui_js_bindings = true
  sources = [ "crostini_types.mojom" ]
}

static_library("crostini") {
  sources = [
    "crostini_disk.cc",
    "crostini_disk.h",
    "crostini_export_import.cc",
    "crostini_export_import.h",
    "crostini_export_import_notification_controller.cc",
    "crostini_export_import_notification_controller.h",
    "crostini_export_import_status_tracker.cc",
    "crostini_export_import_status_tracker.h",
    "crostini_features.cc",
    "crostini_features.h",
    "crostini_file_selector.cc",
    "crostini_file_selector.h",
    "crostini_force_close_watcher.cc",
    "crostini_force_close_watcher.h",
    "crostini_installer.cc",
    "crostini_installer.h",
    "crostini_installer_ui_delegate.h",
    "crostini_low_disk_notification.cc",
    "crostini_low_disk_notification.h",
    "crostini_manager.cc",
    "crostini_manager.h",
    "crostini_manager_factory.cc",
    "crostini_manager_factory.h",
    "crostini_metrics_service.cc",
    "crostini_metrics_service.h",
    "crostini_mount_provider.cc",
    "crostini_mount_provider.h",
    "crostini_package_notification.cc",
    "crostini_package_notification.h",
    "crostini_package_operation_status.h",
    "crostini_package_service.cc",
    "crostini_package_service.h",
    "crostini_port_forwarder.cc",
    "crostini_port_forwarder.h",
    "crostini_pref_names.cc",
    "crostini_pref_names.h",
    "crostini_reporting_util.cc",
    "crostini_reporting_util.h",
    "crostini_security_delegate.cc",
    "crostini_security_delegate.h",
    "crostini_shared_devices.cc",
    "crostini_shared_devices.h",
    "crostini_simple_types.cc",
    "crostini_simple_types.h",
    "crostini_sshfs.cc",
    "crostini_sshfs.h",
    "crostini_terminal_provider.cc",
    "crostini_terminal_provider.h",
    "crostini_unsupported_action_notifier.cc",
    "crostini_unsupported_action_notifier.h",
    "crostini_upgrade_available_notification.cc",
    "crostini_upgrade_available_notification.h",
    "crostini_upgrader.cc",
    "crostini_upgrader.h",
    "crostini_upgrader_ui_delegate.h",
    "crostini_util.cc",
    "crostini_util.h",
    "termina_installer.cc",
    "termina_installer.h",
  ]

  public_deps = [
    "//ash/public/cpp",
    "//ash/webui/settings/public/constants:mojom",
    "//base",
    "//chrome/browser:browser_process",
    "//chrome/browser:browser_public_dependencies",
    "//chrome/browser/ash/drive",
    "//chrome/browser/profiles:profile",
    "//chromeos/dbus/power",
    "//components/exo",
    "//components/keyed_service/core",
    "//content/public/browser",
    "//storage/browser",
    "//ui/aura",
    "//ui/display",
    "//ui/message_center/public/cpp",
    "//ui/shell_dialogs",
    "//ui/views",
    "//ui/wm/public",
  ]

  deps = [
    ":crostini_installer_types_mojom",
    "//ash/constants",
    "//ash/resources/vector_icons",
    "//chrome/app/vector_icons",
    "//chrome/browser:primitives",
    "//chrome/browser/ash/accessibility",
    "//chrome/browser/ash/app_list",
    "//chrome/browser/ash/borealis",
    "//chrome/browser/ash/crostini/ansible",
    "//chrome/browser/ash/crostini/throttle",
    "//chrome/browser/ash/guest_os/public",
    "//chrome/browser/ash/guest_os/virtual_machines",
    "//chrome/browser/ash/policy/core",
    "//chrome/browser/ash/profiles",
    "//chrome/browser/ash/scheduler_config",
    "//chrome/browser/ui:browser_navigator_params_headers",
    "//chrome/browser/ui/webui/ash",
    "//chrome/browser/ui/webui/ash/crostini_installer",
    "//chrome/browser/ui/webui/ash/crostini_upgrader:mojo_bindings",
    "//chrome/common",
    "//chrome/common:chrome_features",
    "//chrome/common:constants",
    "//chromeos/ash/components/dbus/anomaly_detector",
    "//chromeos/ash/components/dbus/anomaly_detector:proto",
    "//chromeos/ash/components/dbus/cicerone",
    "//chromeos/ash/components/dbus/cicerone:cicerone_proto",
    "//chromeos/ash/components/dbus/concierge",
    "//chromeos/ash/components/dbus/concierge:concierge_proto",
    "//chromeos/ash/components/dbus/cros_disks",
    "//chromeos/ash/components/dbus/session_manager",
    "//chromeos/ash/components/dbus/spaced",
    "//chromeos/ash/components/disks",
    "//chromeos/ash/components/network",
    "//chromeos/ash/components/settings",
    "//chromeos/constants",
    "//chromeos/dbus/permission_broker",
    "//chromeos/ui/base",
    "//components/component_updater",
    "//components/component_updater/ash",
    "//components/guest_os",
    "//components/guest_os:prefs",
    "//components/pref_registry",
    "//components/prefs",
    "//components/user_manager",
    "//services/network/public/cpp",
    "//ui/base",
    "//ui/base/ime/ash",
    "//ui/chromeos/styles:cros_tokens_color_mappings_generator",
    "//ui/display/types",
  ]

  allow_circular_includes_from = [
    "//chrome/browser/ash/app_list",
    "//chrome/browser/ash/crostini/ansible",
    "//chrome/browser/ash/guest_os/public",
    "//chrome/browser/ui/webui/ash/crostini_installer",
  ]
}

static_library("test_support") {
  testonly = true

  sources = [
    "crostini_test_helper.cc",
    "crostini_test_helper.h",
    "crostini_test_util.cc",
    "crostini_test_util.h",
    "fake_crostini_features.cc",
    "fake_crostini_features.h",
    "fake_crostini_installer_ui_delegate.cc",
    "fake_crostini_installer_ui_delegate.h",
  ]

  public_deps = [
    ":crostini",
    "//base",
    "//base/test:test_support",
    "//chrome/browser/ash/login/users:test_support",
    "//components/user_manager",
  ]

  deps = [
    "//chrome/browser:main_extra_parts",
    "//chrome/browser/apps/app_service",
    "//chrome/browser/ash/guest_os",
    "//chrome/browser/ash/guest_os/public",
    "//chrome/browser/profiles:profile",
    "//chrome/common:chrome_features",
    "//chrome/test:test_support",
    "//chromeos/ash/components/dbus/cicerone",
    "//chromeos/ash/components/disks:test_support",
    "//components/component_updater/ash:test_support",
    "//components/prefs",
    "//ui/views:test_support",
  ]
}

static_library("browser_test_support") {
  testonly = true

  sources = [
    "crostini_browser_test_util.cc",
    "crostini_browser_test_util.h",
  ]

  deps = [
    ":test_support",
    "//base",
    "//base/test:test_support",
    "//chrome/browser",
    "//chrome/browser:main_extra_parts",
    "//chrome/browser/ash/guest_os/public",
    "//chrome/browser/ui",
    "//chrome/test:test_support",
    "//chrome/test:test_support_ui",
    "//chromeos/ash/components/disks",
    "//chromeos/ash/components/disks:test_support",
    "//components/component_updater/ash:test_support",
  ]
}

source_set("unit_tests") {
  testonly = true

  sources = [
    "crostini_disk_unittest.cc",
    "crostini_export_import_unittest.cc",
    "crostini_features_unittest.cc",
    "crostini_force_close_watcher_unittest.cc",
    "crostini_installer_unittest.cc",
    "crostini_low_disk_notification_unittest.cc",
    "crostini_manager_unittest.cc",
    "crostini_package_notification_unittest.cc",
    "crostini_package_service_unittest.cc",
    "crostini_port_forwarder_unittest.cc",
    "crostini_reporting_util_unittest.cc",
    "crostini_shared_devices_unittest.cc",
    "crostini_sshfs_unittest.cc",
    "crostini_terminal_provider_unittest.cc",
    "crostini_unsupported_action_notifier_unittest.cc",
    "crostini_upgrade_available_notification_unittest.cc",
    "crostini_util_unittest.cc",
    "termina_installer_unittest.cc",
  ]

  deps = [
    ":crostini",
    ":test_support",
    "//ash/constants",
    "//base",
    "//base/test:test_support",
    "//chrome/app:generated_resources",
    "//chrome/browser",
    "//chrome/browser:browser_process",
    "//chrome/browser/ash/crostini/ansible",
    "//chrome/browser/ash/crostini/ansible:test_support",
    "//chrome/browser/ash/crostini/ansible:unit_tests",
    "//chrome/browser/ash/crostini/throttle:unit_tests",
    "//chrome/browser/ash/file_manager",
    "//chrome/browser/ash/guest_os",
    "//chrome/browser/ash/guest_os/public",
    "//chrome/browser/ash/login/users:test_support",
    "//chrome/browser/ash/settings:test_support",
    "//chrome/browser/profiles:profile",
    "//chrome/browser/ui",
    "//chrome/browser/ui/views/crostini",
    "//chrome/browser/ui/webui/ash/crostini_upgrader",
    "//chrome/common",
    "//chrome/common:chrome_features",
    "//chrome/test:test_support",
    "//chromeos/ash/components/dbus/anomaly_detector",
    "//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/debug_daemon",
    "//chromeos/ash/components/dbus/dlcservice",
    "//chromeos/ash/components/dbus/seneschal",
    "//chromeos/ash/components/dbus/session_manager",
    "//chromeos/ash/components/dbus/spaced",
    "//chromeos/ash/components/disks",
    "//chromeos/ash/components/disks:test_support",
    "//chromeos/ash/components/network:test_support",
    "//chromeos/ash/components/settings",
    "//chromeos/dbus/permission_broker",
    "//components/account_id",
    "//components/component_updater",
    "//components/component_updater:test_support",
    "//components/component_updater/ash:test_support",
    "//components/keyed_service/content",
    "//components/prefs",
    "//components/sync_preferences:test_support",
    "//components/user_manager",
    "//components/user_manager:test_support",
    "//content/public/browser",
    "//content/test:test_support",
    "//mojo/public/cpp/bindings",
    "//services/device/public/cpp:test_support",
    "//services/network:test_support",
    "//storage/browser",
    "//testing/gmock",
    "//testing/gtest",
    "//third_party/blink/public/common:headers",
    "//ui/base",
    "//ui/display",
    "//ui/message_center/public/cpp",
    "//ui/shell_dialogs",
    "//ui/views",
    "//ui/views:test_support",
    "//url",
  ]
}

source_set("browser_tests") {
  testonly = true

  defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]

  sources = [ "crostini_browsertest.cc" ]

  deps = [
    ":browser_test_support",
    ":crostini",
    ":test_support",
    "//base:base",
    "//base/test:test_support",
    "//chrome/browser",
    "//chrome/browser:browser_process",
    "//chrome/browser:main_extra_parts",
    "//chrome/browser/ash/guest_os",
    "//chrome/browser/ui",
    "//chrome/common:chrome_features",
    "//chrome/test:test_support",
    "//chrome/test:test_support_ui",
    "//chromeos/ash/components/disks",
    "//chromeos/ash/components/disks:test_support",
    "//components/component_updater/ash:test_support",
    "//components/prefs",
    "//content/test:test_support",
    "//services/network/public/mojom",
  ]
}