chromium/chrome/browser/web_applications/BUILD.gn

# Use of this source code is governed by a BSD-style license that can be
# Copyright 2018 The Chromium Authors
# found in the LICENSE file.

import("//build/config/chromeos/ui_mode.gni")
import("//chrome/browser/buildflags.gni")
import("//extensions/buildflags/buildflags.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//testing/test.gni")

assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome")

source_set("web_applications") {
  sources = [
    "callback_utils.h",
    "commands/clear_browsing_data_command.cc",
    "commands/clear_browsing_data_command.h",
    "commands/command_result.h",
    "commands/compute_app_size_command.cc",
    "commands/compute_app_size_command.h",
    "commands/dedupe_install_urls_command.cc",
    "commands/dedupe_install_urls_command.h",
    "commands/external_app_resolution_command.cc",
    "commands/external_app_resolution_command.h",
    "commands/fetch_install_info_from_install_url_command.cc",
    "commands/fetch_install_info_from_install_url_command.h",
    "commands/fetch_installability_for_chrome_management.cc",
    "commands/fetch_installability_for_chrome_management.h",
    "commands/fetch_manifest_and_install_command.cc",
    "commands/fetch_manifest_and_install_command.h",
    "commands/generated_icon_fix_command.cc",
    "commands/generated_icon_fix_command.h",
    "commands/install_app_locally_command.cc",
    "commands/install_app_locally_command.h",
    "commands/install_from_info_command.cc",
    "commands/install_from_info_command.h",
    "commands/install_from_sync_command.cc",
    "commands/install_from_sync_command.h",
    "commands/internal/callback_command.cc",
    "commands/internal/callback_command.h",
    "commands/internal/command_internal.cc",
    "commands/internal/command_internal.h",
    "commands/launch_web_app_command.cc",
    "commands/launch_web_app_command.h",
    "commands/manifest_update_check_command.cc",
    "commands/manifest_update_check_command.h",
    "commands/manifest_update_finalize_command.cc",
    "commands/manifest_update_finalize_command.h",
    "commands/navigate_and_trigger_install_dialog_command.cc",
    "commands/navigate_and_trigger_install_dialog_command.h",
    "commands/os_integration_synchronize_command.cc",
    "commands/os_integration_synchronize_command.h",
    "commands/run_on_os_login_command.cc",
    "commands/run_on_os_login_command.h",
    "commands/set_user_display_mode_command.cc",
    "commands/set_user_display_mode_command.h",
    "commands/uninstall_all_user_installed_web_apps_command.cc",
    "commands/uninstall_all_user_installed_web_apps_command.h",
    "commands/update_file_handler_command.cc",
    "commands/update_file_handler_command.h",
    "commands/update_protocol_handler_approval_command.cc",
    "commands/update_protocol_handler_approval_command.h",
    "commands/web_app_command.h",
    "commands/web_app_icon_diagnostic_command.cc",
    "commands/web_app_icon_diagnostic_command.h",
    "commands/web_app_uninstall_command.cc",
    "commands/web_app_uninstall_command.h",
    "daily_metrics_helper.cc",
    "daily_metrics_helper.h",
    "extension_status_utils.h",
    "extensions_manager.h",
    "external_install_options.cc",
    "external_install_options.h",
    "externally_managed_app_install_task.cc",
    "externally_managed_app_install_task.h",
    "externally_managed_app_manager.cc",
    "externally_managed_app_manager.h",
    "externally_managed_app_registration_task.cc",
    "externally_managed_app_registration_task.h",
    "features.cc",
    "features.h",
    "file_utils_wrapper.cc",
    "file_utils_wrapper.h",
    "generated_icon_fix_manager.cc",
    "generated_icon_fix_manager.h",
    "generated_icon_fix_util.cc",
    "generated_icon_fix_util.h",
    "install_bounce_metric.cc",
    "install_bounce_metric.h",
    "isolated_web_apps/check_isolated_web_app_bundle_installability_command.cc",
    "isolated_web_apps/check_isolated_web_app_bundle_installability_command.h",
    "isolated_web_apps/chrome_content_browser_client_isolated_web_apps_part.cc",
    "isolated_web_apps/chrome_content_browser_client_isolated_web_apps_part.h",
    "isolated_web_apps/cleanup_orphaned_isolated_web_apps_command.cc",
    "isolated_web_apps/cleanup_orphaned_isolated_web_apps_command.h",
    "isolated_web_apps/error/uma_logging.cc",
    "isolated_web_apps/error/uma_logging.h",
    "isolated_web_apps/error/unusable_swbn_file_error.cc",
    "isolated_web_apps/error/unusable_swbn_file_error.h",
    "isolated_web_apps/garbage_collect_storage_partitions_command.cc",
    "isolated_web_apps/garbage_collect_storage_partitions_command.h",
    "isolated_web_apps/get_controlled_frame_partition_command.cc",
    "isolated_web_apps/get_controlled_frame_partition_command.h",
    "isolated_web_apps/get_isolated_web_app_browsing_data_command.cc",
    "isolated_web_apps/get_isolated_web_app_browsing_data_command.h",
    "isolated_web_apps/install_isolated_web_app_command.cc",
    "isolated_web_apps/install_isolated_web_app_command.h",
    "isolated_web_apps/isolated_web_app_apply_update_command.cc",
    "isolated_web_apps/isolated_web_app_apply_update_command.h",
    "isolated_web_apps/isolated_web_app_downloader.cc",
    "isolated_web_apps/isolated_web_app_downloader.h",
    "isolated_web_apps/isolated_web_app_error_page.cc",
    "isolated_web_apps/isolated_web_app_error_page.h",
    "isolated_web_apps/isolated_web_app_features.cc",
    "isolated_web_apps/isolated_web_app_features.h",
    "isolated_web_apps/isolated_web_app_install_command_helper.cc",
    "isolated_web_apps/isolated_web_app_install_command_helper.h",
    "isolated_web_apps/isolated_web_app_install_source.cc",
    "isolated_web_apps/isolated_web_app_install_source.h",
    "isolated_web_apps/isolated_web_app_installation_manager.cc",
    "isolated_web_apps/isolated_web_app_installation_manager.h",
    "isolated_web_apps/isolated_web_app_integrity_block_data.cc",
    "isolated_web_apps/isolated_web_app_integrity_block_data.h",
    "isolated_web_apps/isolated_web_app_prepare_and_store_update_command.cc",
    "isolated_web_apps/isolated_web_app_prepare_and_store_update_command.h",
    "isolated_web_apps/isolated_web_app_reader_registry.cc",
    "isolated_web_apps/isolated_web_app_reader_registry.h",
    "isolated_web_apps/isolated_web_app_reader_registry_factory.cc",
    "isolated_web_apps/isolated_web_app_reader_registry_factory.h",
    "isolated_web_apps/isolated_web_app_response_reader.cc",
    "isolated_web_apps/isolated_web_app_response_reader.h",
    "isolated_web_apps/isolated_web_app_response_reader_factory.cc",
    "isolated_web_apps/isolated_web_app_response_reader_factory.h",
    "isolated_web_apps/isolated_web_app_source.cc",
    "isolated_web_apps/isolated_web_app_source.h",
    "isolated_web_apps/isolated_web_app_storage_location.cc",
    "isolated_web_apps/isolated_web_app_storage_location.h",
    "isolated_web_apps/isolated_web_app_trust_checker.cc",
    "isolated_web_apps/isolated_web_app_trust_checker.h",
    "isolated_web_apps/isolated_web_app_update_apply_task.cc",
    "isolated_web_apps/isolated_web_app_update_apply_task.h",
    "isolated_web_apps/isolated_web_app_update_apply_waiter.cc",
    "isolated_web_apps/isolated_web_app_update_apply_waiter.h",
    "isolated_web_apps/isolated_web_app_update_discovery_task.cc",
    "isolated_web_apps/isolated_web_app_update_discovery_task.h",
    "isolated_web_apps/isolated_web_app_update_manager.cc",
    "isolated_web_apps/isolated_web_app_update_manager.h",
    "isolated_web_apps/isolated_web_app_url_info.cc",
    "isolated_web_apps/isolated_web_app_url_info.h",
    "isolated_web_apps/isolated_web_app_url_loader_factory.cc",
    "isolated_web_apps/isolated_web_app_url_loader_factory.h",
    "isolated_web_apps/isolated_web_app_validator.cc",
    "isolated_web_apps/isolated_web_app_validator.h",
    "isolated_web_apps/isolated_web_app_version.cc",
    "isolated_web_apps/isolated_web_app_version.h",
    "isolated_web_apps/iwa_identity_validator.cc",
    "isolated_web_apps/iwa_identity_validator.h",
    "isolated_web_apps/key_distribution/iwa_key_distribution_info_provider.cc",
    "isolated_web_apps/key_distribution/iwa_key_distribution_info_provider.h",
    "isolated_web_apps/pending_install_info.cc",
    "isolated_web_apps/pending_install_info.h",
    "isolated_web_apps/remove_isolated_web_app_data.cc",
    "isolated_web_apps/remove_isolated_web_app_data.h",
    "isolated_web_apps/signed_web_bundle_metadata.cc",
    "isolated_web_apps/signed_web_bundle_metadata.h",
    "isolated_web_apps/signed_web_bundle_reader.cc",
    "isolated_web_apps/signed_web_bundle_reader.h",
    "isolated_web_apps/update_manifest/update_manifest.cc",
    "isolated_web_apps/update_manifest/update_manifest.h",
    "isolated_web_apps/update_manifest/update_manifest_fetcher.cc",
    "isolated_web_apps/update_manifest/update_manifest_fetcher.h",
    "jobs/install_from_info_job.cc",
    "jobs/install_from_info_job.h",
    "jobs/install_placeholder_job.cc",
    "jobs/install_placeholder_job.h",
    "jobs/uninstall/remove_install_source_job.cc",
    "jobs/uninstall/remove_install_source_job.h",
    "jobs/uninstall/remove_install_url_job.cc",
    "jobs/uninstall/remove_install_url_job.h",
    "jobs/uninstall/remove_web_app_job.cc",
    "jobs/uninstall/remove_web_app_job.h",
    "jobs/uninstall/uninstall_job.cc",
    "jobs/uninstall/uninstall_job.h",
    "jobs/uninstall/web_app_uninstall_and_replace_job.h",
    "link_capturing_redirect_navigation_throttle.cc",
    "link_capturing_redirect_navigation_throttle.h",
    "locks/all_apps_lock.cc",
    "locks/all_apps_lock.h",
    "locks/app_lock.cc",
    "locks/app_lock.h",
    "locks/lock.cc",
    "locks/lock.h",
    "locks/noop_lock.cc",
    "locks/noop_lock.h",
    "locks/partitioned_lock.cc",
    "locks/partitioned_lock.h",
    "locks/partitioned_lock_id.cc",
    "locks/partitioned_lock_id.h",
    "locks/partitioned_lock_manager.cc",
    "locks/partitioned_lock_manager.h",
    "locks/shared_web_contents_lock.cc",
    "locks/shared_web_contents_lock.h",
    "locks/shared_web_contents_with_app_lock.cc",
    "locks/shared_web_contents_with_app_lock.h",
    "locks/web_app_lock_manager.cc",
    "locks/web_app_lock_manager.h",
    "locks/with_app_resources.cc",
    "locks/with_app_resources.h",
    "locks/with_shared_web_contents_resources.cc",
    "locks/with_shared_web_contents_resources.h",
    "manifest_update_manager.cc",
    "manifest_update_manager.h",
    "manifest_update_utils.cc",
    "manifest_update_utils.h",
    "os_integration/file_handling_sub_manager.cc",
    "os_integration/file_handling_sub_manager.h",
    "os_integration/os_integration_manager.cc",
    "os_integration/os_integration_manager.h",
    "os_integration/os_integration_sub_manager.h",
    "os_integration/os_integration_test_override.cc",
    "os_integration/os_integration_test_override.h",
    "os_integration/protocol_handling_sub_manager.cc",
    "os_integration/protocol_handling_sub_manager.h",
    "os_integration/run_on_os_login_sub_manager.cc",
    "os_integration/run_on_os_login_sub_manager.h",
    "os_integration/shortcut_menu_handling_sub_manager.cc",
    "os_integration/shortcut_menu_handling_sub_manager.h",
    "os_integration/shortcut_sub_manager.cc",
    "os_integration/shortcut_sub_manager.h",
    "os_integration/uninstallation_via_os_settings_sub_manager.cc",
    "os_integration/uninstallation_via_os_settings_sub_manager.h",
    "os_integration/web_app_file_handler_manager.cc",
    "os_integration/web_app_file_handler_manager.h",
    "os_integration/web_app_file_handler_registration.cc",
    "os_integration/web_app_file_handler_registration.h",
    "os_integration/web_app_protocol_handler_manager.cc",
    "os_integration/web_app_protocol_handler_manager.h",
    "os_integration/web_app_protocol_handler_registration.cc",
    "os_integration/web_app_protocol_handler_registration.h",
    "os_integration/web_app_run_on_os_login.cc",
    "os_integration/web_app_run_on_os_login.h",
    "os_integration/web_app_shortcut.cc",
    "os_integration/web_app_shortcut.h",
    "os_integration/web_app_shortcuts_menu.cc",
    "os_integration/web_app_shortcuts_menu.h",
    "os_integration/web_app_uninstallation_via_os_settings_registration.cc",
    "os_integration/web_app_uninstallation_via_os_settings_registration.h",
    "policy/pre_redirection_url_observer.cc",
    "policy/pre_redirection_url_observer.h",
    "policy/web_app_policy_constants.cc",
    "policy/web_app_policy_constants.h",
    "policy/web_app_policy_manager.cc",
    "policy/web_app_policy_manager.h",
    "preinstalled_app_install_features.cc",
    "preinstalled_app_install_features.h",
    "preinstalled_web_app_config_utils.cc",
    "preinstalled_web_app_config_utils.h",
    "preinstalled_web_app_manager.cc",
    "preinstalled_web_app_manager.h",
    "preinstalled_web_app_utils.cc",
    "preinstalled_web_app_utils.h",
    "preinstalled_web_apps/preinstalled_web_app_definition_utils.cc",
    "preinstalled_web_apps/preinstalled_web_app_definition_utils.h",
    "preinstalled_web_apps/preinstalled_web_apps.cc",
    "preinstalled_web_apps/preinstalled_web_apps.h",
    "scope_extension_info.cc",
    "scope_extension_info.h",
    "tabbed_mode_scope_matcher.cc",
    "tabbed_mode_scope_matcher.h",
    "user_display_mode.cc",
    "user_display_mode.h",
    "user_uninstalled_preinstalled_web_app_prefs.cc",
    "user_uninstalled_preinstalled_web_app_prefs.h",
    "web_app.cc",
    "web_app.h",
    "web_app_audio_focus_id_map.cc",
    "web_app_audio_focus_id_map.h",
    "web_app_callback_app_identity.h",
    "web_app_chromeos_data.cc",
    "web_app_chromeos_data.h",
    "web_app_command_manager.cc",
    "web_app_command_manager.h",
    "web_app_command_scheduler.cc",
    "web_app_command_scheduler.h",
    "web_app_constants.cc",
    "web_app_constants.h",
    "web_app_database.cc",
    "web_app_database.h",
    "web_app_database_factory.cc",
    "web_app_database_factory.h",
    "web_app_helpers.cc",
    "web_app_helpers.h",
    "web_app_icon_generator.cc",
    "web_app_icon_generator.h",
    "web_app_icon_manager.cc",
    "web_app_icon_manager.h",
    "web_app_icon_operations.cc",
    "web_app_icon_operations.h",
    "web_app_id_constants.h",
    "web_app_install_finalizer.cc",
    "web_app_install_finalizer.h",
    "web_app_install_info.cc",
    "web_app_install_info.h",
    "web_app_install_manager.cc",
    "web_app_install_manager.h",
    "web_app_install_manager_observer.h",
    "web_app_install_params.cc",
    "web_app_install_params.h",
    "web_app_install_utils.cc",
    "web_app_install_utils.h",
    "web_app_internals_utils.cc",
    "web_app_internals_utils.h",
    "web_app_launch_params.cc",
    "web_app_launch_params.h",
    "web_app_launch_queue.cc",
    "web_app_launch_queue.h",
    "web_app_logging.cc",
    "web_app_logging.h",
    "web_app_origin_association_manager.cc",
    "web_app_origin_association_manager.h",
    "web_app_origin_association_task.cc",
    "web_app_origin_association_task.h",
    "web_app_pref_guardrails.cc",
    "web_app_pref_guardrails.h",
    "web_app_proto_utils.cc",
    "web_app_proto_utils.h",
    "web_app_provider.cc",
    "web_app_provider.h",
    "web_app_provider_factory.cc",
    "web_app_provider_factory.h",
    "web_app_registrar.cc",
    "web_app_registrar.h",
    "web_app_registrar_observer.h",
    "web_app_registry_update.cc",
    "web_app_registry_update.h",
    "web_app_sync_bridge.cc",
    "web_app_sync_bridge.h",
    "web_app_tab_helper.cc",
    "web_app_tab_helper.h",
    "web_app_translation_manager.cc",
    "web_app_translation_manager.h",
    "web_app_ui_manager.cc",
    "web_app_ui_manager.h",
    "web_app_uninstall_dialog_user_options.h",
    "web_app_utils.cc",
    "web_app_utils.h",
    "web_contents/web_app_data_retriever.cc",
    "web_contents/web_app_data_retriever.h",
    "web_contents/web_app_icon_downloader.cc",
    "web_contents/web_app_icon_downloader.h",
    "web_contents/web_contents_manager.cc",
    "web_contents/web_contents_manager.h",
    "web_install_service_impl.cc",
    "web_install_service_impl.h",
  ]

  if (is_chromeos) {
    sources += [
      "chromeos_web_app_experiments.cc",
      "chromeos_web_app_experiments.h",
      "commands/install_app_from_verified_manifest_command.cc",
      "commands/install_app_from_verified_manifest_command.h",
      "isolated_web_apps/policy/isolated_web_app_external_install_options.cc",
      "isolated_web_apps/policy/isolated_web_app_external_install_options.h",
      "isolated_web_apps/policy/isolated_web_app_policy_constants.cc",
      "isolated_web_apps/policy/isolated_web_app_policy_constants.h",
      "isolated_web_apps/policy/isolated_web_app_policy_manager.cc",
      "isolated_web_apps/policy/isolated_web_app_policy_manager.h",
      "migrations/adobe_express_oem_to_default_migration.cc",
      "migrations/adobe_express_oem_to_default_migration.h",
      "migrations/migrate_preinstalls_to_aps.cc",
      "migrations/migrate_preinstalls_to_aps.h",
      "os_integration/web_app_run_on_os_login_chromeos.cc",
      "os_integration/web_app_shortcut_chromeos.cc",
      "web_app_run_on_os_login_manager.cc",
      "web_app_run_on_os_login_manager.h",
    ]
  } else {
    sources += [
      "jobs/link_capturing.cc",
      "jobs/link_capturing.h",
    ]
  }

  if (is_chromeos_ash) {
    sources += [
      "web_app_system_web_app_delegate_map_utils.cc",
      "web_app_system_web_app_delegate_map_utils.h",
    ]
  }

  if (is_linux) {
    # Desktop linux, doesn't count ChromeOS.
    sources += [
      "os_integration/web_app_file_handler_registration_linux.cc",
      "os_integration/web_app_run_on_os_login_linux.cc",
      "os_integration/web_app_shortcut_linux.cc",
      "os_integration/web_app_shortcut_linux.h",
    ]
  }

  if (is_mac) {
    sources += [
      "os_integration/mac/app_shim_launch.h",
      "os_integration/mac/app_shim_launch.mm",
      "os_integration/mac/app_shim_registry.cc",
      "os_integration/mac/app_shim_registry.h",
      "os_integration/mac/app_shim_termination_observer.h",
      "os_integration/mac/app_shim_termination_observer.mm",
      "os_integration/mac/apps_folder_support.h",
      "os_integration/mac/apps_folder_support.mm",
      "os_integration/mac/bundle_info_plist.h",
      "os_integration/mac/bundle_info_plist.mm",
      "os_integration/mac/icns_encoder.cc",
      "os_integration/mac/icns_encoder.h",
      "os_integration/mac/icon_utils.h",
      "os_integration/mac/icon_utils.mm",
      "os_integration/mac/web_app_auto_login_util.cc",
      "os_integration/mac/web_app_auto_login_util.h",
      "os_integration/mac/web_app_file_handler_registration_mac.cc",
      "os_integration/mac/web_app_protocol_handler_registration_mac.cc",
      "os_integration/mac/web_app_run_on_os_login_mac.mm",
      "os_integration/mac/web_app_shortcut_creator.h",
      "os_integration/mac/web_app_shortcut_creator.mm",
      "os_integration/mac/web_app_shortcut_mac.h",
      "os_integration/mac/web_app_shortcut_mac.mm",
    ]
  }

  if (is_win) {
    sources += [
      "os_integration/web_app_file_handler_registration_win.cc",
      "os_integration/web_app_handler_registration_utils_win.cc",
      "os_integration/web_app_handler_registration_utils_win.h",
      "os_integration/web_app_protocol_handler_registration_win.cc",
      "os_integration/web_app_run_on_os_login_win.cc",
      "os_integration/web_app_shortcut_win.cc",
      "os_integration/web_app_shortcut_win.h",
      "os_integration/web_app_shortcuts_menu_win.cc",
      "os_integration/web_app_shortcuts_menu_win.h",
      "os_integration/web_app_uninstallation_via_os_settings_registration_win.cc",
    ]
  }

  if (!is_android) {
    sources += [
      "policy/web_app_settings_policy_handler.cc",
      "policy/web_app_settings_policy_handler.h",
    ]
  }

  # Enable the "exit_time_destructors" warning here to avoid accidentally
  # adding exit time destructors and because the flag is not enabled by default.
  # TODO(http://crbug.com/101600):  Remove once exit_time_destructors is enabled
  # by default.
  configs += [ "//build/config/compiler:wexit_time_destructors" ]

  assert_no_deps = [
    # TODO: Exclude "//extensions" as well.
    "//chrome/browser/apps/app_service",
    "//chrome/browser/ash/system_web_apps",
    "//chrome/browser/extensions",
  ]

  deps = [
    "//base",
    "//build:branding_buildflags",
    "//build:chromeos_buildflags",
    "//chrome/app/resources:platform_locale_settings",
    "//chrome/app/theme:chrome_unscaled_resources",
    "//chrome/browser:browser_process",
    "//chrome/browser/apps:user_type_filter",
    "//chrome/browser/apps/app_service:constants",
    "//chrome/browser/browsing_data:constants",
    "//chrome/browser/favicon",
    "//chrome/browser/profiles:profile",
    "//chrome/browser/shortcuts",
    "//chrome/browser/sync:factories",
    "//chrome/browser/task_manager",
    "//chrome/common",
    "//chrome/common:chrome_features",
    "//chrome/common:non_code_constants",
    "//components/base32:base32",
    "//components/browsing_data/content",
    "//components/content_settings/core/browser",
    "//components/content_settings/core/browser:cookie_settings",
    "//components/crx_file",
    "//components/custom_handlers",
    "//components/device_event_log",
    "//components/keep_alive_registry:keep_alive_registry",
    "//components/keyed_service/content",
    "//components/password_manager/content/common",
    "//components/performance_manager",
    "//components/permissions:permissions",
    "//components/policy/core/browser",
    "//components/pref_registry",
    "//components/resources:components_resources_grit",
    "//components/services/app_service",
    "//components/site_engagement/content",
    "//components/site_engagement/core/mojom:mojo_bindings",
    "//components/sync",
    "//components/ukm",
    "//components/user_manager",
    "//components/web_package",
    "//components/webapps/browser",
    "//components/webapps/common:common",
    "//components/webapps/common:mojo_bindings",
    "//components/webapps/services/web_app_origin_association:lib",
    "//components/webapps/services/web_app_origin_association:service",
    "//content/browser/background_fetch:background_fetch_proto",
    "//content/public/browser",
    "//mojo/core/embedder",
    "//mojo/core/embedder:features",
    "//mojo/public/cpp/bindings",
    "//net",
    "//services/data_decoder/public/cpp",
    "//services/metrics/public/cpp:ukm_builders",
    "//services/network/public/cpp",
    "//services/preferences/public/cpp",
    "//skia",
    "//third_party/blink/public/common",
    "//ui/base",
    "//ui/base/idle",
    "//ui/events/devices:devices",
    "//url",
  ]

  if (is_chrome_branded) {
    sources += [
      "preinstalled_web_apps/gmail.cc",
      "preinstalled_web_apps/gmail.h",
      "preinstalled_web_apps/google_docs.cc",
      "preinstalled_web_apps/google_docs.h",
      "preinstalled_web_apps/google_drive.cc",
      "preinstalled_web_apps/google_drive.h",
      "preinstalled_web_apps/google_sheets.cc",
      "preinstalled_web_apps/google_sheets.h",
      "preinstalled_web_apps/google_slides.cc",
      "preinstalled_web_apps/google_slides.h",
      "preinstalled_web_apps/youtube.cc",
      "preinstalled_web_apps/youtube.h",
    ]

    if (is_chromeos) {
      sources += [
        # TODO(crbug.com/358173556): Remove internal sources.
        "//chrome/browser/resources/preinstalled_web_apps/internal/container_util.cc",
        "//chrome/browser/resources/preinstalled_web_apps/internal/container_util.h",
        "preinstalled_web_apps/app_mall.cc",
        "preinstalled_web_apps/app_mall.h",
        "preinstalled_web_apps/calculator.cc",
        "preinstalled_web_apps/calculator.h",
        "preinstalled_web_apps/container.cc",
        "preinstalled_web_apps/container.h",
        "preinstalled_web_apps/google_calendar.cc",
        "preinstalled_web_apps/google_calendar.h",
        "preinstalled_web_apps/google_chat.cc",
        "preinstalled_web_apps/google_chat.h",
        "preinstalled_web_apps/google_meet.cc",
        "preinstalled_web_apps/google_meet.h",
        "preinstalled_web_apps/messages_dogfood.cc",
        "preinstalled_web_apps/messages_dogfood.h",
      ]
    }

    deps += [ "//chrome/browser/resources:preinstalled_web_apps_resources" ]
  }

  if (is_mac) {
    deps += [ "//components/os_crypt/sync:os_crypt" ]
  }

  if (is_win) {
    deps += [
      "//chrome/browser/web_applications/chrome_pwa_launcher:util",
      "//components/custom_handlers",
    ]
  }

  if (is_chromeos_ash) {
    deps += [
      "//ash/components/arc:arc_base",
      "//ash/constants",
      "//ash/public/cpp",
      "//ash/webui/system_apps/public:system_web_app_type",
      "//chrome/browser/ash/crosapi:browser_util",
      "//chrome/browser/ash/drive",
      "//chrome/browser/ash/profiles",
      "//chrome/browser/ash/system_web_apps/types",
      "//chrome/common/chromeos/extensions",
      "//chromeos/ash/components/browser_context_helper",
    ]
  }

  if (is_chromeos_lacros) {
    deps += [
      "//chromeos/lacros",
      "//chromeos/startup",
    ]
  }

  if (is_chromeos) {
    deps += [
      "//chrome/browser/chromeos/echo",
      "//chromeos/components/mgs",
      "//chromeos/constants:constants",
    ]
  }

  public_deps = [
    "//chrome/browser:browser_public_dependencies",
    "//chrome/browser/web_applications/isolated_web_apps/key_distribution/proto",
    "//chrome/browser/web_applications/mojom:mojom_web_apps_enum",
    "//chrome/browser/web_applications/proto",
    "//chrome/browser/web_applications/proto:proto_helpers",
    "//components/permissions:permissions",
    "//components/services/app_service",
  ]
}

