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 @@
// found in the LICENSE file.
#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/sync_test.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 "content/public/test/browser_test.h"
......@@ -21,37 +18,23 @@ using apps_helper::AllProfilesHaveSameApps;
using apps_helper::InstallHostedApp;
using apps_helper::InstallPlatformApp;
class SingleClientExtensionAppsSyncTest
: public SyncTest,
public ::testing::WithParamInterface<web_app::ProviderType> {
class SingleClientExtensionAppsSyncTest : public SyncTest {
public:
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;
private:
base::test::ScopedFeatureList scoped_feature_list_;
DISALLOW_COPY_AND_ASSIGN(SingleClientExtensionAppsSyncTest);
};
IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest, StartWithNoApps) {
IN_PROC_BROWSER_TEST_F(SingleClientExtensionAppsSyncTest, StartWithNoApps) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameApps());
}
IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest,
IN_PROC_BROWSER_TEST_F(SingleClientExtensionAppsSyncTest,
StartWithSomeLegacyApps) {
ASSERT_TRUE(SetupClients());
......@@ -65,7 +48,7 @@ IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest,
ASSERT_TRUE(AllProfilesHaveSameApps());
}
IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest,
IN_PROC_BROWSER_TEST_F(SingleClientExtensionAppsSyncTest,
StartWithSomePlatformApps) {
ASSERT_TRUE(SetupClients());
......@@ -79,7 +62,7 @@ IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest,
ASSERT_TRUE(AllProfilesHaveSameApps());
}
IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest,
IN_PROC_BROWSER_TEST_F(SingleClientExtensionAppsSyncTest,
InstallSomeLegacyApps) {
ASSERT_TRUE(SetupSync());
......@@ -93,7 +76,7 @@ IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest,
ASSERT_TRUE(AllProfilesHaveSameApps());
}
IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest,
IN_PROC_BROWSER_TEST_F(SingleClientExtensionAppsSyncTest,
InstallSomePlatformApps) {
ASSERT_TRUE(SetupSync());
......@@ -107,7 +90,7 @@ IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest,
ASSERT_TRUE(AllProfilesHaveSameApps());
}
IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest, InstallSomeApps) {
IN_PROC_BROWSER_TEST_F(SingleClientExtensionAppsSyncTest, InstallSomeApps) {
ASSERT_TRUE(SetupSync());
// TODO(crbug.com/1124986): Determine if these values
......@@ -134,31 +117,17 @@ IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsSyncTest, InstallSomeApps) {
#if defined(OS_CHROMEOS)
// Tests for SplitSettingsSync.
class SingleClientExtensionAppsOsSyncTest
: public OsSyncTest,
public ::testing::WithParamInterface<web_app::ProviderType> {
class SingleClientExtensionAppsOsSyncTest : public OsSyncTest {
public:
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;
private:
base::test::ScopedFeatureList scoped_feature_list_;
DISALLOW_COPY_AND_ASSIGN(SingleClientExtensionAppsOsSyncTest);
};
IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsOsSyncTest,
IN_PROC_BROWSER_TEST_F(SingleClientExtensionAppsOsSyncTest,
DisablingOsSyncFeatureDisablesDataType) {
ASSERT_TRUE(chromeos::features::IsSplitSettingsSyncEnabled());
ASSERT_TRUE(SetupSync());
......@@ -173,16 +142,4 @@ IN_PROC_BROWSER_TEST_P(SingleClientExtensionAppsOsSyncTest,
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)
INSTANTIATE_TEST_SUITE_P(All,
SingleClientExtensionAppsSyncTest,
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
web_app::ProviderTypeParamToString);
......@@ -22,7 +22,6 @@
#if defined(OS_CHROMEOS)
#include "chrome/browser/sync/test/integration/os_sync_test.h"
#include "chrome/common/chrome_features.h"
#include "chromeos/constants/chromeos_features.h"
#include "components/browser_sync/browser_sync_switches.h"
#endif
......@@ -287,9 +286,7 @@ class SingleClientStandaloneTransportOsSyncTest : public OsSyncTest {
public:
SingleClientStandaloneTransportOsSyncTest() : OsSyncTest(SINGLE_CLIENT) {
// Enable in-development types.
scoped_features_.InitWithFeatures({features::kDesktopPWAsWithoutExtensions,
switches::kSyncWifiConfigurations},
{});
scoped_features_.InitAndEnableFeature(switches::kSyncWifiConfigurations);
}
~SingleClientStandaloneTransportOsSyncTest() override = default;
......
......@@ -3,7 +3,6 @@
// found in the LICENSE file.
#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/user_selectable_type.h"
#include "components/sync/driver/profile_sync_service.h"
......@@ -23,19 +22,14 @@ namespace {
#if defined(OS_CHROMEOS)
// These tests test only the new Web Apps system with next generation sync.
// (BMO flag is always enabled). WEB_APPS and WebAppSyncBridge are always on.
// These tests test the new Web Apps system with next generation sync.
//
// Chrome OS syncs apps as an OS type.
class SingleClientWebAppsBmoOsSyncTest : public OsSyncTest {
public:
SingleClientWebAppsBmoOsSyncTest() : OsSyncTest(SINGLE_CLIENT) {
features_.InitAndEnableFeature(features::kDesktopPWAsWithoutExtensions);
}
~SingleClientWebAppsBmoOsSyncTest() override = default;
private:
base::test::ScopedFeatureList features_;
};
IN_PROC_BROWSER_TEST_F(SingleClientWebAppsBmoOsSyncTest,
......@@ -55,19 +49,12 @@ IN_PROC_BROWSER_TEST_F(SingleClientWebAppsBmoOsSyncTest,
#else // !defined(OS_CHROMEOS)
// These tests test only the new Web Apps system with next generation sync.
// (BMO flag is always enabled). WEB_APPS and WebAppSyncBridge are always on.
//
// See also TwoClientWebAppsBmoSyncTest.
// These tests test the new Web Apps system with next generation sync.
class SingleClientWebAppsBmoSyncTest : public SyncTest {
public:
SingleClientWebAppsBmoSyncTest() : SyncTest(SINGLE_CLIENT) {
features_.InitAndEnableFeature(features::kDesktopPWAsWithoutExtensions);
}
~SingleClientWebAppsBmoSyncTest() override = default;
private:
base::test::ScopedFeatureList features_;
};
IN_PROC_BROWSER_TEST_F(SingleClientWebAppsBmoSyncTest,
......
......@@ -9,7 +9,6 @@
#include "base/bind.h"
#include "base/macros.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/extensions/extension_sync_data.h"
#include "chrome/browser/extensions/extension_sync_service.h"
......@@ -20,8 +19,6 @@
#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_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_theme_color_info.h"
#include "chrome/common/web_application_info.h"
......@@ -57,41 +54,26 @@ extensions::ExtensionRegistry* GetExtensionRegistry(Profile* profile) {
} // namespace
class TwoClientExtensionAppsSyncTest
: public SyncTest,
public ::testing::WithParamInterface<web_app::ProviderType> {
class TwoClientExtensionAppsSyncTest : public SyncTest {
public:
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();
}
~TwoClientExtensionAppsSyncTest() override = default;
private:
base::test::ScopedFeatureList scoped_feature_list_;
DISALLOW_COPY_AND_ASSIGN(TwoClientExtensionAppsSyncTest);
};
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
E2E_ENABLED(StartWithNoApps)) {
ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AppsMatchChecker().Wait());
}
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
E2E_ENABLED(StartWithSameApps)) {
ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupClients());
......@@ -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
// page ordinals should be identical.
// Disabled due to flake: https://crbug.com/1069843
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
DISABLED_StartWithDifferentApps) {
ASSERT_TRUE(SetupClients());
......@@ -144,7 +126,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
// 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
// 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)) {
ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupClients());
......@@ -172,7 +154,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
ASSERT_TRUE(AppsMatchChecker().Wait());
}
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, E2E_ENABLED(Add)) {
IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest, E2E_ENABLED(Add)) {
ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AppsMatchChecker().Wait());
......@@ -182,7 +164,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, E2E_ENABLED(Add)) {
ASSERT_TRUE(AppsMatchChecker().Wait());
}
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, E2E_ENABLED(Uninstall)) {
IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest, E2E_ENABLED(Uninstall)) {
ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AppsMatchChecker().Wait());
......@@ -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.
// Both client should only have the second app, with identical app and page
// ordinals.
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
E2E_ENABLED(UninstallThenInstall)) {
ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync());
......@@ -214,7 +196,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
ASSERT_TRUE(AppsMatchChecker().Wait());
}
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, E2E_ENABLED(Merge)) {
IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest, E2E_ENABLED(Merge)) {
ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AppsMatchChecker().Wait());
......@@ -233,7 +215,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, E2E_ENABLED(Merge)) {
ASSERT_TRUE(AppsMatchChecker().Wait());
}
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
E2E_ENABLED(UpdateEnableDisableApp)) {
ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync());
......@@ -249,7 +231,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
ASSERT_TRUE(AppsMatchChecker().Wait());
}
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
E2E_ENABLED(UpdateIncognitoEnableDisable)) {
ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync());
......@@ -268,7 +250,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
// 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
// the app.
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
E2E_ENABLED(UpdatePageOrdinal)) {
ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync());
......@@ -287,7 +269,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
// 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
// launch ordinal for the app.
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
E2E_ENABLED(UpdateAppLaunchOrdinal)) {
ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync());
......@@ -307,7 +289,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
// 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
// page and app launch ordinal values for the CWS.
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
E2E_ENABLED(UpdateCWSOrdinals)) {
ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync());
......@@ -338,7 +320,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
// Adjust the launch type on the first client and sync. Both clients should
// have the same launch type values for the CWS.
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest,
E2E_ENABLED(UpdateLaunchType)) {
ResetSyncForPrimaryAccount();
ASSERT_TRUE(SetupSync());
......@@ -364,7 +346,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest,
extensions::LAUNCH_TYPE_REGULAR);
}
IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, UnexpectedLaunchType) {
IN_PROC_BROWSER_TEST_F(TwoClientExtensionAppsSyncTest, UnexpectedLaunchType) {
ASSERT_TRUE(SetupSync());
// Wait until sync settles before we override the apps below.
ASSERT_TRUE(AwaitQuiescence());
......@@ -400,12 +382,6 @@ IN_PROC_BROWSER_TEST_P(TwoClientExtensionAppsSyncTest, UnexpectedLaunchType) {
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:
// - Offline installation/uninstallation behavior
// - App-specific properties
......@@ -6,7 +6,6 @@
#include "base/macros.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind_test_util.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/installable/installable_metrics.h"
......@@ -25,7 +24,6 @@
#include "chrome/browser/web_applications/web_app.h"
#include "chrome/browser/web_applications/web_app_provider.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/test/base/ui_test_utils.h"
#include "content/public/test/browser_test.h"
......@@ -39,9 +37,6 @@ namespace {
class TwoClientWebAppsBMOSyncTest : public SyncTest {
public:
TwoClientWebAppsBMOSyncTest() : SyncTest(TWO_CLIENT) {
scoped_feature_list_.InitAndEnableFeature(
features::kDesktopPWAsWithoutExtensions);
DisableVerifier();
}
......@@ -174,8 +169,6 @@ class TwoClientWebAppsBMOSyncTest : public SyncTest {
}
private:
base::test::ScopedFeatureList scoped_feature_list_;
DISALLOW_COPY_AND_ASSIGN(TwoClientWebAppsBMOSyncTest);
};
......
......@@ -6,7 +6,6 @@
#include "base/macros.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind_test_util.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/installable/installable_metrics.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
......@@ -17,9 +16,7 @@
#include "chrome/browser/web_applications/components/app_icon_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_test.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/test/base/ui_test_utils.h"
#include "content/public/test/browser_test.h"
......@@ -28,34 +25,12 @@
namespace web_app {
// These tests are unified. They test a common subset for Bookmark Apps and
// Web Apps: they are parametrized (TEST_P) to run twice with BMO flag off and
// on.
class TwoClientWebAppsSyncTest
: public SyncTest,
public ::testing::WithParamInterface<ProviderType> {
class TwoClientWebAppsSyncTest : public SyncTest {
public:
TwoClientWebAppsSyncTest() : 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();
}
TwoClientWebAppsSyncTest() : SyncTest(TWO_CLIENT) { DisableVerifier(); }
~TwoClientWebAppsSyncTest() override = default;
bool IsBookmarkAppsSync() const {
return GetParam() == ProviderType::kBookmarkApps;
}
AppId InstallApp(const WebApplicationInfo& info, Profile* profile) {
DCHECK(info.start_url.is_valid());
base::RunLoop run_loop;
......@@ -99,12 +74,10 @@ class TwoClientWebAppsSyncTest
}
private:
base::test::ScopedFeatureList scoped_feature_list_;
DISALLOW_COPY_AND_ASSIGN(TwoClientWebAppsSyncTest);
};
IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, Basic) {
IN_PROC_BROWSER_TEST_F(TwoClientWebAppsSyncTest, Basic) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
......@@ -119,16 +92,11 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, Basic) {
const AppRegistrar& registrar = GetRegistrar(GetProfile(1));
EXPECT_EQ(base::UTF8ToUTF16(registrar.GetAppShortName(app_id)), info.title);
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());
}
IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, Minimal) {
IN_PROC_BROWSER_TEST_F(TwoClientWebAppsSyncTest, Minimal) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
......@@ -145,7 +113,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, Minimal) {
EXPECT_TRUE(AllProfilesHaveSameWebAppIds());
}
IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, ThemeColor) {
IN_PROC_BROWSER_TEST_F(TwoClientWebAppsSyncTest, ThemeColor) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
......@@ -166,7 +134,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, ThemeColor) {
EXPECT_TRUE(AllProfilesHaveSameWebAppIds());
}
IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, IsLocallyInstalled) {
IN_PROC_BROWSER_TEST_F(TwoClientWebAppsSyncTest, IsLocallyInstalled) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
......@@ -188,7 +156,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, IsLocallyInstalled) {
EXPECT_TRUE(AllProfilesHaveSameWebAppIds());
}
IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, AppFieldsChangeDoesNotSync) {
IN_PROC_BROWSER_TEST_F(TwoClientWebAppsSyncTest, AppFieldsChangeDoesNotSync) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
......@@ -207,11 +175,6 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, AppFieldsChangeDoesNotSync) {
EXPECT_EQ(base::UTF8ToUTF16(registrar1.GetAppShortName(app_id_a)),
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);
ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
......@@ -245,11 +208,6 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, AppFieldsChangeDoesNotSync) {
// After sync we should not see the metadata update in Profile 1.
EXPECT_EQ(base::UTF8ToUTF16(registrar1.GetAppShortName(app_id_a)),
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);
......@@ -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.
// Context: https://crbug.com/1058283
IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncFaviconOnly) {
IN_PROC_BROWSER_TEST_F(TwoClientWebAppsSyncTest, SyncFaviconOnly) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
ASSERT_TRUE(embedded_test_server()->Start());
......@@ -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
// through sync.
IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncUsingStartUrlFallback) {
IN_PROC_BROWSER_TEST_F(TwoClientWebAppsSyncTest, SyncUsingStartUrlFallback) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
ASSERT_TRUE(embedded_test_server()->Start());
......@@ -330,7 +288,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncUsingStartUrlFallback) {
// Pages without a manifest are usually not the correct page to draw information
// from e.g. login redirects or loading pages.
// Context: https://crbug.com/1078286
IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncUsingNameFallback) {
IN_PROC_BROWSER_TEST_F(TwoClientWebAppsSyncTest, SyncUsingNameFallback) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
ASSERT_TRUE(embedded_test_server()->Start());
......@@ -358,7 +316,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncUsingNameFallback) {
// Negative test of SyncUsingNameFallback above. Don't use the app name fallback
// 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(AllProfilesHaveSameWebAppIds());
ASSERT_TRUE(embedded_test_server()->Start());
......@@ -383,7 +341,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncWithoutUsingNameFallback) {
"Basic web app");
}
IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncUsingIconUrlFallback) {
IN_PROC_BROWSER_TEST_F(TwoClientWebAppsSyncTest, SyncUsingIconUrlFallback) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameWebAppIds());
ASSERT_TRUE(embedded_test_server()->Start());
......@@ -395,14 +353,7 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncUsingIconUrlFallback) {
// one of them to simulate the other winning the "race".
InstallManager& install_manager =
WebAppProvider::Get(dest_profile)->install_manager();
switch (GetParam()) {
case ProviderType::kBookmarkApps:
install_manager.DisableWebAppSyncInstallForTesting();
break;
case ProviderType::kWebApps:
install_manager.DisableBookmarkAppSyncInstallForTesting();
break;
}
WebAppInstallObserver dest_install_observer(dest_profile);
......@@ -445,10 +396,4 @@ IN_PROC_BROWSER_TEST_P(TwoClientWebAppsSyncTest, SyncUsingIconUrlFallback) {
SK_ColorBLUE);
}
INSTANTIATE_TEST_SUITE_P(All,
TwoClientWebAppsSyncTest,
::testing::Values(ProviderType::kBookmarkApps,
ProviderType::kWebApps),
ProviderTypeParamToString);
} // 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