chromium/chrome/browser/ash/app_list/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")
import("//chromeos/ash/components/assistant/assistant.gni")

assert(is_chromeos_ash)

static_library("app_list") {
  sources = [
    "app_context_menu.cc",
    "app_context_menu.h",
    "app_context_menu_delegate.h",
    "app_list_client_impl.cc",
    "app_list_client_impl.h",
    "app_list_controller_delegate.cc",
    "app_list_controller_delegate.h",
    "app_list_model_builder.cc",
    "app_list_model_builder.h",
    "app_list_model_updater.cc",
    "app_list_model_updater.h",
    "app_list_model_updater_observer.h",
    "app_list_notifier_impl.cc",
    "app_list_notifier_impl.h",
    "app_list_survey_handler.cc",
    "app_list_survey_handler.h",
    "app_list_sync_model_sanitizer.cc",
    "app_list_sync_model_sanitizer.h",
    "app_list_syncable_service.cc",
    "app_list_syncable_service.h",
    "app_list_syncable_service_factory.cc",
    "app_list_syncable_service_factory.h",
    "app_sync_ui_state.cc",
    "app_sync_ui_state.h",
    "app_sync_ui_state_factory.cc",
    "app_sync_ui_state_factory.h",
    "app_sync_ui_state_observer.cc",
    "app_sync_ui_state_observer.h",
    "app_sync_ui_state_watcher.cc",
    "app_sync_ui_state_watcher.h",
    "apps_collections_util.cc",
    "apps_collections_util.h",
    "chrome_app_list_item.cc",
    "chrome_app_list_item.h",
    "chrome_app_list_item_manager.cc",
    "chrome_app_list_item_manager.h",
    "chrome_app_list_model_updater.cc",
    "chrome_app_list_model_updater.h",
    "extension_app_utils.cc",
    "extension_app_utils.h",
    "md_icon_normalizer.cc",
    "md_icon_normalizer.h",
  ]

  public_deps = [
    "//ash/public/cpp",
    "//base",
    "//build:chromeos_buildflags",
    "//chrome/browser:browser_public_dependencies",
    "//chrome/browser/ash/hats",
    "//chrome/browser/profiles:profile",
    "//components/feature_engagement/public",
    "//components/search_engines",
    "//components/session_manager/core",
    "//components/sync/model",
    "//extensions/browser",
    "//extensions/common",
  ]

  deps = [
    "//ash",
    "//ash/app_list",
    "//ash/resources/vector_icons",
    "//ash/webui/mall:app_id",
    "//ash/webui/projector_app/public/cpp",
    "//build:branding_buildflags",
    "//chrome/app/vector_icons",
    "//chrome/browser:browser_process",
    "//chrome/browser/ash/app_list/search/ranking",
    "//chrome/browser/ash/crosapi:browser_util",
    "//chrome/browser/scalable_iph:scalable_iph_factory",
    "//chrome/browser/search_engines",
    "//chrome/browser/ui:browser_navigator_params_headers",
    "//chrome/browser/ui/ash/app_icon_color_cache",
    "//chrome/browser/ui/webui/ash/settings/app_management",
    "//chrome/browser/web_applications",
    "//chrome/common",
    "//chromeos/ash/components/browser_context_helper",
    "//chromeos/ash/components/scalable_iph",
    "//chromeos/constants",
    "//chromeos/crosapi/cpp",
    "//components/app_constants",
    "//components/pref_registry",
    "//extensions/common",
  ]
}

static_library("test_support") {
  testonly = true

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

  public_deps = [
    "//chrome/test:test_support",
    "//components/sync/model",
    "//components/sync/protocol",
  ]

  deps = [
    "//chrome/browser/extensions",
    "//chrome/browser/web_applications",
    "//chrome/browser/web_applications:web_applications_test_support",
    "//chrome/common:non_code_constants",
    "//components/crx_file",
    "//extensions/common",
  ]
}

