chromium/chrome/browser/web_applications/manifest_update_manager_browsertest.cc

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

#include "chrome/browser/web_applications/manifest_update_manager.h"

#include <ios>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>

#include "base/check.h"
#include "base/check_op.h"
#include "base/containers/contains.h"
#include "base/containers/flat_tree.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ref.h"
#include "base/notreached.h"
#include "base/numerics/clamped_math.h"
#include "base/numerics/safe_conversions.h"
#include "base/run_loop.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_future.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/buildflag.h"
#include "build/chromeos_buildflags.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/web_applications/test/isolated_web_app_test_utils.h"
#include "chrome/browser/ui/web_applications/test/web_app_browsertest_util.h"
#include "chrome/browser/ui/web_applications/web_app_browser_controller.h"
#include "chrome/browser/ui/web_applications/web_app_browsertest_base.h"
#include "chrome/browser/ui/web_applications/web_app_dialogs.h"
#include "chrome/browser/web_applications/external_install_options.h"
#include "chrome/browser/web_applications/externally_managed_app_manager.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_info.h"
#include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h"
#include "chrome/browser/web_applications/os_integration/os_integration_manager.h"
#include "chrome/browser/web_applications/os_integration/web_app_shortcut.h"
#include "chrome/browser/web_applications/proto/web_app_install_state.pb.h"
#include "chrome/browser/web_applications/test/web_app_icon_test_utils.h"
#include "chrome/browser/web_applications/test/web_app_install_test_utils.h"
#include "chrome/browser/web_applications/test/web_app_sync_test_utils.h"
#include "chrome/browser/web_applications/test/web_app_test_observers.h"
#include "chrome/browser/web_applications/test/web_app_test_utils.h"
#include "chrome/browser/web_applications/web_app.h"
#include "chrome/browser/web_applications/web_app_callback_app_identity.h"
#include "chrome/browser/web_applications/web_app_command_manager.h"
#include "chrome/browser/web_applications/web_app_command_scheduler.h"
#include "chrome/browser/web_applications/web_app_constants.h"
#include "chrome/browser/web_applications/web_app_helpers.h"
#include "chrome/browser/web_applications/web_app_icon_generator.h"
#include "chrome/browser/web_applications/web_app_icon_manager.h"
#include "chrome/browser/web_applications/web_app_install_finalizer.h"
#include "chrome/browser/web_applications/web_app_install_info.h"
#include "chrome/browser/web_applications/web_app_install_params.h"
#include "chrome/browser/web_applications/web_app_proto_utils.h"
#include "chrome/browser/web_applications/web_app_provider.h"
#include "chrome/browser/web_applications/web_app_registrar.h"
#include "chrome/browser/web_applications/web_app_registry_update.h"
#include "chrome/browser/web_applications/web_app_sync_bridge.h"
#include "chrome/browser/web_applications/web_app_tab_helper.h"
#include "chrome/browser/web_applications/web_app_ui_manager.h"
#include "chrome/browser/web_applications/web_app_utils.h"
#include "chrome/common/chrome_features.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/services/app_service/public/cpp/file_handler.h"
#include "components/services/app_service/public/cpp/icon_info.h"
#include "components/services/app_service/public/cpp/protocol_handler_info.h"
#include "components/services/app_service/public/cpp/share_target.h"
#include "components/webapps/browser/features.h"
#include "components/webapps/browser/install_result_code.h"
#include "components/webapps/browser/installable/installable_metrics.h"
#include "components/webapps/browser/uninstall_result_code.h"
#include "components/webapps/common/web_app_id.h"
#include "components/webapps/services/web_app_origin_association/test/test_web_app_origin_association_fetcher.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/prerender_test_util.h"
#include "content/public/test/url_loader_interceptor.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "net/base/net_errors.h"
#include "net/http/http_status_code.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/mojom/url_loader.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_family.h"
#include "ui/views/test/dialog_test.h"
#include "ui/views/test/widget_test.h"
#include "ui/views/widget/any_widget_observer.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
#include "ui/views/window/dialog_delegate.h"
#include "url/gurl.h"
#include "url/origin.h"

#if BUILDFLAG(IS_MAC)
#include "base/mac/mac_util.h"
#endif

#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/constants/ash_features.h"
#include "chrome/browser/ash/system_web_apps/test_support/test_system_web_app_installation.h"
#include "chromeos/ash/components/standalone_browser/feature_refs.h"
#endif

#if BUILDFLAG(IS_LINUX)
#include "chrome/browser/web_applications/os_integration/web_app_file_handler_registration.h"
#endif

namespace web_app {

namespace  // namespace

class ManifestUpdateManagerBrowserTest : public WebAppBrowserTestBase {};

enum class UpdateDialogParam {};

class ManifestUpdateManagerBrowserTest_UpdateDialog
    : public ManifestUpdateManagerBrowserTest,
      public testing::WithParamInterface<UpdateDialogParam> {};

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckOutOfScopeNavigation) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest, CheckIsThrottled) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckCancelledByWebContentsDestroyed) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckCancelledByAppUninstalled) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       TriggersAfterLoadingNewManifestUrl) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckIgnoresWhitespaceDifferences) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckIgnoresNameChange) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckIgnoresShortNameChange) {}

// TODO(crbug.com/40231087): Test is flaky.
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS)
#define MAYBE_CheckNameUpdatesForDefaultApps
#else
#define MAYBE_CheckNameUpdatesForDefaultApps
#endif
IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       MAYBE_CheckNameUpdatesForDefaultApps) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckIgnoresStartUrlChange) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckIgnoresNoManifestChange) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckIgnoresInvalidManifest) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckIgnoresNonLocalApps) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckIgnoresPlaceholderApps) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckIgnoresPlaceholderAppsForKiosk) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsThemeColorChange) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsBackgroundColorChange) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsManifestUrlChange) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest, CheckKeepsSameName) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckDoesNotFindIconUrlChange) {}

// TODO(crbug.com/40231087): Test is flaky.
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
#define MAYBE_CheckDoesFindIconUrlChangeForDefaultApps
#else
#define MAYBE_CheckDoesFindIconUrlChangeForDefaultApps
#endif
IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       MAYBE_CheckDoesFindIconUrlChangeForDefaultApps) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckUpdatedPolicyAppsNotUninstallable) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckUpdatedKioskAppsNotUninstallable) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsScopeChange) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       UninstallDialogClosesAppUpdateDialogUninstallsApp) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       UninstallDialogCancelStillShowsAppUpdateDialog) {}

IN_PROC_BROWSER_TEST_P(ManifestUpdateManagerBrowserTest_UpdateDialog,
                       ScopeChangeWithProductIconChange) {}

// TODO(crbug.com/40231087): Test is flaky.
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS)
#define MAYBE_CheckDoesApplyIconURLChangeForDefaultApps
#else
#define MAYBE_CheckDoesApplyIconURLChangeForDefaultApps
#endif
IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       MAYBE_CheckDoesApplyIconURLChangeForDefaultApps) {}

class ManifestUpdateManagerBrowserTest_PolicyAppsCanUpdate
    : public ManifestUpdateManagerBrowserTest,
      public testing::WithParamInterface<bool> {};

IN_PROC_BROWSER_TEST_P(ManifestUpdateManagerBrowserTest_PolicyAppsCanUpdate,
                       CheckDoesApplyIconURLChangeForPolicyAppsWithFlag) {}

// This test ensures app name cannot be changed for policy apps (without a flag
// allowing it).
IN_PROC_BROWSER_TEST_P(ManifestUpdateManagerBrowserTest_PolicyAppsCanUpdate,
                       CheckNameUpdatesForPolicyApps) {}

// This test ensures app icon url can always be changed for Kiosk apps.
IN_PROC_BROWSER_TEST_P(ManifestUpdateManagerBrowserTest_PolicyAppsCanUpdate,
                       CheckDoesApplyIconURLChangeForKioskAppsIgnoringFlag) {}

// This test ensures app name can always be changed for Kiosk apps.
IN_PROC_BROWSER_TEST_P(ManifestUpdateManagerBrowserTest_PolicyAppsCanUpdate,
                       CheckNameUpdatesForKioskApps) {}

INSTANTIATE_TEST_SUITE_P();

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsDisplayChange) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsDisplayBrowserChange) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsDisplayOverrideChange) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsNewDisplayOverride) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsDeletedDisplayOverride) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsInvalidDisplayOverride) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckIgnoresDisplayOverrideInvalidChange) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckIgnoresDisplayOverrideChange) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckDoesNotFindIconContentChange) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckDoesNotUpdateGeneratedIcons) {}

