Commit e3586c34 authored by Eric Willigers's avatar Eric Willigers Committed by Commit Bot

Desktop PWAs: Sync test cleanup

DesktopPWAsWithoutExtensions has shipped.

The test cases no longer need to be parameterized.

Bug: 1065748
Change-Id: Iff9b0c04df28b7fe87fb6a3ba1bc131c73cb018a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2459512
Auto-Submit: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Reviewed-by: default avatarAlexey Baskakov <loyso@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815301}
parent 84724ccd
...@@ -3,12 +3,9 @@ ...@@ -3,12 +3,9 @@
// found in the LICENSE file. // found in the LICENSE file.
#include "base/macros.h" #include "base/macros.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/sync/test/integration/apps_helper.h" #include "chrome/browser/sync/test/integration/apps_helper.h"
#include "chrome/browser/sync/test/integration/sync_test.h" #include "chrome/browser/sync/test/integration/sync_test.h"
#include "chrome/browser/sync/test/integration/updated_progress_marker_checker.h" #include "chrome/browser/sync/test/integration/updated_progress_marker_checker.h"
#include "chrome/browser/web_applications/test/web_app_test.h"
#include "chrome/common/chrome_features.h"
#include "components/sync/driver/profile_sync_service.h" #include "components/sync/driver/profile_sync_service.h"
#include "content/public/test/browser_test.h" #include "content/public/test/browser_test.h"
...@@ -21,37 +18,23 @@ using apps_helper::AllProfilesHaveSameApps; ...@@ -21,37 +18,23 @@ using apps_helper::AllProfilesHaveSameApps;
using apps_helper::InstallHostedApp; using apps_helper::InstallHostedApp;
using apps_helper::InstallPlatformApp; using apps_helper::InstallPlatformApp;
class SingleClientExtensionAppsSyncTest class SingleClientExtensionAppsSyncTest : public SyncTest {
: public SyncTest,
public ::testing::WithParamInterface<web_app::ProviderType> {
public: public:
SingleClientExtensionAppsSyncTest() : SyncTest(SINGLE_CLIENT) { SingleClientExtensionAppsSyncTest() : SyncTest(SINGLE_CLIENT) {
switch (GetParam()) {
case web_app::ProviderType::kWebApps:
scoped_feature_list_.InitAndEnableFeature(
features::kDesktopPWAsWithoutExtensions);
break;
case web_app::ProviderType::kBookmarkApps:
scoped_feature_list_.InitAndDisableFeature(
features::kDesktopPWAsWithoutExtensions);
break;
}
} }
~SingleClientExtensionAppsSyncTest() override = default; ~SingleClientExtensionAppsSyncTest() override = default;
private: private:
base::test::ScopedFeatureList scoped_feature_list_;
DISALLOW_COPY_AND_ASSIGN(SingleClientExtensionAppsSyncTest); DISALLOW_COPY_AND_ASSIGN(SingleClientExtensionAppsSyncTest);
}; };
IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest, StartWithNoApps) { IN_PROC_BROWSER_TEST_F(SingleClientExtensionAppsSyncTest, StartWithNoApps) {
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameApps()); ASSERT_TRUE(AllProfilesHaveSameApps());
} }
IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest, IN_PROC_BROWSER_TEST_F(SingleClientExtensionAppsSyncTest,
StartWithSomeLegacyApps) { StartWithSomeLegacyApps) {
ASSERT_TRUE(SetupClients()); ASSERT_TRUE(SetupClients());
...@@ -65,7 +48,7 @@ IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest, ...@@ -65,7 +48,7 @@ IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest,
ASSERT_TRUE(AllProfilesHaveSameApps()); ASSERT_TRUE(AllProfilesHaveSameApps());
} }
IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest, IN_PROC_BROWSER_TEST_F(SingleClientExtensionAppsSyncTest,
StartWithSomePlatformApps) { StartWithSomePlatformApps) {
ASSERT_TRUE(SetupClients()); ASSERT_TRUE(SetupClients());
...@@ -79,7 +62,7 @@ IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest, ...@@ -79,7 +62,7 @@ IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest,
ASSERT_TRUE(AllProfilesHaveSameApps()); ASSERT_TRUE(AllProfilesHaveSameApps());
} }
IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest, IN_PROC_BROWSER_TEST_F(SingleClientExtensionAppsSyncTest,
InstallSomeLegacyApps) { InstallSomeLegacyApps) {
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
...@@ -93,7 +76,7 @@ IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest, ...@@ -93,7 +76,7 @@ IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest,
ASSERT_TRUE(AllProfilesHaveSameApps()); ASSERT_TRUE(AllProfilesHaveSameApps());
} }
IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest, IN_PROC_BROWSER_TEST_F(SingleClientExtensionAppsSyncTest,
InstallSomePlatformApps) { InstallSomePlatformApps) {
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
...@@ -107,7 +90,7 @@ IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest, ...@@ -107,7 +90,7 @@ IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest,
ASSERT_TRUE(AllProfilesHaveSameApps()); ASSERT_TRUE(AllProfilesHaveSameApps());
} }
IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest, InstallSomeApps) { IN_PROC_BROWSER_TEST_F(SingleClientExtensionAppsSyncTest, InstallSomeApps) {
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
// TODO(crbug.com/1124986): Determine if these values // TODO(crbug.com/1124986): Determine if these values
...@@ -134,31 +117,17 @@ IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest, InstallSomeApps) { ...@@ -134,31 +117,17 @@ IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest, InstallSomeApps) {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
// Tests for SplitSettingsSync. // Tests for SplitSettingsSync.
class SingleClientExtensionAppsOsSyncTest class SingleClientExtensionAppsOsSyncTest : public OsSyncTest {
: public OsSyncTest,
public ::testing::WithParamInterface<web_app::ProviderType> {
public: public:
SingleClientExtensionAppsOsSyncTest() : OsSyncTest(SINGLE_CLIENT) { SingleClientExtensionAppsOsSyncTest() : OsSyncTest(SINGLE_CLIENT) {
switch (GetParam()) {
case web_app::ProviderType::kWebApps:
scoped_feature_list_.InitAndEnableFeature(
features::kDesktopPWAsWithoutExtensions);
break;
case web_app::ProviderType::kBookmarkApps:
scoped_feature_list_.InitAndDisableFeature(
features::kDesktopPWAsWithoutExtensions);
break;
}
} }
~SingleClientExtensionAppsOsSyncTest() override = default; ~SingleClientExtensionAppsOsSyncTest() override = default;
private: private:
base::test::ScopedFeatureList scoped_feature_list_;
DISALLOW_COPY_AND_ASSIGN(SingleClientExtensionAppsOsSyncTest); DISALLOW_COPY_AND_ASSIGN(SingleClientExtensionAppsOsSyncTest);
}; };
IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsOsSyncTest, IN_PROC_BROWSER_TEST_F(SingleClientExtensionAppsOsSyncTest,
DisablingOsSyncFeatureDisablesDataType) { DisablingOsSyncFeatureDisablesDataType) {
ASSERT_TRUE(chromeos::features::IsSplitSettingsSyncEnabled()); ASSERT_TRUE(chromeos::features::IsSplitSettingsSyncEnabled());
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
...@@ -173,16 +142,4 @@ IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsOsSyncTest, ...@@ -173,16 +142,4 @@ IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsOsSyncTest,
EXPECT_FALSE(service->GetActiveDataTypes().Has(syncer::APPS)); EXPECT_FALSE(service->GetActiveDataTypes().Has(syncer::APPS));
} }
INSTANTIATE_TEST_SUITE_P(All,
SingleClientExtensionAppsOsSyncTest,
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
web_app::ProviderTypeParamToString);
#endif // defined(OS_CHROMEOS) #endif // defined(OS_CHROMEOS)
INSTANTIATE_TEST_SUITE_P(All,
SingleClientExtensionAppsSyncTest,
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
web_app::ProviderTypeParamToString);
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
#include "chrome/browser/sync/test/integration/os_sync_test.h" #include "chrome/browser/sync/test/integration/os_sync_test.h"
#include "chrome/common/chrome_features.h"
#include "chromeos/constants/chromeos_features.h" #include "chromeos/constants/chromeos_features.h"
#include "components/browser_sync/browser_sync_switches.h" #include "components/browser_sync/browser_sync_switches.h"
#endif #endif
...@@ -287,9 +286,7 @@ class SingleClientStandaloneTransportOsSyncTest : public OsSyncTest { ...@@ -287,9 +286,7 @@ class SingleClientStandaloneTransportOsSyncTest : public OsSyncTest {
public: public:
SingleClientStandaloneTransportOsSyncTest() : OsSyncTest(SINGLE_CLIENT) { SingleClientStandaloneTransportOsSyncTest() : OsSyncTest(SINGLE_CLIENT) {
// Enable in-development types. // Enable in-development types.
scoped_features_.InitWithFeatures({features::kDesktopPWAsWithoutExtensions, scoped_features_.InitAndEnableFeature(switches::kSyncWifiConfigurations);
switches::kSyncWifiConfigurations},
{});
} }
~SingleClientStandaloneTransportOsSyncTest() override = default; ~SingleClientStandaloneTransportOsSyncTest() override = default;
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/browser/sync/test/integration/sync_test.h" #include "chrome/browser/sync/test/integration/sync_test.h"
#include "chrome/common/chrome_features.h"
#include "components/sync/base/model_type.h" #include "components/sync/base/model_type.h"
#include "components/sync/base/user_selectable_type.h" #include "components/sync/base/user_selectable_type.h"
#include "components/sync/driver/profile_sync_service.h" #include "components/sync/driver/profile_sync_service.h"
...@@ -23,19 +22,14 @@ namespace { ...@@ -23,19 +22,14 @@ namespace {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
// These tests test only the new Web Apps system with next generation sync. // These tests test the new Web Apps system with next generation sync.
// (BMO flag is always enabled). WEB_APPS and WebAppSyncBridge are always on.
// //
// Chrome OS syncs apps as an OS type. // Chrome OS syncs apps as an OS type.
class SingleClientWebAppsBmoOsSyncTest : public OsSyncTest { class SingleClientWebAppsBmoOsSyncTest : public OsSyncTest {
public: public:
SingleClientWebAppsBmoOsSyncTest() : OsSyncTest(SINGLE_CLIENT) { SingleClientWebAppsBmoOsSyncTest() : OsSyncTest(SINGLE_CLIENT) {
features_.InitAndEnableFeature(features::kDesktopPWAsWithoutExtensions);
} }
~SingleClientWebAppsBmoOsSyncTest() override = default; ~SingleClientWebAppsBmoOsSyncTest() override = default;
private:
base::test::ScopedFeatureList features_;
}; };
IN_PROC_BROWSER_TEST_F(SingleClientWebAppsBmoOsSyncTest, IN_PROC_BROWSER_TEST_F(SingleClientWebAppsBmoOsSyncTest,
...@@ -55,19 +49,12 @@ IN_PROC_BROWSER_TEST_F(SingleClientWebAppsBmoOsSyncTest, ...@@ -55,19 +49,12 @@ IN_PROC_BROWSER_TEST_F(SingleClientWebAppsBmoOsSyncTest,
#else // !defined(OS_CHROMEOS) #else // !defined(OS_CHROMEOS)
// These tests test only the new Web Apps system with next generation sync. // These tests test the new Web Apps system with next generation sync.
// (BMO flag is always enabled). WEB_APPS and WebAppSyncBridge are always on.
//
// See also TwoClientWebAppsBmoSyncTest.
class SingleClientWebAppsBmoSyncTest : public SyncTest { class SingleClientWebAppsBmoSyncTest : public SyncTest {
public: public:
SingleClientWebAppsBmoSyncTest() : SyncTest(SINGLE_CLIENT) { SingleClientWebAppsBmoSyncTest() : SyncTest(SINGLE_CLIENT) {
features_.InitAndEnableFeature(features::kDesktopPWAsWithoutExtensions);
} }
~SingleClientWebAppsBmoSyncTest() override = default; ~SingleClientWebAppsBmoSyncTest() override = default;
private:
base::test::ScopedFeatureList features_;
}; };
IN_PROC_BROWSER_TEST_F(SingleClientWebAppsBmoSyncTest, IN_PROC_BROWSER_TEST_F(SingleClientWebAppsBmoSyncTest,
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/extension_sync_data.h" #include "chrome/browser/extensions/extension_sync_data.h"
#include "chrome/browser/extensions/extension_sync_service.h" #include "chrome/browser/extensions/extension_sync_service.h"
...@@ -20,8 +19,6 @@ ...@@ -20,8 +19,6 @@
#include "chrome/browser/sync/test/integration/sync_app_helper.h" #include "chrome/browser/sync/test/integration/sync_app_helper.h"
#include "chrome/browser/sync/test/integration/sync_integration_test_util.h" #include "chrome/browser/sync/test/integration/sync_integration_test_util.h"
#include "chrome/browser/sync/test/integration/sync_test.h" #include "chrome/browser/sync/test/integration/sync_test.h"
#include "chrome/browser/web_applications/test/web_app_test.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/extensions/manifest_handlers/app_launch_info.h" #include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
#include "chrome/common/extensions/manifest_handlers/app_theme_color_info.h" #include "chrome/common/extensions/manifest_handlers/app_theme_color_info.h"
#include "chrome/common/web_application_info.h" #include "chrome/common/web_application_info.h"
...@@ -57,41 +54,26 @@ extensions::ExtensionRegistry* GetExtensionRegistry(Profile* profile) { ...@@ -57,41 +54,26 @@ extensions::ExtensionRegistry* GetExtensionRegistry(Profile* profile) {
} // namespace } // namespace
class TwoClientExtensionAppsSyncTest class TwoClientExtensionAppsSyncTest : public SyncTest {
: public SyncTest,
public ::testing::WithParamInterface<web_app::ProviderType> {
public: public:
TwoClientExtensionAppsSyncTest() : SyncTest(TWO_CLIENT) { TwoClientExtensionAppsSyncTest() : SyncTest(TWO_CLIENT) {
switch (GetParam()) {
case web_app::ProviderType::kWebApps:
scoped_feature_list_.InitAndEnableFeature(
features::kDesktopPWAsWithoutExtensions);
break;
case web_app::ProviderType::kBookmarkApps:
scoped_feature_list_.InitAndDisableFeature(
features::kDesktopPWAsWithoutExtensions);
break;
}
DisableVerifier(); DisableVerifier();
} }
~TwoClientExtensionAppsSyncTest() override = default; ~TwoClientExtensionAppsSyncTest() override = default;
private: private:
base::test::ScopedFeatureList scoped_feature_list_;
DISALLOW_COPY_AND_ASSIGN(TwoClientExtensionAppsSyncTest); DISALLOW_COPY_AND_ASSIGN(TwoClientExtensionAppsSyncTest);
}; };
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
E2E_ENABLED(StartWithNoApps)) { E2E_ENABLED(StartWithNoApps)) {
ResetSyncForPrimaryAccount(); ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AppsMatchChecker().Wait()); ASSERT_TRUE(AppsMatchChecker().Wait());
} }
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
E2E_ENABLED(StartWithSameApps)) { E2E_ENABLED(StartWithSameApps)) {
ResetSyncForPrimaryAccount(); ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupClients()); ASSERT_TRUE(SetupClients());
...@@ -110,7 +92,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, ...@@ -110,7 +92,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
// other, and sync. Both clients should end up with all apps, and the app and // other, and sync. Both clients should end up with all apps, and the app and
// page ordinals should be identical. // page ordinals should be identical.
// Disabled due to flake: https://crbug.com/1069843 // Disabled due to flake: https://crbug.com/1069843
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
DISABLED_StartWithDifferentApps) { DISABLED_StartWithDifferentApps) {
ASSERT_TRUE(SetupClients()); ASSERT_TRUE(SetupClients());
...@@ -144,7 +126,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, ...@@ -144,7 +126,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
// Install some apps on both clients, then sync. Then install some apps on only // Install some apps on both clients, then sync. Then install some apps on only
// one client, some on only the other, and then sync again. Both clients should // one client, some on only the other, and then sync again. Both clients should
// end up with all apps, and the app and page ordinals should be identical. // end up with all apps, and the app and page ordinals should be identical.
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
E2E_ENABLED(InstallDifferentApps)) { E2E_ENABLED(InstallDifferentApps)) {
ResetSyncForPrimaryAccount(); ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupClients()); ASSERT_TRUE(SetupClients());
...@@ -172,7 +154,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, ...@@ -172,7 +154,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
ASSERT_TRUE(AppsMatchChecker().Wait()); ASSERT_TRUE(AppsMatchChecker().Wait());
} }
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, E2E_ENABLED(Add)) { IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest, E2E_ENABLED(Add)) {
ResetSyncForPrimaryAccount(); ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AppsMatchChecker().Wait()); ASSERT_TRUE(AppsMatchChecker().Wait());
...@@ -182,7 +164,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, E2E_ENABLED(Add)) { ...@@ -182,7 +164,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, E2E_ENABLED(Add)) {
ASSERT_TRUE(AppsMatchChecker().Wait()); ASSERT_TRUE(AppsMatchChecker().Wait());
} }
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, E2E_ENABLED(Uninstall)) { IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest, E2E_ENABLED(Uninstall)) {
ResetSyncForPrimaryAccount(); ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AppsMatchChecker().Wait()); ASSERT_TRUE(AppsMatchChecker().Wait());
...@@ -198,7 +180,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, E2E_ENABLED(Uninstall)) { ...@@ -198,7 +180,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, E2E_ENABLED(Uninstall)) {
// client and sync again. Now install a new app on the first client and sync. // client and sync again. Now install a new app on the first client and sync.
// Both client should only have the second app, with identical app and page // Both client should only have the second app, with identical app and page
// ordinals. // ordinals.
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
E2E_ENABLED(UninstallThenInstall)) { E2E_ENABLED(UninstallThenInstall)) {
ResetSyncForPrimaryAccount(); ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
...@@ -214,7 +196,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, ...@@ -214,7 +196,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
ASSERT_TRUE(AppsMatchChecker().Wait()); ASSERT_TRUE(AppsMatchChecker().Wait());
} }
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, E2E_ENABLED(Merge)) { IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest, E2E_ENABLED(Merge)) {
ResetSyncForPrimaryAccount(); ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AppsMatchChecker().Wait()); ASSERT_TRUE(AppsMatchChecker().Wait());
...@@ -233,7 +215,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, E2E_ENABLED(Merge)) { ...@@ -233,7 +215,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, E2E_ENABLED(Merge)) {
ASSERT_TRUE(AppsMatchChecker().Wait()); ASSERT_TRUE(AppsMatchChecker().Wait());
} }
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
E2E_ENABLED(UpdateEnableDisableApp)) { E2E_ENABLED(UpdateEnableDisableApp)) {
ResetSyncForPrimaryAccount(); ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
...@@ -249,7 +231,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, ...@@ -249,7 +231,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
ASSERT_TRUE(AppsMatchChecker().Wait()); ASSERT_TRUE(AppsMatchChecker().Wait());
} }
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
E2E_ENABLED(UpdateIncognitoEnableDisable)) { E2E_ENABLED(UpdateIncognitoEnableDisable)) {
ResetSyncForPrimaryAccount(); ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
...@@ -268,7 +250,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, ...@@ -268,7 +250,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
// Install the same app on both clients, then sync. Change the page ordinal on // Install the same app on both clients, then sync. Change the page ordinal on
// one client and sync. Both clients should have the updated page ordinal for // one client and sync. Both clients should have the updated page ordinal for
// the app. // the app.
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
E2E_ENABLED(UpdatePageOrdinal)) { E2E_ENABLED(UpdatePageOrdinal)) {
ResetSyncForPrimaryAccount(); ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
...@@ -287,7 +269,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, ...@@ -287,7 +269,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
// Install the same app on both clients, then sync. Change the app launch // Install the same app on both clients, then sync. Change the app launch
// ordinal on one client and sync. Both clients should have the updated app // ordinal on one client and sync. Both clients should have the updated app
// launch ordinal for the app. // launch ordinal for the app.
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
E2E_ENABLED(UpdateAppLaunchOrdinal)) { E2E_ENABLED(UpdateAppLaunchOrdinal)) {
ResetSyncForPrimaryAccount(); ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
...@@ -307,7 +289,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, ...@@ -307,7 +289,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
// Adjust the CWS location within a page on the first client and sync. Adjust // Adjust the CWS location within a page on the first client and sync. Adjust
// which page the CWS appears on and sync. Both clients should have the same // which page the CWS appears on and sync. Both clients should have the same
// page and app launch ordinal values for the CWS. // page and app launch ordinal values for the CWS.
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
E2E_ENABLED(UpdateCWSOrdinals)) { E2E_ENABLED(UpdateCWSOrdinals)) {
ResetSyncForPrimaryAccount(); ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
...@@ -338,7 +320,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, ...@@ -338,7 +320,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
// Adjust the launch type on the first client and sync. Both clients should // Adjust the launch type on the first client and sync. Both clients should
// have the same launch type values for the CWS. // have the same launch type values for the CWS.
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
E2E_ENABLED(UpdateLaunchType)) { E2E_ENABLED(UpdateLaunchType)) {
ResetSyncForPrimaryAccount(); ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
...@@ -364,7 +346,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, ...@@ -364,7 +346,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
extensions::LAUNCH_TYPE_REGULAR); extensions::LAUNCH_TYPE_REGULAR);
} }
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, UnexpectedLaunchType) { IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest, UnexpectedLaunchType) {
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
// Wait until sync settles before we override the apps below. // Wait until sync settles before we override the apps below.
ASSERT_TRUE(AwaitQuiescence()); ASSERT_TRUE(AwaitQuiescence());
...@@ -400,12 +382,6 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, UnexpectedLaunchType) { ...@@ -400,12 +382,6 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, UnexpectedLaunchType) {
ASSERT_TRUE(AppsMatchChecker().Wait()); ASSERT_TRUE(AppsMatchChecker().Wait());
} }
INSTANTIATE_TEST_SUITE_P(All,
TwoClientExtensionAppsSyncTest,
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
web_app::ProviderTypeParamToString);
// TODO(akalin): Add tests exercising: // TODO(akalin): Add tests exercising:
// - Offline installation/uninstallation behavior // - Offline installation/uninstallation behavior
// - App-specific properties // - App-specific properties
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/test/bind_test_util.h" #include "base/test/bind_test_util.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/app/chrome_command_ids.h" #include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/installable/installable_metrics.h" #include "chrome/browser/installable/installable_metrics.h"
...@@ -25,7 +24,6 @@ ...@@ -25,7 +24,6 @@
#include "chrome/browser/web_applications/web_app.h" #include "chrome/browser/web_applications/web_app.h"
#include "chrome/browser/web_applications/web_app_provider.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_registrar.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/web_application_info.h" #include "chrome/common/web_application_info.h"
#include "chrome/test/base/ui_test_utils.h" #include "chrome/test/base/ui_test_utils.h"
#include "content/public/test/browser_test.h" #include "content/public/test/browser_test.h"
...@@ -39,9 +37,6 @@ namespace { ...@@ -39,9 +37,6 @@ namespace {
class TwoClientWebAppsBMOSyncTest : public SyncTest { class TwoClientWebAppsBMOSyncTest : public SyncTest {
public: public:
TwoClientWebAppsBMOSyncTest() : SyncTest(TWO_CLIENT) { TwoClientWebAppsBMOSyncTest() : SyncTest(TWO_CLIENT) {
scoped_feature_list_.InitAndEnableFeature(
features::kDesktopPWAsWithoutExtensions);
DisableVerifier(); DisableVerifier();
} }
...@@ -174,8 +169,6 @@ class TwoClientWebAppsBMOSyncTest : public SyncTest { ...@@ -174,8 +169,6 @@ class TwoClientWebAppsBMOSyncTest : public SyncTest {
} }
private: private:
base::test::ScopedFeatureList scoped_feature_list_;
DISALLOW_COPY_AND_ASSIGN(TwoClientWebAppsBMOSyncTest); DISALLOW_COPY_AND_ASSIGN(TwoClientWebAppsBMOSyncTest);
}; };
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/test/bind_test_util.h" #include "base/test/bind_test_util.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/app/chrome_command_ids.h" #include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/installable/installable_metrics.h" #include "chrome/browser/installable/installable_metrics.h"
#include "chrome/browser/sync/test/integration/sync_test.h" #include "chrome/browser/sync/test/integration/sync_test.h"
...@@ -17,9 +16,7 @@ ...@@ -17,9 +16,7 @@
#include "chrome/browser/web_applications/components/app_icon_manager.h" #include "chrome/browser/web_applications/components/app_icon_manager.h"
#include "chrome/browser/web_applications/components/install_manager.h" #include "chrome/browser/web_applications/components/install_manager.h"
#include "chrome/browser/web_applications/test/web_app_install_observer.h" #include "chrome/browser/web_applications/test/web_app_install_observer.h"
#include "chrome/browser/web_applications/test/web_app_test.h"
#include "chrome/browser/web_applications/web_app_provider.h" #include "chrome/browser/web_applications/web_app_provider.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/web_application_info.h" #include "chrome/common/web_application_info.h"
#include "chrome/test/base/ui_test_utils.h" #include "chrome/test/base/ui_test_utils.h"
#include "content/public/test/browser_test.h" #include "content/public/test/browser_test.h"
...@@ -28,34 +25,12 @@ ...@@ -28,34 +25,12 @@
namespace web_app { namespace web_app {
// These tests are unified. They test a common subset for Bookmark Apps and class TwoClientWebAppsSyncTest : public SyncTest {
// Web Apps: they are parametrized (TEST_P) to run twice with BMO flag off and
// on.
class TwoClientWebAppsSyncTest
: public SyncTest,
public ::testing::WithParamInterface<ProviderType> {
public: public:
TwoClientWebAppsSyncTest() : SyncTest(TWO_CLIENT) { TwoClientWebAppsSyncTest() : SyncTest(TWO_CLIENT) { DisableVerifier(); }
switch (GetParam()) {
case web_app::ProviderType::kWebApps:
scoped_feature_list_.InitAndEnableFeature(
features::kDesktopPWAsWithoutExtensions);
break;
case web_app::ProviderType::kBookmarkApps:
scoped_feature_list_.InitAndDisableFeature(
features::kDesktopPWAsWithoutExtensions);
break;
}
DisableVerifier();
}
~TwoClientWebAppsSyncTest() override = default; ~TwoClientWebAppsSyncTest() override = default;
bool IsBookmarkAppsSync() const {
return GetParam() == ProviderType::kBookmarkApps;
}
AppId InstallApp(const WebApplicationInfo& info, Profile* profile) { AppId InstallApp(const WebApplicationInfo& info, Profile* profile) {
DCHECK(info.start_url.is_valid()); DCHECK(info.start_url.is_valid());
base::RunLoop run_loop; base::RunLoop run_loop;
...@@ -99,12 +74,10 @@ class TwoClientWebAppsSyncTest ...@@ -99,12 +74,10 @@ class TwoClientWebAppsSyncTest
} }
private: private:
base::test::ScopedFeatureList scoped_feature_list_;
DISALLOW_COPY_AND_ASSIGN(TwoClientWebAppsSyncTest); DISALLOW_COPY_AND_ASSIGN(TwoClientWebAppsSyncTest);
}; };
IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, Basic) { IN_PROC_BROWSER_TEST_F(TwoClientWebAppsSyncTest, Basic) {
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameWebAppIds()); ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
...@@ -119,16 +92,11 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, Basic) { ...@@ -119,16 +92,11 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, Basic) {
const AppRegistrar& registrar = GetRegistrar(GetProfile(1)); const AppRegistrar& registrar = GetRegistrar(GetProfile(1));
EXPECT_EQ(base::UTF8ToUTF16(registrar.GetAppShortName(app_id)), info.title); EXPECT_EQ(base::UTF8ToUTF16(registrar.GetAppShortName(app_id)), info.title);
EXPECT_EQ(registrar.GetAppStartUrl(app_id), info.start_url); EXPECT_EQ(registrar.GetAppStartUrl(app_id), info.start_url);
if (IsBookmarkAppsSync()) {
EXPECT_EQ(base::UTF8ToUTF16(registrar.GetAppDescription(app_id)),
info.description);
EXPECT_EQ(registrar.GetAppScope(app_id), info.scope);
}
EXPECT_TRUE(AllProfilesHaveSameWebAppIds()); EXPECT_TRUE(AllProfilesHaveSameWebAppIds());
} }
IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, Minimal) { IN_PROC_BROWSER_TEST_F(TwoClientWebAppsSyncTest, Minimal) {
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameWebAppIds()); ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
...@@ -145,7 +113,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, Minimal) { ...@@ -145,7 +113,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, Minimal) {
EXPECT_TRUE(AllProfilesHaveSameWebAppIds()); EXPECT_TRUE(AllProfilesHaveSameWebAppIds());
} }
IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, ThemeColor) { IN_PROC_BROWSER_TEST_F(TwoClientWebAppsSyncTest, ThemeColor) {
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameWebAppIds()); ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
...@@ -166,7 +134,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, ThemeColor) { ...@@ -166,7 +134,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, ThemeColor) {
EXPECT_TRUE(AllProfilesHaveSameWebAppIds()); EXPECT_TRUE(AllProfilesHaveSameWebAppIds());
} }
IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, IsLocallyInstalled) { IN_PROC_BROWSER_TEST_F(TwoClientWebAppsSyncTest, IsLocallyInstalled) {
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameWebAppIds()); ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
...@@ -188,7 +156,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, IsLocallyInstalled) { ...@@ -188,7 +156,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, IsLocallyInstalled) {
EXPECT_TRUE(AllProfilesHaveSameWebAppIds()); EXPECT_TRUE(AllProfilesHaveSameWebAppIds());
} }
IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, AppFieldsChangeDoesNotSync) { IN_PROC_BROWSER_TEST_F(TwoClientWebAppsSyncTest, AppFieldsChangeDoesNotSync) {
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameWebAppIds()); ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
...@@ -207,11 +175,6 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, AppFieldsChangeDoesNotSync) { ...@@ -207,11 +175,6 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, AppFieldsChangeDoesNotSync) {
EXPECT_EQ(base::UTF8ToUTF16(registrar1.GetAppShortName(app_id_a)), EXPECT_EQ(base::UTF8ToUTF16(registrar1.GetAppShortName(app_id_a)),
info_a.title); info_a.title);
if (IsBookmarkAppsSync()) {
EXPECT_EQ(base::UTF8ToUTF16(registrar1.GetAppDescription(app_id_a)),
info_a.description);
EXPECT_EQ(registrar1.GetAppScope(app_id_a), info_a.scope);
}
EXPECT_EQ(registrar1.GetAppThemeColor(app_id_a), info_a.theme_color); EXPECT_EQ(registrar1.GetAppThemeColor(app_id_a), info_a.theme_color);
ASSERT_TRUE(AllProfilesHaveSameWebAppIds()); ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
...@@ -245,11 +208,6 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, AppFieldsChangeDoesNotSync) { ...@@ -245,11 +208,6 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, AppFieldsChangeDoesNotSync) {
// After sync we should not see the metadata update in Profile 1. // After sync we should not see the metadata update in Profile 1.
EXPECT_EQ(base::UTF8ToUTF16(registrar1.GetAppShortName(app_id_a)), EXPECT_EQ(base::UTF8ToUTF16(registrar1.GetAppShortName(app_id_a)),
info_a.title); info_a.title);
if (IsBookmarkAppsSync()) {
EXPECT_EQ(base::UTF8ToUTF16(registrar1.GetAppDescription(app_id_a)),
info_a.description);
EXPECT_EQ(registrar1.GetAppScope(app_id_a), info_a.scope);
}
EXPECT_EQ(registrar1.GetAppThemeColor(app_id_a), info_a.theme_color); EXPECT_EQ(registrar1.GetAppThemeColor(app_id_a), info_a.theme_color);
...@@ -258,7 +216,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, AppFieldsChangeDoesNotSync) { ...@@ -258,7 +216,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, AppFieldsChangeDoesNotSync) {
// Tests that we don't crash when syncing an icon info with no size. // Tests that we don't crash when syncing an icon info with no size.
// Context: https://crbug.com/1058283 // Context: https://crbug.com/1058283
IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncFaviconOnly) { IN_PROC_BROWSER_TEST_F(TwoClientWebAppsSyncTest, SyncFaviconOnly) {
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameWebAppIds()); ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
ASSERT_TRUE(embedded_test_server()->Start()); ASSERT_TRUE(embedded_test_server()->Start());
...@@ -299,7 +257,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncFaviconOnly) { ...@@ -299,7 +257,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncFaviconOnly) {
// Tests that we don't use the manifest start_url if it differs from what came // Tests that we don't use the manifest start_url if it differs from what came
// through sync. // through sync.
IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncUsingStartUrlFallback) { IN_PROC_BROWSER_TEST_F(TwoClientWebAppsSyncTest, SyncUsingStartUrlFallback) {
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameWebAppIds()); ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
ASSERT_TRUE(embedded_test_server()->Start()); ASSERT_TRUE(embedded_test_server()->Start());
...@@ -330,7 +288,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncUsingStartUrlFallback) { ...@@ -330,7 +288,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncUsingStartUrlFallback) {
// Pages without a manifest are usually not the correct page to draw information // Pages without a manifest are usually not the correct page to draw information
// from e.g. login redirects or loading pages. // from e.g. login redirects or loading pages.
// Context: https://crbug.com/1078286 // Context: https://crbug.com/1078286
IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncUsingNameFallback) { IN_PROC_BROWSER_TEST_F(TwoClientWebAppsSyncTest, SyncUsingNameFallback) {
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameWebAppIds()); ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
ASSERT_TRUE(embedded_test_server()->Start()); ASSERT_TRUE(embedded_test_server()->Start());
...@@ -358,7 +316,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncUsingNameFallback) { ...@@ -358,7 +316,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncUsingNameFallback) {
// Negative test of SyncUsingNameFallback above. Don't use the app name fallback // Negative test of SyncUsingNameFallback above. Don't use the app name fallback
// if there's a name provided by the manifest during sync. // if there's a name provided by the manifest during sync.
IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncWithoutUsingNameFallback) { IN_PROC_BROWSER_TEST_F(TwoClientWebAppsSyncTest, SyncWithoutUsingNameFallback) {
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameWebAppIds()); ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
ASSERT_TRUE(embedded_test_server()->Start()); ASSERT_TRUE(embedded_test_server()->Start());
...@@ -383,7 +341,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncWithoutUsingNameFallback) { ...@@ -383,7 +341,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncWithoutUsingNameFallback) {
"Basic web app"); "Basic web app");
} }
IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncUsingIconUrlFallback) { IN_PROC_BROWSER_TEST_F(TwoClientWebAppsSyncTest, SyncUsingIconUrlFallback) {
ASSERT_TRUE(SetupSync()); ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameWebAppIds()); ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
ASSERT_TRUE(embedded_test_server()->Start()); ASSERT_TRUE(embedded_test_server()->Start());
...@@ -395,14 +353,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncUsingIconUrlFallback) { ...@@ -395,14 +353,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncUsingIconUrlFallback) {
// one of them to simulate the other winning the "race". // one of them to simulate the other winning the "race".
InstallManager& install_manager = InstallManager& install_manager =
WebAppProvider::Get(dest_profile)->install_manager(); WebAppProvider::Get(dest_profile)->install_manager();
switch (GetParam()) { install_manager.DisableBookmarkAppSyncInstallForTesting();
case ProviderType::kBookmarkApps:
install_manager.DisableWebAppSyncInstallForTesting();
break;
case ProviderType::kWebApps:
install_manager.DisableBookmarkAppSyncInstallForTesting();
break;
}
WebAppInstallObserver dest_install_observer(dest_profile); WebAppInstallObserver dest_install_observer(dest_profile);
...@@ -445,10 +396,4 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncUsingIconUrlFallback) { ...@@ -445,10 +396,4 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncUsingIconUrlFallback) {
SK_ColorBLUE); SK_ColorBLUE);
} }
INSTANTIATE_TEST_SUITE_P(All,
TwoClientWebAppsSyncTest,
::testing::Values(ProviderType::kBookmarkApps,
ProviderType::kWebApps),
ProviderTypeParamToString);
} // namespace web_app } // namespace web_app
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment