chromium/chrome/browser/ui/webui/ash/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("ash") {
  sources = [
    "connectivity_diagnostics_dialog.cc",
    "connectivity_diagnostics_dialog.h",
    "cryptohome_ui.cc",
    "cryptohome_ui.h",
    "cryptohome_web_ui_handler.cc",
    "cryptohome_web_ui_handler.h",
    "diagnostics_dialog.cc",
    "diagnostics_dialog.h",
    "drive_internals_ui.cc",
    "drive_internals_ui.h",
    "edu_account_login_handler.cc",
    "edu_account_login_handler.h",
    "image_source.cc",
    "image_source.h",
    "internet_config_dialog.cc",
    "internet_config_dialog.h",
    "internet_detail_dialog.cc",
    "internet_detail_dialog.h",
    "network_logs_message_handler.cc",
    "network_logs_message_handler.h",
    "network_ui.cc",
    "network_ui.h",
    "onc_import_message_handler.cc",
    "onc_import_message_handler.h",
    "os_feedback_dialog.cc",
    "os_feedback_dialog.h",
    "power_ui.cc",
    "power_ui.h",
    "remote_maintenance_curtain_ui.cc",
    "remote_maintenance_curtain_ui.h",
    "sanitize_dialog.cc",
    "sanitize_dialog.h",
    "set_time_ui.cc",
    "set_time_ui.h",
    "shimless_rma_dialog.cc",
    "shimless_rma_dialog.h",
    "slow_trace_ui.cc",
    "slow_trace_ui.h",
    "slow_ui.cc",
    "slow_ui.h",
    "system_web_dialog_delegate.cc",
    "system_web_dialog_delegate.h",
    "system_web_dialog_view.cc",
    "system_web_dialog_view.h",
    "user_image_source.cc",
    "user_image_source.h",
  ]

  public_deps = [
    "//ash/webui/common:chrome_os_webui_config",
    "//base",
    "//chrome/browser:browser_public_dependencies",
    "//chrome/browser/profiles:profile",
    "//chrome/browser/ui/webui/ash/login",
    "//chrome/common",
    "//chromeos/ash/components/dbus/userdataauth",
    "//chromeos/ash/services/bluetooth_config/public/mojom",
    "//chromeos/ash/services/cellular_setup/public/mojom",
    "//chromeos/ash/services/connectivity/public/mojom",
    "//chromeos/dbus/common",
    "//chromeos/dbus/tpm_manager:tpm_manager_proto",
    "//chromeos/services/network_config/public/mojom",
    "//chromeos/services/network_health/public/mojom",
    "//components/image_fetcher/core",
    "//components/signin/public/identity_manager",
    "//components/supervised_user/core/browser:fetcher",
    "//components/supervised_user/core/browser/proto",
    "//content/public/browser",
    "//content/public/common",
    "//extensions/common/api",
    "//google_apis",
    "//mojo/public/cpp/bindings",
    "//ui/base",
    "//ui/display",
    "//ui/gfx",
    "//ui/gfx/geometry",
    "//ui/views",
    "//ui/views/controls/webview",
    "//ui/web_dialogs",
    "//ui/webui",
    "//ui/webui/resources/cr_components/color_change_listener:mojom",
    "//url",
  ]

  deps = [
    "//ash",
    "//ash/constants",
    "//ash/public/cpp",
    "//ash/webui/common:trusted_types_util",
    "//ash/webui/connectivity_diagnostics",
    "//ash/webui/diagnostics_ui",
    "//ash/webui/diagnostics_ui:url_constants",
    "//ash/webui/network_ui:network_diagnostics_resource_provider",
    "//ash/webui/network_ui:network_health_resource_provider",
    "//ash/webui/network_ui:traffic_counters_resource_provider",
    "//ash/webui/os_feedback_ui:url_constants",
    "//ash/webui/sanitize_ui",
    "//ash/webui/shimless_rma",
    "//chrome/app:generated_resources",
    "//chrome/app:generated_resources_grit",
    "//chrome/browser:browser_process",
    "//chrome/browser:resources",
    "//chrome/browser:resources_grit",
    "//chrome/browser/ash/child_accounts/parent_access_code",
    "//chrome/browser/ash/drive",
    "//chrome/browser/ash/login/users/avatar",
    "//chrome/browser/ash/login/users/default_user_image",
    "//chrome/browser/ash/net/network_health",
    "//chrome/browser/ash/power",
    "//chrome/browser/ash/profiles",
    "//chrome/browser/ash/system",
    "//chrome/browser/feedback",
    "//chrome/browser/image_fetcher",
    "//chrome/browser/profiles",
    "//chrome/browser/resources/chromeos/bluetooth_pairing_dialog:resources",
    "//chrome/browser/resources/chromeos/bluetooth_pairing_dialog:resources_grit",
    "//chrome/browser/resources/chromeos/internet_config_dialog:resources",
    "//chrome/browser/resources/chromeos/internet_config_dialog:resources_grit",
    "//chrome/browser/resources/chromeos/internet_detail_dialog:resources",
    "//chrome/browser/resources/chromeos/internet_detail_dialog:resources_grit",
    "//chrome/browser/resources/chromeos/network_ui:resources",
    "//chrome/browser/resources/chromeos/network_ui:resources_grit",
    "//chrome/browser/resources/chromeos/remote_maintenance_curtain:resources",
    "//chrome/browser/resources/chromeos/remote_maintenance_curtain:resources_grit",
    "//chrome/browser/resources/chromeos/set_time_dialog:resources",
    "//chrome/browser/resources/chromeos/set_time_dialog:resources_grit",
    "//chrome/browser/ui/webui",
    "//chrome/browser/ui/webui/ash/account_manager",
    "//chrome/browser/ui/webui/ash/add_supervision",
    "//chrome/browser/ui/webui/ash/bluetooth",
    "//chrome/browser/ui/webui/ash/cellular_setup",
    "//chrome/browser/ui/webui/ash/set_time_dialog",
    "//chrome/browser/ui/webui/ash/sys_internals",
    "//chrome/common:constants",
    "//chrome/services/file_util/public/cpp",
    "//chromeos/ash/components/dbus",
    "//chromeos/ash/components/dbus/cryptohome:cryptohome_proto",
    "//chromeos/ash/components/dbus/debug_daemon",
    "//chromeos/ash/components/dbus/shill",
    "//chromeos/ash/components/dbus/system_clock",
    "//chromeos/ash/components/drivefs",
    "//chromeos/ash/components/login/auth",
    "//chromeos/ash/components/login/auth/public:authpublic",
    "//chromeos/ash/components/network",
    "//chromeos/ash/components/settings",
    "//chromeos/components/onc",
    "//chromeos/constants",
    "//chromeos/dbus/tpm_manager",
    "//chromeos/services/network_config/public/cpp",
    "//chromeos/strings",
    "//chromeos/strings:strings_grit",
    "//components/account_id",
    "//components/device_event_log",
    "//components/download/content/public",
    "//components/download/public/common:public",
    "//components/drive",
    "//components/feedback/content",
    "//components/onc",
    "//components/policy/core/browser",
    "//components/prefs",
    "//components/session_manager/core",
    "//components/signin/public/base",
    "//components/strings:components_strings",
    "//components/strings:components_strings_grit",
    "//components/user_manager",
    "//crypto",
    "//device/bluetooth",
    "//device/bluetooth/public/cpp",
    "//extensions/browser/api/feedback_private",
    "//google_apis/common",
    "//google_apis/drive",
    "//net",
    "//services/network/public/mojom:url_loader_base",
    "//third_party/blink/public/common:headers",
    "//ui/aura",
    "//ui/chromeos/resources",
    "//ui/chromeos/resources:resources_grit",
    "//ui/chromeos/strings",
    "//ui/chromeos/strings:strings_grit",
    "//ui/chromeos/strings:strings_provider",
    "//ui/display/util",
    "//ui/gfx",
    "//ui/gfx/codec",
    "//ui/resources:webui_resources_grd",
    "//ui/resources:webui_resources_grd_grit",
    "//ui/wm",
  ]

  allow_circular_includes_from = [
    "//chrome/browser/ui/webui/ash/account_manager",
    "//chrome/browser/ui/webui/ash/add_supervision",
    "//chrome/browser/ui/webui/ash/bluetooth",
    "//chrome/browser/ui/webui/ash/cellular_setup",
    "//chrome/browser/ui/webui/ash/login",
    "//chrome/browser/ui/webui/ash/set_time_dialog",
  ]
}