// TODO(crbug.com/40250635): Flakes on multiple platforms.
IN_PROC_BROWSER_TEST_P(ManifestUpdateManagerBrowserTest_UpdateDialog,
                       DISABLED_CheckUpdateOfGeneratedIcons_SyncFailure) {}

INSTANTIATE_TEST_SUITE_P();

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsLaunchHandlerChange) {}

#if BUILDFLAG(IS_CHROMEOS_ASH)
class ManifestUpdateManagerSystemAppBrowserTest
    : public ManifestUpdateManagerBrowserTest {
 public:
  ManifestUpdateManagerSystemAppBrowserTest()
      : system_app_(ash::TestSystemWebAppInstallation::
                        SetUpStandaloneSingleWindowApp()) {}

  void SetUpOnMainThread() override { system_app_->WaitForAppInstall(); }

 protected:
  std::unique_ptr<ash::TestSystemWebAppInstallation> system_app_;
};

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerSystemAppBrowserTest,
                       CheckUpdateSkipped) {
  webapps::AppId app_id = system_app_->GetAppId();
  EXPECT_EQ(GetResultAfterPageLoad(system_app_->GetAppUrl()),
            ManifestUpdateResult::kAppIsSystemWebApp);

  histogram_tester_.ExpectBucketCount(
      kUpdateHistogramName, ManifestUpdateResult::kAppIsSystemWebApp, 1);
  EXPECT_EQ(GetProvider().registrar_unsafe().GetAppThemeColor(app_id),
            SK_ColorGREEN);
}
#endif  // BUILDFLAG(IS_CHROMEOS_ASH)

class ManifestUpdateManagerIsolatedWebAppBrowserTest
    : public IsolatedWebAppBrowserTestHarness {};

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerIsolatedWebAppBrowserTest,
                       CheckUpdateSkipped) {}

ManifestUpdateManagerWebAppsBrowserTest;

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerWebAppsBrowserTest,
                       CheckFindsAddedShareTarget) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerWebAppsBrowserTest,
                       CheckFindsShareTargetChange) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerWebAppsBrowserTest,
                       CheckFindsDeletedShareTarget) {}

// Functional tests. More tests for detecting file handler updates are
// available in unit tests at ManifestUpdateDataFetchUtilsTest.
class ManifestUpdateManagerBrowserTestWithFileHandling
    : public ManifestUpdateManagerBrowserTest {};

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTestWithFileHandling,
                       CheckFindsAddedFileHandler) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTestWithFileHandling,
                       CheckIgnoresUnchangedFileHandler) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTestWithFileHandling,
                       CheckFindsChangedFileExtension) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTestWithFileHandling,
                       FileHandlingPermissionResetsOnUpdate) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTestWithFileHandling,
                       BlockedPermissionPreservedOnUpdate) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTestWithFileHandling,
                       CheckFindsDeletedFileHandler) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTestWithFileHandling,
                       CheckFileExtensionList) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTestWithFileHandling,
                       CheckFileExtensionsList) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTestWithFileHandling,
                       CheckFileExtensionsListWithTwoFileHandlers) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsShortcutsMenuUpdated) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsItemNameUpdated) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckIgnoresShortNameAndDescriptionChange) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsItemUrlUpdated) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsShortcutIconContentChange) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckIconChangeForOemInstallation) {}

IN_PROC_BROWSER_TEST_P(ManifestUpdateManagerBrowserTest_UpdateDialog,
                       ShortcutIconContentChangeWithProductIconChange) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsShortcutIconSrcUpdated) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsShortcutIconSizesUpdated) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckUpdateTimeChange) {}

class ManifestUpdateManagerIconUpdatingBrowserTest
    : public ManifestUpdateManagerBrowserTest {};

IN_PROC_BROWSER_TEST_P(ManifestUpdateManagerBrowserTest_UpdateDialog,
                       CheckFindsIconContentChange) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerIconUpdatingBrowserTest,
                       CheckFindsIconUrlChange) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerIconUpdatingBrowserTest,
                       CheckIgnoresIconDownloadFail) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsAddedProtocolHandler) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckIgnoresUnchangedProtocolHandler) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsChangedProtocolHandler) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsDeletedProtocolHandler) {}

