chromium/chrome/browser/apps/app_preload_service/BUILD.gn

# Copyright 2023 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)

source_set("app_preload_service") {
  sources = [
    "app_preload_almanac_endpoint.cc",
    "app_preload_almanac_endpoint.h",
    "app_preload_service.cc",
    "app_preload_service.h",
    "app_preload_service_factory.cc",
    "app_preload_service_factory.h",
    "preload_app_definition.cc",
    "preload_app_definition.h",
  ]

  deps = [
    "//ash/constants",
    "//base",
    "//chrome/browser/apps:user_type_filter",
    "//chrome/browser/apps/almanac_api_client",
    "//chrome/browser/apps/almanac_api_client/proto",
    "//chrome/browser/apps/app_preload_service/proto",
    "//chrome/browser/apps/app_service",
    "//chrome/browser/apps/app_service/app_install",
    "//chrome/browser/profiles:profile",
    "//chrome/browser/web_applications",
    "//chrome/common:channel_info",
    "//chrome/common:chrome_features",
    "//chromeos/crosapi/mojom",
    "//components/app_constants",
    "//components/keyed_service/core",
    "//components/pref_registry",
    "//components/prefs",
    "//components/services/app_service",
    "//components/user_manager",
    "//components/webapps/browser",
    "//components/webapps/browser:constants",
    "//components/webapps/common",
    "//google_apis",
    "//services/network/public/cpp",
  ]

  # TODO(crbug.com/40251081): Remove these deps. Needed only to allow circular includes.
  deps += [
    "//chrome/browser/ash/app_list",
    "//chrome/browser/ash/extensions",
    "//chrome/browser/ui/ash/shelf",
  ]

  # TODO(crbug.com/40251079): Remove circular dependencies.
  allow_circular_includes_from = [
    "//chrome/browser/ash/app_list",
    "//chrome/browser/ash/extensions",
    "//chrome/browser/ui/ash/shelf",
  ]
}

source_set("unit_tests") {
  testonly = true

  sources = [
    "app_preload_almanac_endpoint_unittest.cc",
    "app_preload_service_unittest.cc",
    "preload_app_definition_unittest.cc",
  ]

  deps = [
    ":app_preload_service",
    "//base",
    "//chrome/browser/apps/almanac_api_client",
    "//chrome/browser/apps/almanac_api_client/proto",
    "//chrome/browser/apps/app_preload_service/proto",
    "//chrome/browser/apps/app_service",
    "//chrome/browser/apps/app_service/app_install",
    "//chrome/browser/ash/app_list/arc",
    "//chrome/browser/ash/login/users:test_support",
    "//chrome/browser/web_applications:web_applications_test_support",
    "//chrome/test:test_support",
    "//chromeos/ash/components/system",
    "//components/prefs",
    "//components/services/app_service",
    "//components/user_manager",
    "//components/version_info",
    "//content/test:test_support",
    "//services/network:test_support",
    "//services/network/public/cpp",
    "//testing/gtest",
  ]
}

source_set("browser_tests") {
  testonly = true

  sources = [ "app_preload_service_browsertest.cc" ]

  defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]

  deps = [
    ":app_preload_service",
    "//ash/constants",
    "//base",
    "//chrome/browser/apps/app_preload_service/proto",
    "//chrome/browser/apps/app_service",
    "//chrome/browser/apps/app_service:app_registry_cache_waiter",
    "//chrome/browser/ash/crosapi",
    "//chrome/browser/ash/crosapi:test_support",
    "//chrome/browser/ui",
    "//chrome/browser/web_applications",
    "//chrome/browser/web_applications:web_applications_test_support",
    "//chrome/common:chrome_features",
    "//chrome/test:test_support",
    "//chrome/test:test_support_ui",
    "//components/services/app_service",
    "//components/user_manager",
    "//components/webapps/browser:constants",
    "//content/test:test_support",
    "//net:test_support",
  ]
}