source_set("unit_tests") {
  testonly = true

  sources = [
    "diagnostics_dialog_unittest.cc",
    "edu_account_login_handler_unittest.cc",
  ]

  deps = [
    "//base",
    "//base/test:test_support",
    "//chrome/browser/ui/webui/ash",
    "//chromeos/ash/components/dbus/shill",
    "//chromeos/ash/components/network",
    "//chromeos/ash/components/network:test_support",
    "//components/image_fetcher/core",
    "//components/image_fetcher/core:test_support",
    "//components/session_manager/core",
    "//components/signin/public/identity_manager",
    "//components/signin/public/identity_manager:test_support",
    "//components/supervised_user/core/browser:fetcher",
    "//components/supervised_user/core/browser/proto",
    "//content/test:test_support",
    "//net",
    "//services/network:test_support",
    "//services/network/public/cpp",
    "//testing/gmock",
    "//testing/gtest",
    "//ui/base",
    "//ui/chromeos/resources",
    "//ui/chromeos/resources:resources_grit",
    "//ui/gfx",
    "//ui/gfx:test_support",

    # Gather unit tests from subdirectories:
    "//chrome/browser/ui/webui/ash/add_supervision:unit_tests",
    "//chrome/browser/ui/webui/ash/cloud_upload:unit_tests",
    "//chrome/browser/ui/webui/ash/emoji:unit_tests",
    "//chrome/browser/ui/webui/ash/enterprise_reporting:unit_tests",
    "//chrome/browser/ui/webui/ash/lobster:unit_tests",
    "//chrome/browser/ui/webui/ash/login:unit_tests",
    "//chrome/browser/ui/webui/ash/mako:unit_tests",
    "//chrome/browser/ui/webui/ash/parent_access:unit_tests",
    "//chrome/browser/ui/webui/ash/print_preview_cros:unit_tests",
    "//chrome/browser/ui/webui/ash/sensor_info:unit_tests",
    "//chrome/browser/ui/webui/ash/settings:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/pages:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/a11y:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/about:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/apps:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/apps/mojom:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/bluetooth:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/crostini:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/device:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/device/display_settings:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/device/input_device_settings:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/internet:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/main:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/multidevice:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/people:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/personalization:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/printing:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/privacy:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/search:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/storage:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/search:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/services/metrics:unit_tests",
    "//chrome/browser/ui/webui/ash/settings/services/settings_manager:unit_tests",
    "//chrome/browser/ui/webui/ash/smb_shares:unit_tests",
  ]
}

source_set("browser_tests") {
  testonly = true

  defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]

  sources = [
    "cros_components_browsertest.cc",
    "system_web_dialog_browsertest.cc",
  ]

  deps = [
    "//ash:test_support",
    "//base",
    "//chrome/browser/ash/login:test_support",
    "//chrome/browser/ash/login/test:test_support",
    "//chrome/browser/profiles:profile",
    "//chrome/browser/ui",
    "//chrome/browser/ui/webui/ash",
    "//chrome/browser/ui/zoom",
    "//chrome/common",
    "//chrome/common:constants",
    "//chrome/test:test_support_ui",
    "//components/account_id",
    "//components/prefs",
    "//content/public/browser",
    "//content/test:test_support",
    "//third_party/blink/public/common:headers",
    "//ui/aura",
    "//url",

    # Gather browser tests from subdirectories:
    "//chrome/browser/ui/webui/ash/add_supervision:browser_tests",
    "//chrome/browser/ui/webui/ash/app_install:browser_tests",
    "//chrome/browser/ui/webui/ash/cloud_upload:browser_tests",
    "//chrome/browser/ui/webui/ash/crostini_upgrader:browser_tests",
    "//chrome/browser/ui/webui/ash/edu_coexistence:browser_tests",
    "//chrome/browser/ui/webui/ash/kerberos:browser_tests",
    "//chrome/browser/ui/webui/ash/login:browser_tests",
    "//chrome/browser/ui/webui/ash/login/testapi:browser_tests",
    "//chrome/browser/ui/webui/ash/manage_mirrorsync:browser_tests",
    "//chrome/browser/ui/webui/ash/office_fallback:browser_tests",
    "//chrome/browser/ui/webui/ash/parent_access:browser_tests",
    "//chrome/browser/ui/webui/ash/settings/integration_tests:browser_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/a11y:browser_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/apps:browser_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/files:browser_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/people:browser_tests",
    "//chrome/browser/ui/webui/ash/settings/pages/power:browser_tests",
    "//chrome/browser/ui/webui/ash/skyvault:browser_tests",
    "//chrome/browser/ui/webui/ash/smb_shares:browser_tests",
  ]
}

if (is_chromeos_device) {
  group("integration_tests") {
    testonly = true
    deps = [
      "//chrome/browser/ui/webui/ash/settings/pages/printing/integration_tests",
    ]
  }
} else {
  group("interactive_ui_tests") {
    testonly = true
    deps = [
      "//chrome/browser/ui/webui/ash/firmware_update_ui/integration_tests:interactive_ui_tests",
      "//chrome/browser/ui/webui/ash/settings/integration_tests:interactive_ui_tests",
      "//chrome/browser/ui/webui/ash/settings/integration_tests/device_page:interactive_ui_tests",
      "//chrome/browser/ui/webui/ash/settings/pages/device/integration_tests:interactive_ui_tests",
      "//chrome/browser/ui/webui/ash/shortcut_customization/integration_tests:interactive_ui_tests",
    ]
  }
}