source_set("unit_tests") {
  testonly = true

  sources = [
    "app_context_menu_unittest.cc",
    "app_list_sort_unittest.cc",
    "app_list_syncable_service_unittest.cc",
    "chrome_app_list_item_manager_unittest.cc",
    "md_icon_normalizer_unittest.cc",
  ]

  deps = [
    ":app_list",
    "//ash/app_list/model:app_list_model",
    "//ash/components/arc:arc_test_support",
    "//ash/constants",
    "//ash/public/cpp",
    "//base",
    "//base/test:test_support",
    "//cc/base",
    "//chrome/browser/apps/app_preload_service",
    "//chrome/browser/apps/app_service",
    "//chrome/browser/apps/app_service:test_support",
    "//chrome/browser/ash/app_list/app_service",
    "//chrome/browser/ash/app_list/arc",
    "//chrome/browser/ash/app_list/arc:test_support",
    "//chrome/browser/ash/app_list/internal_app",
    "//chrome/browser/ash/app_list/reorder",
    "//chrome/browser/ash/app_list/test:test_support",
    "//chrome/browser/ash/arc",
    "//chrome/browser/ash/crosapi:browser_util",
    "//chrome/browser/ash/login/users:test_support",
    "//chrome/browser/extensions",
    "//chrome/browser/profiles:profile",
    "//chrome/browser/ui",
    "//chrome/browser/web_applications",
    "//chrome/browser/web_applications:web_applications_test_support",
    "//chrome/common:constants",
    "//chrome/common:non_code_constants",
    "//chrome/test:test_support",
    "//chromeos/ash/components/standalone_browser",
    "//components/app_constants",
    "//components/crx_file",
    "//components/keyed_service/core",
    "//components/sync:test_support",
    "//components/sync/model",
    "//components/sync/protocol",
    "//components/user_manager",
    "//extensions/common",
    "//services/data_decoder/public/cpp:test_support",
    "//skia:skia_core_public_headers",
    "//testing/gmock",
    "//testing/gtest",
    "//ui/base:features",
    "//ui/display:test_support",
    "//ui/gfx",
    "//ui/gfx/geometry",

    # Tests from subdirectories:
    "//chrome/browser/ash/app_list/app_service:unit_tests",
    "//chrome/browser/ash/app_list/arc:unit_tests",
    "//chrome/browser/ash/app_list/reorder:unit_tests",
    "//chrome/browser/ash/app_list/search:unit_tests",
    "//chrome/browser/ash/app_list/search/arc:unit_tests",
    "//chrome/browser/ash/app_list/search/common:unit_tests",
    "//chrome/browser/ash/app_list/search/essential_search:unit_tests",
    "//chrome/browser/ash/app_list/search/files:unit_tests",
    "//chrome/browser/ash/app_list/search/games:unit_tests",
    "//chrome/browser/ash/app_list/search/local_image_search:unit_tests",
    "//chrome/browser/ash/app_list/search/omnibox:unit_tests",
    "//chrome/browser/ash/app_list/search/ranking:unit_tests",
    "//chrome/browser/ash/app_list/search/system_info:unit_tests",
    "//chrome/browser/ash/app_list/search/util:unit_tests",
  ]
}