# This test_support library doesn't use extensions. It must not depend on
# //chrome/test:test_support{_ui} as it is depended upon by those targets.
source_set("web_applications_test_support") {
  testonly = true

  sources = [
    "isolated_web_apps/test/integrity_block_data_matcher.h",
    "isolated_web_apps/test/isolated_web_app_builder.cc",
    "isolated_web_apps/test/isolated_web_app_builder.h",
    "isolated_web_apps/test/isolated_web_app_fake_response_reader_factory.cc",
    "isolated_web_apps/test/isolated_web_app_fake_response_reader_factory.h",
    "isolated_web_apps/test/iwa_test_server_configurator.cc",
    "isolated_web_apps/test/iwa_test_server_configurator.h",
    "isolated_web_apps/test/key_distribution/test_utils.cc",
    "isolated_web_apps/test/key_distribution/test_utils.h",
    "isolated_web_apps/test/test_signed_web_bundle_builder.cc",
    "isolated_web_apps/test/test_signed_web_bundle_builder.h",
    "test/debug_info_printer.cc",
    "test/debug_info_printer.h",
    "test/external_app_registration_waiter.cc",
    "test/external_app_registration_waiter.h",
    "test/fake_data_retriever.cc",
    "test/fake_data_retriever.h",
    "test/fake_environment.cc",
    "test/fake_environment.h",
    "test/fake_externally_managed_app_manager.cc",
    "test/fake_externally_managed_app_manager.h",
    "test/fake_os_integration_manager.cc",
    "test/fake_os_integration_manager.h",
    "test/fake_web_app_database_factory.cc",
    "test/fake_web_app_database_factory.h",
    "test/fake_web_app_origin_association_manager.cc",
    "test/fake_web_app_origin_association_manager.h",
    "test/fake_web_app_provider.cc",
    "test/fake_web_app_provider.h",
    "test/fake_web_app_ui_manager.cc",
    "test/fake_web_app_ui_manager.h",
    "test/fake_web_contents_manager.cc",
    "test/fake_web_contents_manager.h",
    "test/mock_data_retriever.cc",
    "test/mock_data_retriever.h",
    "test/mock_file_utils_wrapper.cc",
    "test/mock_file_utils_wrapper.h",
    "test/os_integration_test_override_impl.cc",
    "test/os_integration_test_override_impl.h",
    "test/signed_web_bundle_utils.cc",
    "test/signed_web_bundle_utils.h",
    "test/test_file_utils.cc",
    "test/test_file_utils.h",
    "test/test_web_app_url_loader.cc",
    "test/test_web_app_url_loader.h",
    "test/web_app_icon_test_utils.cc",
    "test/web_app_icon_test_utils.h",
    "test/web_app_icon_waiter.cc",
    "test/web_app_icon_waiter.h",
    "test/web_app_install_test_utils.cc",
    "test/web_app_install_test_utils.h",
    "test/web_app_sync_test_utils.cc",
    "test/web_app_sync_test_utils.h",
    "test/web_app_test_observers.cc",
    "test/web_app_test_observers.h",
    "test/web_app_test_utils.cc",
    "test/web_app_test_utils.h",
    "test/with_crosapi_param.cc",
    "test/with_crosapi_param.h",
  ]
  if (is_chromeos) {
    sources += [
      "isolated_web_apps/test/mock_isolated_web_app_install_command_wrapper.cc",
      "isolated_web_apps/test/mock_isolated_web_app_install_command_wrapper.h",
      "isolated_web_apps/test/policy_generator.cc",
      "isolated_web_apps/test/policy_generator.h",
      "isolated_web_apps/test/test_iwa_installer_factory.cc",
      "isolated_web_apps/test/test_iwa_installer_factory.h",
    ]
  }
  public_deps = [
    "//chrome/browser/web_applications/isolated_web_apps/key_distribution/proto",
    "//components/webapps/common:mojo_bindings",
  ]
  deps = [
    ":web_applications",
    "//base/test:test_support",
    "//chrome/app:command_ids",
    "//chrome/app/theme:chrome_unscaled_resources_grit",
    "//chrome/browser",
    "//chrome/browser:browser_process",
    "//chrome/browser/apps/app_service",
    "//chrome/browser/profiles:profile",
    "//chrome/browser/ui",
    "//components/base32",
    "//components/keyed_service/content",
    "//components/services/app_service",
    "//components/sync:test_support",
    "//components/sync_preferences:test_support",
    "//components/web_package:web_package",
    "//components/web_package/test_support",
    "//components/webapps/browser",
    "//components/webapps/common",
    "//content/test:test_support",
    "//services/data_decoder/public/cpp:test_support",
    "//testing/gtest",
    "//ui/gfx:test_support",
    "//ui/webui",
  ]
  if (is_chromeos_ash) {
    deps += [
      "//ash/constants",
      "//chrome/browser/ash/crosapi:browser_util",
      "//chrome/browser/ash/system_web_apps",
      "//chrome/browser/ash/system_web_apps/types",
    ]
  }
}

