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

# Copyright 2022 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("system_web_apps") {
  sources = [
    "chrome_system_web_app_ui_config.cc",
    "color_helpers.cc",
    "color_helpers.h",
    "system_web_app_background_task.cc",
    "system_web_app_background_task.h",
    "system_web_app_icon_checker.h",
    "system_web_app_manager.cc",
    "system_web_app_manager.h",
    "system_web_app_manager_factory.cc",
    "system_web_app_manager_factory.h",
  ]

  configs += [ "//build/config/compiler:wexit_time_destructors" ]

  public_deps = [
    "//ash/webui/system_apps/public:system_web_app_type",
    "//base",
    "//chrome/browser:browser_public_dependencies",
    "//chrome/browser/ash/system_web_apps/types",
    "//chrome/browser/profiles:profile",
    "//chrome/browser/web_applications",
    "//components/keyed_service/content",
    "//components/keyed_service/core",
    "//components/prefs",
    "//components/webapps/browser",
    "//components/webapps/common",
    "//content/public/browser",
    "//skia",
    "//url",
  ]

  deps = [
    "//ash/constants",
    "//ash/webui/camera_app_ui",
    "//ash/webui/system_apps/public:system_web_app_config",
    "//build:chromeos_buildflags",
    "//chrome/browser:browser_process",
    "//chrome/browser/ash/login/demo_mode",
    "//chrome/browser/ash/profiles",
    "//chrome/browser/ash/system_web_apps/apps",
    "//chrome/browser/ash/system_web_apps/apps/camera_app",
    "//chrome/browser/ash/system_web_apps/apps/help_app",
    "//chrome/browser/ash/system_web_apps/apps/media_app",
    "//chrome/browser/ash/system_web_apps/apps/personalization_app",
    "//chrome/browser/ash/system_web_apps/apps/recorder_app",
    "//chrome/browser/ash/system_web_apps/apps/vc_background_ui",
    "//chrome/browser/ui/ash/multi_user",
    "//chrome/browser/web_applications/mojom:mojom_web_apps_enum",
    "//chrome/common:chrome_features",
    "//chromeos/ash/components/boca",
    "//chromeos/components/kiosk",
    "//components/pref_registry",
    "//components/version_info",
    "//components/webapps/browser:constants",
    "//content/public/common",
    "//third_party/blink/public/common:headers",
    "//ui/base",
    "//ui/base/idle",
    "//ui/chromeos/styles:cros_tokens_color_mappings",
    "//ui/chromeos/styles:cros_tokens_color_mappings_generator",
    "//ui/color:color_headers",
    "//ui/color:mixers",
    "//ui/native_theme",
  ]

  allow_circular_includes_from = [
    "//chrome/browser/ash/login/demo_mode",
    "//chrome/browser/ash/system_web_apps/apps/camera_app",
  ]
}

source_set("browser_tests") {
  testonly = true

  defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]

  sources = [ "system_web_app_manager_browsertest.cc" ]

  deps = [
    ":system_web_apps",
    "//ash/constants",
    "//ash/public/cpp",
    "//base/test:test_support",
    "//chrome/app:command_ids",
    "//chrome/browser",
    "//chrome/browser/apps/app_service",
    "//chrome/browser/apps/app_service:constants",
    "//chrome/browser/apps/app_service/app_icon",
    "//chrome/browser/ash/accessibility",
    "//chrome/browser/ash/accessibility:test_support",
    "//chrome/browser/ash/app_list",
    "//chrome/browser/ash/app_list/test:test_support",
    "//chrome/browser/ash/extensions",
    "//chrome/browser/ash/file_manager",
    "//chrome/browser/ash/file_manager:test_support",
    "//chrome/browser/ash/system_web_apps/test_support",
    "//chrome/browser/ash/system_web_apps/test_support:test_support_ui",
    "//chrome/browser/ui",
    "//chrome/browser/ui/ash/shelf",
    "//chrome/browser/ui/ash/system_web_apps",
    "//chrome/browser/web_applications:web_applications_test_support",
    "//chrome/common",
    "//chrome/common:chrome_features",
    "//chrome/common:constants",
    "//chrome/test:test_support",
    "//chrome/test:test_support_ui",
    "//components/policy/core/common:common_constants",
    "//content/test:test_support",
    "//extensions/browser:test_support",
    "//extensions/common",
    "//ui/base/idle",
    "//ui/base/idle:test_support",
    "//ui/events:test_support",

    # Tests from subdirectories:
    "//chrome/browser/ash/system_web_apps/apps:browser_tests",
  ]
}

source_set("unit_tests") {
  testonly = true

  sources = [ "system_web_app_manager_unittest.cc" ]

  deps = [
    ":system_web_apps",
    "//ash/constants",
    "//base",
    "//base/test:test_support",
    "//chrome/browser/ash/system_web_apps/test_support",
    "//chrome/browser/ash/system_web_apps/types",
    "//chrome/browser/web_applications",
    "//chrome/browser/web_applications:web_applications_test_support",
    "//chrome/browser/web_applications/mojom:mojom_web_apps_enum",
    "//chrome/common:chrome_features",
    "//chrome/test:test_support",
    "//chromeos/components/kiosk:test_support",
    "//components/prefs",
    "//components/webapps/browser",
    "//components/webapps/browser:constants",
    "//content/test:test_support",
    "//testing/gmock",
    "//ui/base/idle",
    "//ui/base/idle:test_support",
    "//url",

    # Tests from subdirectories:
    "//chrome/browser/ash/system_web_apps/apps:unit_tests",
  ]
}

if (is_chromeos_device) {
  group("integration_tests") {
    testonly = true

    deps = [ "//chrome/browser/ash/system_web_apps/apps:integration_tests" ]
  }
}