source_set("browser_tests") {
  testonly = true

  defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]

  sources = [
    "app_list_client_impl_browsertest.cc",
    "app_list_sort_browsertest.cc",
    "chrome_app_list_item_browsertest.cc",
    "chrome_app_list_model_updater_browsertest.cc",
    "launcher_continue_section_browsertest.cc",
  ]

  deps = [
    ":app_list",
    "//ash",
    "//ash:test_support",
    "//ash/app_list",
    "//ash/app_list/model:app_list_model",
    "//ash/constants",
    "//ash/public/cpp",
    "//ash/webui/settings/public/constants:mojom",
    "//base",
    "//base/test:test_support",
    "//build:branding_buildflags",
    "//chrome/browser",
    "//chrome/browser:browser_process",
    "//chrome/browser/apps/app_service",
    "//chrome/browser/apps/app_service:constants",
    "//chrome/browser/ash/app_list/search",
    "//chrome/browser/ash/app_list/search/test:browser_test_support",
    "//chrome/browser/ash/app_list/search/test:test_support",
    "//chrome/browser/ash/app_list/test:test_support",
    "//chrome/browser/ash/drive",
    "//chrome/browser/ash/drive:test_support",
    "//chrome/browser/ash/file_manager",
    "//chrome/browser/ash/file_suggest",
    "//chrome/browser/ash/file_suggest:test_support",
    "//chrome/browser/ash/hats",
    "//chrome/browser/ash/login:test_support",
    "//chrome/browser/ash/login/demo_mode",
    "//chrome/browser/ash/login/demo_mode:test_support",
    "//chrome/browser/ash/login/test:test_support",
    "//chrome/browser/ash/login/ui",
    "//chrome/browser/ash/login/users:test_support",
    "//chrome/browser/ash/profiles",
    "//chrome/browser/ash/system_web_apps",
    "//chrome/browser/profiles:profile",
    "//chrome/browser/search_engines",
    "//chrome/browser/ui",
    "//chrome/browser/ui/ash/shelf",
    "//chrome/browser/ui/ash/system_web_apps",
    "//chrome/browser/web_applications",
    "//chrome/browser/web_applications:web_applications_test_support",
    "//chrome/common:chrome_features",
    "//chrome/common:constants",
    "//chrome/common:non_code_constants",
    "//chrome/test:test_support",
    "//chrome/test:test_support_ui",
    "//chromeos/ash/components/browser_context_helper",
    "//chromeos/ash/components/drivefs:test_support",
    "//chromeos/ash/components/drivefs/mojom",
    "//components/account_id",
    "//components/app_constants",
    "//components/browser_sync:switches",
    "//components/drive",
    "//components/prefs",
    "//components/services/app_service",
    "//components/session_manager/core",
    "//components/sync:test_support",
    "//components/sync/model",
    "//components/user_manager",
    "//components/user_manager:common",
    "//components/user_manager:test_support",
    "//content/public/browser",
    "//content/test:test_support",
    "//extensions/browser",
    "//mojo/public/cpp/bindings",
    "//skia",
    "//skia:skia_core_public_headers",
    "//ui/aura",
    "//ui/base",
    "//ui/compositor",
    "//ui/compositor:test_support",
    "//ui/display",
    "//ui/display:display_manager_test_api",
    "//ui/events:test_support",
    "//ui/gfx",
    "//ui/views",
    "//ui/views:test_support",
    "//ui/wm",
  ]

  if (enable_assistant_integration_tests) {
    sources += [ "launcher_search_iph_browsertest.cc" ]

    deps += [
      "//ash/app_list:test_support",
      "//ash/assistant/ui",
      "//ash/assistant/ui:constants",
      "//chrome/browser/ui/ash/assistant:browser_test_support",
      "//chrome/browser/ui/ash/assistant/test_support",
      "//chromeos/ash/components/assistant/test_support",
      "//chromeos/ash/services/assistant/public/cpp",
      "//chromeos/assistant/internal:libassistant",
      "//components/feature_engagement/test:test_support",
    ]

    data = [ "//chromeos/assistant/internal/test_data/" ]

    data_deps = [ "//chromeos/assistant/internal:build_fake_s3_server_main" ]
  }
}

if (!is_chromeos_device) {
  source_set("interactive_ui_tests") {
    testonly = true

    defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]

    sources = [ "app_list_client_interactive_uitest.cc" ]

    deps = [
      "//chrome/browser/ash/app_list",
      "//chrome/browser/ui",
      "//chrome/test:test_support_ui",
      "//content/test:test_support",
    ]
  }
}