# This has to be a separate target to avoid circular dependencies with
# `//chrome/test:test_support` target.
source_set("prevent_close_test_support") {
  testonly = true

  sources = [
    "test/prevent_close_test_base.cc",
    "test/prevent_close_test_base.h",
  ]
  deps = [
    ":web_applications",
    ":web_applications_test_support",
    "//chrome/browser/policy:test_support",
    "//chrome/browser/profiles:profile",
    "//chrome/browser/ui:ui",
    "//chrome/test:test_support",
    "//components/policy/core/common:test_support",
    "//components/webapps/common:common",
    "//ui/base:types",
  ]
}

test("web_application_fuzztests") {
  testonly = true
  fuzztests =
      [ "UpdateManifestFuzzTest.UpdateManifestCanSuccessfullyParseAnyString" ]

  sources = [ "isolated_web_apps/update_manifest/update_manifest_fuzzer.cc" ]

  deps = [
    ":web_applications",
    ":web_applications_test_support",
    "//base/test:fuzztest_support",
    "//chrome/test:test_support",
    "//components/webapps/common:common",
    "//third_party/fuzztest:fuzztest_gtest_main",
  ]
}

source_set("web_applications_unit_tests") {
  testonly = true

  sources = [
    "commands/clear_browsing_data_command_unittest.cc",
    "commands/dedupe_install_urls_command_unittest.cc",
    "commands/external_app_resolution_command_unittest.cc",
    "commands/fetch_install_info_from_install_url_command_unittest.cc",
    "commands/fetch_installability_for_chrome_management_unittest.cc",
    "commands/fetch_manifest_and_install_command_unittest.cc",
    "commands/install_app_locally_command_unittest.cc",
    "commands/install_from_sync_command_unittest.cc",
    "commands/manifest_update_check_command_unittest.cc",
    "commands/manifest_update_finalize_command_unittest.cc",
    "commands/os_integration_synchronize_command_unittest.cc",
    "commands/run_on_os_login_command_unittest.cc",
    "commands/set_user_display_mode_command_unittest.cc",
    "commands/uninstall_all_user_installed_web_apps_command_unittest.cc",
    "commands/update_file_handler_command_unittest.cc",
    "commands/web_app_uninstall_command_unittest.cc",
    "daily_metrics_helper_unittest.cc",
    "external_install_options_unittest.cc",
    "externally_managed_app_manager_impl_unittest.cc",
    "externally_managed_app_manager_unittest.cc",
    "isolated_web_apps/check_isolated_web_app_bundle_installability_command_unittest.cc",
    "isolated_web_apps/error/uma_logging_unittest.cc",
    "isolated_web_apps/error/unusable_swbn_file_error_unittest.cc",
    "isolated_web_apps/get_controlled_frame_partition_command_unittest.cc",
    "isolated_web_apps/install_isolated_web_app_command_unittest.cc",
    "isolated_web_apps/isolated_web_app_apply_update_command_unittest.cc",
    "isolated_web_apps/isolated_web_app_downloader_unittest.cc",
    "isolated_web_apps/isolated_web_app_features_unittest.cc",
    "isolated_web_apps/isolated_web_app_install_command_helper_unittest.cc",
    "isolated_web_apps/isolated_web_app_install_source_unittest.cc",
    "isolated_web_apps/isolated_web_app_installation_manager_unittest.cc",
    "isolated_web_apps/isolated_web_app_prepare_and_store_update_command_unittest.cc",
    "isolated_web_apps/isolated_web_app_reader_registry_factory_unittest.cc",
    "isolated_web_apps/isolated_web_app_reader_registry_unittest.cc",
    "isolated_web_apps/isolated_web_app_response_reader_factory_unittest.cc",
    "isolated_web_apps/isolated_web_app_response_reader_unittest.cc",
    "isolated_web_apps/isolated_web_app_source_unittest.cc",
    "isolated_web_apps/isolated_web_app_trust_checker_unittest.cc",
    "isolated_web_apps/isolated_web_app_update_apply_waiter_unittest.cc",
    "isolated_web_apps/isolated_web_app_update_discovery_task_unittest.cc",
    "isolated_web_apps/isolated_web_app_update_manager_unittest.cc",
    "isolated_web_apps/isolated_web_app_url_info_unittest.cc",
    "isolated_web_apps/isolated_web_app_url_loader_factory_unittest.cc",
    "isolated_web_apps/isolated_web_app_validator_unittest.cc",
    "isolated_web_apps/isolated_web_app_version_unittest.cc",
    "isolated_web_apps/key_distribution/iwa_key_distribution_info_provider_unittest.cc",
    "isolated_web_apps/pending_install_info_unittest.cc",
    "isolated_web_apps/signed_web_bundle_metadata_unittest.cc",
    "isolated_web_apps/signed_web_bundle_reader_unittest.cc",
    "isolated_web_apps/update_manifest/update_manifest_fetcher_unittest.cc",
    "isolated_web_apps/update_manifest/update_manifest_unittest.cc",
    "jobs/install_placeholder_job_unittest.cc",
    "locks/partitioned_lock_manager_unittest.cc",
    "locks/web_app_lock_manager_unittest.cc",
    "os_integration/file_handling_sub_manager_unittest.cc",
    "os_integration/file_handling_utils_unittest.cc",
    "os_integration/protocol_handling_sub_manager_unittest.cc",
    "os_integration/run_on_os_login_sub_manager_unittest.cc",
    "os_integration/shortcut_menu_handling_sub_manager_unittest.cc",
    "os_integration/shortcut_sub_manager_unittest.cc",
    "os_integration/uninstallation_via_os_settings_sub_manager_unittest.cc",
    "os_integration/web_app_protocol_handler_manager_unittest.cc",
    "os_integration/web_app_shortcut_unittest.cc",
    "policy/pre_redirection_url_observer_unittest.cc",
    "policy/web_app_policy_manager_unittest.cc",
    "preinstalled_web_app_manager_unittest.cc",
    "preinstalled_web_app_utils_unittest.cc",
    "preinstalled_web_apps/preinstalled_web_app_definition_utils_unittest.cc",
    "tabbed_mode_scope_matcher_unittest.cc",
    "test/web_app_test.cc",
    "test/web_app_test.h",
    "web_app_command_manager_unittest.cc",
    "web_app_command_scheduler_unittest.cc",
    "web_app_constants_unittest.cc",
    "web_app_database_unittest.cc",
    "web_app_helpers_unittest.cc",
    "web_app_icon_generator_unittest.cc",
    "web_app_icon_manager_unittest.cc",
    "web_app_install_finalizer_unittest.cc",
    "web_app_install_utils_unittest.cc",
    "web_app_pref_guardrails_unittest.cc",
    "web_app_proto_utils_unittest.cc",
    "web_app_registrar_unittest.cc",
    "web_app_sync_bridge_unittest.cc",
    "web_app_translation_manager_unittest.cc",
    "web_app_ui_manager_unittest.cc",
    "web_app_unittest.cc",
    "web_app_utils_unittest.cc",
    "web_contents/web_app_data_retriever_unittest.cc",
    "web_contents/web_app_icon_downloader_unittest.cc",
  ]

  if (is_win) {
    sources += [
      "os_integration/web_app_file_handler_registration_win_unittest.cc",
      "os_integration/web_app_handler_registration_utils_win_unittest.cc",
      "os_integration/web_app_protocol_handler_registration_win_unittest.cc",
      "os_integration/web_app_run_on_os_login_win_unittest.cc",
      "os_integration/web_app_shortcut_win_unittest.cc",
    ]
  }

  if (is_mac) {
    sources += [
      "os_integration/mac/app_shim_registry_unittest.cc",
      "os_integration/mac/icns_encoder_unittest.cc",
      "os_integration/mac/shortcuts_versioning_mac_unittest.cc",
      "os_integration/mac/web_app_run_on_os_login_mac_unittest.mm",
      "os_integration/mac/web_app_shortcut_creator_unittest.mm",
    ]
  }

  if (is_linux) {
    # Desktop linux, doesn't count ChromeOS.
    sources += [
      "os_integration/web_app_run_on_os_login_linux_unittest.cc",
      "os_integration/web_app_shortcut_linux_unittest.cc",
    ]
  }

  if (!is_android && !is_chromeos) {
    sources += [ "policy/web_app_settings_policy_handler_unittest.cc" ]
  }

  if (is_chromeos) {
    sources += [
      "isolated_web_apps/policy/isolated_web_app_external_install_options_unittest.cc",
      "isolated_web_apps/policy/isolated_web_app_policy_manager_unittest.cc",
      "os_integration/web_app_run_on_os_login_chromeos_unittest.cc",
      "web_app_run_on_os_login_manager_unittest.cc",
    ]
  } else {
    sources += [ "jobs/link_capturing_unittest.cc" ]
  }

  deps = [
    ":web_applications",
    ":web_applications_test_support",
    "//base/test:test_support",
    "//build:chromeos_buildflags",
    "//chrome/app/theme:theme_resources",
    "//chrome/browser",
    "//chrome/browser:browser_process",
    "//chrome/browser/apps/app_service",
    "//chrome/browser/apps/link_capturing:test_support",
    "//chrome/browser/profiles:profile",
    "//chrome/common",
    "//chrome/common:chrome_features",
    "//chrome/test:test_support",
    "//components/os_crypt/sync:test_support",
    "//components/services/app_service",
    "//components/user_manager",
    "//components/web_package",
    "//components/web_package/test_support",
    "//components/webapps/browser",
    "//components/webapps/browser:test_support",
    "//components/webapps/common",
    "//components/webapps/common:mojo_bindings",
    "//content/public/browser",
    "//content/public/common",
    "//content/test:test_support",
    "//services/metrics/public/cpp:ukm_builders",
    "//services/preferences/public/cpp",
    "//skia",
    "//testing/gmock",
    "//testing/gtest",
    "//ui/base/idle:idle",
    "//ui/base/idle:test_support",
    "//ui/events/devices:test_support",
    "//ui/gfx:test_support",
  ]

  if (enable_extensions) {
    deps += [
      "//chrome/browser/extensions:test_support",
      "//chrome/browser/web_applications/extensions:extensions",
    ]
  }

  if (is_chromeos_ash) {
    deps += [
      "//ash/components/arc:arc",
      "//ash/components/arc:arc_test_support",
      "//ash/components/arc/mojom",
      "//ash/constants",
      "//chrome/browser/ash/app_list",
      "//chrome/browser/ash/app_list/arc:test_support",
      "//chrome/browser/ash/crosapi:browser_util",
      "//chrome/browser/ash/system_web_apps/test_support",
      "//chrome/browser/ash/system_web_apps/types",
      "//chrome/common/chromeos/extensions",
      "//chromeos/ash/components/browser_context_helper",
      "//chromeos/ash/components/system",
      "//components/arc:arc_test_support",
    ]
  }

  if (is_chromeos_lacros) {
    deps += [
      "//chromeos/lacros",
      "//chromeos/lacros:test_support",
      "//chromeos/startup:startup",
    ]
  }

  if (is_win) {
    deps += [
      "//chrome/browser/web_applications/chrome_pwa_launcher:unit_tests",
      "//chrome/browser/web_applications/chrome_pwa_launcher:util",
    ]
  }

  if (is_win || is_mac || is_linux) {
    deps += [ "//components/services/app_service" ]
  }

  if (enable_nacl) {
    deps += [ "//components/nacl/browser" ]
  }
}