class ManifestUpdateManagerBrowserTest_LockScreen
    : public ManifestUpdateManagerBrowserTest {};

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest_LockScreen,
                       CheckFindsAddedLockScreenStartUrl) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest_LockScreen,
                       CheckIgnoresUnchangedLockScreenStartUrl) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest_LockScreen,
                       CheckFindsChangedLockScreenStartUrl) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest_LockScreen,
                       CheckFindsDeletedLockScreenStartUrl) {}

class ManifestUpdateManagerBrowserTest_NoLockScreen
    : public ManifestUpdateManagerBrowserTest {};

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest_NoLockScreen,
                       WithoutLockScreenFlag_CheckIgnoresLockScreenStartUrl) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsAddedNewNoteUrl) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckIgnoresUnchangedNewNoteUrl) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsChangedNewNoteUrl) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest,
                       CheckFindsDeletedNewNoteUrl) {}

ManifestUpdateManagerBrowserTest_ManifestId;

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest_ManifestId,
                       AllowStartUrlUpdate) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest_ManifestId,
                       CheckIgnoresIdChange) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest_ManifestId,
                       ChecksSettingIdMatchDefault) {}

class ManifestUpdateManagerBrowserTest_ScopeExtensions
    : public ManifestUpdateManagerBrowserTest {};

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest_ScopeExtensions,
                       AddedScopeExtensionsWithAssociation) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest_ScopeExtensions,
                       AddedScopeExtensionsWithoutAssociation) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest_ScopeExtensions,
                       RemovedScopeExtensions) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest_ScopeExtensions,
                       AddedAndRemovedScopeExtensions) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest_ScopeExtensions,
                       AssociationFailsToValidateDuringUpdate) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest_ScopeExtensions,
                       FailedOriginAssociationValidatationPassesDuringUpdate) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest_ScopeExtensions,
                       UnrelatedAssociationDataDoesNotCauseUpdate) {}

class ManifestUpdateManagerAppIdentityBrowserTest
    : public ManifestUpdateManagerBrowserTest {};

// This test verifies that shortcut apps with custom name overrides don't try to
// update the name back to the manifest app name.
IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerAppIdentityBrowserTest,
                       CheckShortcutAppDoesntPromptForUpdates) {}

// Test that showing the AppIdentity update confirmation and allowing the update
// sends the right signal back.
IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerAppIdentityBrowserTest,
                       VerifyCallbackUpgradeAllowed) {}

class ManifestUpdateManagerImmediateUpdateBrowserTest
    : public ManifestUpdateManagerBrowserTest {};

// Test whether web app windows update their UI immediately after a manifest
// update gets applied.
IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerImmediateUpdateBrowserTest,
                       WebAppWindowsUpdatedImmediately) {}

class ManifestUpdateManagerPrerenderingBrowserTest
    : public ManifestUpdateManagerBrowserTest {};

// Tests that prerendering doesn't change the existing App ID. It also doesn't
// call ManifestUpdateManager as a primary page is not changed.
IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerPrerenderingBrowserTest,
                       NotUpdateInPrerendering) {}

class ManifestUpdateManagerBrowserTest_TabStrip
    : public ManifestUpdateManagerBrowserTest {};

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest_TabStrip,
                       CheckFindsAddedTabStripField) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest_TabStrip,
                       CheckIgnoresUnchangedTabStripField) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest_TabStrip,
                       CheckFindsChangedTabStripField) {}

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest_TabStrip,
                       CheckFindsDeletedTabStripField) {}

class ManifestUpdateManagerBrowserTest_NoTabStrip
    : public ManifestUpdateManagerBrowserTest {};

IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTest_NoTabStrip,
                       WithoutTabStripFlag_CheckIgnoresTabStripField) {}

enum AppIdTestParam {};

class ManifestUpdateManagerBrowserTest_AppIdentityParameterized
    : public ManifestUpdateManagerBrowserTest,
      public testing::WithParamInterface<
          std::tuple<AppIdTestParam, AppIdTestParam, AppIdTestParam>> {};

std::string GenerateIconRow(SquareSizePx size, SkColor color) {}

struct SizeColor {};

std::string GenerateColoredIconList(std::vector<SizeColor> size_colors) {}

// Disabled due to test flakiness: https://crbug.com/1341617
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
#define MAYBE_CheckCombinations
#else
#define MAYBE_CheckCombinations
#endif
IN_PROC_BROWSER_TEST_P(
    ManifestUpdateManagerBrowserTest_AppIdentityParameterized,
    MAYBE_CheckCombinations) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace web_app