group("unit_tests") {
  testonly = true

  deps = [
    ":web_applications_unit_tests",
    "//chrome/browser/web_applications/app_service:unit_tests",
  ]

  if (enable_extensions) {
    deps += [ "//chrome/browser/web_applications/extensions:unit_tests" ]
  }
}

source_set("web_applications_browser_tests") {
  testonly = true

  sources = [
    "commands/compute_app_size_command_browsertest.cc",
    "commands/externally_managed_install_command_browsertest.cc",
    "commands/fetch_manifest_and_install_command_browsertest.cc",
    "commands/install_from_info_command_browsertest.cc",
    "commands/install_from_sync_command_browsertest.cc",
    "commands/launch_web_app_command_browsertest.cc",
    "commands/navigate_and_trigger_install_dialog_command_browsertest.cc",
    "commands/update_protocol_handler_approval_command_browsertest.cc",
    "isolated_web_apps/garbage_collect_storage_partitions_command_browsertest.cc",
    "isolated_web_apps/get_isolated_web_app_browsing_data_command_browsertest.cc",
    "isolated_web_apps/install_isolated_web_app_from_command_line_browsertest.cc",
    "isolated_web_apps/isolated_web_app_browsertest.cc",
    "isolated_web_apps/isolated_web_app_browsing_data_browsertest.cc",
    "isolated_web_apps/isolated_web_app_csp_browsertest.cc",
    "isolated_web_apps/isolated_web_app_dev_tools_browsertest.cc",
    "isolated_web_apps/isolated_web_app_error_page_browsertest.cc",
    "isolated_web_apps/isolated_web_app_install_prepare_apply_update_browsertest.cc",
    "isolated_web_apps/isolated_web_app_uninstall_browsertest.cc",
    "isolated_web_apps/isolated_web_app_url_loader_factory_browsertest.cc",
    "isolated_web_apps/key_distribution/iwa_key_distribution_component_installer_browsertest.cc",
    "manifest_update_manager_browsertest.cc",
    "policy/web_app_policy_manager_browsertest.cc",
    "preinstalled_web_app_manager_browsertest.cc",
    "preinstalled_web_apps_browsertest.cc",
    "user_uninstalled_preinstalled_web_app_prefs_browsertest.cc",
    "web_app_audio_focus_browsertest.cc",
    "web_app_icon_manager_browsertest.cc",
    "web_app_internals_browsertest.cc",
    "web_app_origin_association_manager_browsertest.cc",
    "web_app_scope_extensions_browsertest.cc",
  ]

  if (is_chromeos) {
    sources += [
      "commands/install_app_from_verified_manifest_command_browsertest.cc",
      "migrations/adobe_express_oem_to_default_migration_browsertest.cc",
      "migrations/migrate_preinstalls_to_aps_browsertest.cc",
      "web_app_run_on_os_login_manager_browsertest.cc",

      # TODO(crbug.com/40274058): Support automatic IWA updates on other
      # platforms.
      "isolated_web_apps/isolated_web_app_update_manager_browsertest.cc",
    ]
  }

  if (!is_chromeos_lacros) {
    sources += [ "web_app_link_capturing_parameterized_browsertest.cc" ]
  }

  if (is_linux) {
    sources += [
      "os_integration/web_app_file_handler_registration_linux_browsertest.cc",
    ]
  }

  if (is_chromeos_ash) {
    sources += [ "isolated_web_apps/policy/isolated_web_app_policy_manager_ash_browsertest.cc" ]
  }

  defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]

  deps = [
    ":web_applications",
    ":web_applications_test_support",
    "//base",
    "//chrome/app:command_ids",
    "//chrome/browser/apps/app_service",
    "//chrome/browser/apps/app_service:app_registry_cache_waiter",
    "//chrome/browser/apps/app_service:test_support",
    "//chrome/browser/apps/link_capturing:test_support",
    "//chrome/browser/browsing_data:constants",
    "//chrome/browser/devtools:test_support",
    "//chrome/browser/profiles:profile",
    "//chrome/browser/ui:browser_navigator_params_headers",
    "//chrome/browser/ui/views/toolbar",
    "//chrome/common:chrome_features",
    "//chrome/test:test_support",
    "//chrome/test:test_support_ui",
    "//components/browsing_data/core",
    "//components/embedder_support:embedder_support",
    "//components/segmentation_platform/public:public",
    "//components/segmentation_platform/public:test_support",
    "//components/services/app_service",
    "//components/site_engagement/content",
    "//components/user_manager",
    "//components/web_package",
    "//components/web_package/test_support",
    "//components/webapps/browser",
    "//components/webapps/browser:test_support",
    "//components/webapps/common",
    "//components/webapps/services/web_app_origin_association/test:test_support",
    "//content/public/browser",
    "//ui/color",
    "//ui/events/devices:test_support",
    "//url",
  ]

  if (is_chromeos_ash) {
    deps += [
      "//chrome/browser/ash/app_list",
      "//chrome/browser/ash/login:test_support",
      "//chrome/browser/ash/login/ui",
      "//chrome/browser/ash/policy/core",
      "//chrome/browser/ash/policy/core:test_support",
      "//chrome/browser/ash/policy/test_support",
      "//chrome/browser/ash/system_web_apps/test_support",
      "//chrome/browser/ash/system_web_apps/test_support:test_support_ui",
    ]
  }

  if (is_chromeos_lacros) {
    deps += [
      "//chrome/browser/web_applications/app_service:test_support",
      "//chromeos/constants",
      "//chromeos/lacros",
      "//chromeos/startup",
    ]
  }
}

group("browser_tests") {
  testonly = true

  deps = [ ":web_applications_browser_tests" ]
}

# On Lacros, these browser tests require Ash to be running.
source_set("app_service_browser_tests") {
  testonly = true

  sources = [ "preinstalled_web_app_migration_browsertest.cc" ]

  if (is_chromeos) {
    sources += [ "chromeos_web_app_experiments_browsertest.cc" ]
  }

  # On Lacros, this test is added to the lacros_chrome_browsertests target.
  if (!is_chromeos_lacros) {
    sources += [ "externally_managed_app_manager_browsertest.cc" ]
  }

  defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]

  deps = [
    ":web_applications",
    ":web_applications_test_support",
    "//base",
    "//chrome/browser/apps/app_service",
    "//chrome/browser/apps/app_service:app_registry_cache_waiter",
    "//chrome/browser/apps/link_capturing:test_support",
    "//chrome/test:test_support",
    "//chrome/test:test_support_ui",
    "//components/webapps/browser",
  ]

  if (is_chromeos) {
    deps += [ "//chromeos/constants:constants" ]
  }

  if (is_chromeos_lacros) {
    deps += [
      "//chromeos/lacros:lacros",
      "//chromeos/startup",
    ]
  }

  if (is_chromeos_ash) {
    deps += [
      "//chrome/browser/ash/app_list",
      "//chrome/browser/ui/ash/shelf",
    ]
  }
}

source_set("interactive_ui_tests") {
  testonly = true

  sources = [
    "isolated_web_apps/isolated_web_app_interactive_uitest.cc",
    "web_app_notifications_interactive_uitest.cc",
  ]

  defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]

  deps = [
    ":web_applications",
    ":web_applications_test_support",
    "//chrome/app:command_ids",
    "//chrome/test:test_support",
    "//chrome/test:test_support_ui",
    "//components/permissions:permissions",
    "//components/webapps/browser",
    "//components/webapps/common",
    "//ui/base/idle:idle",
    "//ui/base/idle:test_support",
    "//ui/events/devices:test_support",
  ]

  if (is_mac) {
    deps += [ "//chrome/browser/apps/app_shim" ]
  }
}