| Index: chrome/browser/sync/test/integration/two_client_apps_sync_test.cc
|
| diff --git a/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc b/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc
|
| index 6ba8a21e8602e099f508b53bdcb96c149a5bbdb9..0dae46c2b58d50f9a8ddbcc0d019c1f14ab146c5 100644
|
| --- a/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc
|
| +++ b/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc
|
| @@ -27,12 +27,13 @@
|
| #include "extensions/common/constants.h"
|
| #include "sync/api/string_ordinal.h"
|
|
|
| -using apps_helper::AllProfilesHaveSameApps;
|
| +using apps_helper::AllProfilesHaveSameAppsAsVerifier;
|
| using apps_helper::CopyNTPOrdinals;
|
| using apps_helper::DisableApp;
|
| using apps_helper::EnableApp;
|
| using apps_helper::FixNTPOrdinalCollisions;
|
| using apps_helper::GetAppLaunchOrdinalForApp;
|
| +using apps_helper::HasSameAppsAsVerifier;
|
| using apps_helper::IncognitoDisableApp;
|
| using apps_helper::IncognitoEnableApp;
|
| using apps_helper::InstallApp;
|
| @@ -56,9 +57,7 @@
|
|
|
| class TwoClientAppsSyncTest : public SyncTest {
|
| public:
|
| - TwoClientAppsSyncTest() : SyncTest(TWO_CLIENT) {
|
| - DisableVerifier();
|
| - }
|
| + TwoClientAppsSyncTest() : SyncTest(TWO_CLIENT) {}
|
|
|
| ~TwoClientAppsSyncTest() override {}
|
|
|
| @@ -75,6 +74,7 @@
|
| }
|
|
|
| IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, E2E_ENABLED(StartWithSameApps)) {
|
| + DisableVerifier();
|
| ASSERT_TRUE(SetupClients());
|
|
|
| const int kNumApps = 5;
|
| @@ -101,22 +101,32 @@
|
| for (int j = 0; j < kNumCommonApps; ++i, ++j) {
|
| InstallApp(GetProfile(0), i);
|
| InstallApp(GetProfile(1), i);
|
| + InstallApp(verifier(), i);
|
| }
|
|
|
| const int kNumProfile0Apps = 10;
|
| for (int j = 0; j < kNumProfile0Apps; ++i, ++j) {
|
| InstallApp(GetProfile(0), i);
|
| + InstallApp(verifier(), i);
|
| + CopyNTPOrdinals(GetProfile(0), verifier(), i);
|
| }
|
|
|
| const int kNumProfile1Apps = 10;
|
| for (int j = 0; j < kNumProfile1Apps; ++i, ++j) {
|
| InstallApp(GetProfile(1), i);
|
| + InstallApp(verifier(), i);
|
| + CopyNTPOrdinals(GetProfile(1), verifier(), i);
|
| }
|
|
|
| const int kNumPlatformApps = 5;
|
| for (int j = 0; j < kNumPlatformApps; ++i, ++j) {
|
| InstallPlatformApp(GetProfile(1), i);
|
| - }
|
| + InstallPlatformApp(verifier(), i);
|
| + CopyNTPOrdinals(GetProfile(1), verifier(), i);
|
| + }
|
| +
|
| + FixNTPOrdinalCollisions(verifier());
|
| +
|
| ASSERT_TRUE(SetupSync());
|
|
|
| ASSERT_TRUE(AwaitAllProfilesHaveSameApps());
|
| @@ -127,6 +137,7 @@
|
| // end up with all apps, and the app and page ordinals should be identical.
|
| IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest,
|
| E2E_ENABLED(InstallDifferentApps)) {
|
| + DisableVerifier();
|
| ASSERT_TRUE(SetupClients());
|
|
|
| int i = 0;
|
| @@ -154,6 +165,7 @@
|
|
|
| // TCM ID - 3711279.
|
| IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, E2E_ENABLED(Add)) {
|
| + DisableVerifier();
|
| ASSERT_TRUE(SetupSync());
|
| ASSERT_TRUE(AwaitAllProfilesHaveSameApps());
|
|
|
| @@ -164,6 +176,7 @@
|
|
|
| // TCM ID - 3706267.
|
| IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, E2E_ENABLED(Uninstall)) {
|
| + DisableVerifier();
|
| ASSERT_TRUE(SetupSync());
|
| ASSERT_TRUE(AwaitAllProfilesHaveSameApps());
|
|
|
| @@ -180,6 +193,7 @@
|
| // ordinals.
|
| IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest,
|
| E2E_ENABLED(UninstallThenInstall)) {
|
| + DisableVerifier();
|
| ASSERT_TRUE(SetupSync());
|
| ASSERT_TRUE(AwaitAllProfilesHaveSameApps());
|
|
|
| @@ -195,6 +209,7 @@
|
|
|
| // TCM ID - 3699295.
|
| IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, E2E_ENABLED(Merge)) {
|
| + DisableVerifier();
|
| ASSERT_TRUE(SetupSync());
|
| ASSERT_TRUE(AwaitAllProfilesHaveSameApps());
|
|
|
| @@ -215,6 +230,7 @@
|
| // TCM ID - 7723126.
|
| IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest,
|
| E2E_ENABLED(UpdateEnableDisableApp)) {
|
| + DisableVerifier();
|
| ASSERT_TRUE(SetupSync());
|
| ASSERT_TRUE(AwaitAllProfilesHaveSameApps());
|
|
|
| @@ -231,6 +247,7 @@
|
| // TCM ID - 7706637.
|
| IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest,
|
| E2E_ENABLED(UpdateIncognitoEnableDisable)) {
|
| + DisableVerifier();
|
| ASSERT_TRUE(SetupSync());
|
| ASSERT_TRUE(AwaitAllProfilesHaveSameApps());
|
|
|
| @@ -248,6 +265,7 @@
|
| // one client and sync. Both clients should have the updated page ordinal for
|
| // the app.
|
| IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, E2E_ENABLED(UpdatePageOrdinal)) {
|
| + DisableVerifier();
|
| ASSERT_TRUE(SetupSync());
|
| ASSERT_TRUE(AwaitAllProfilesHaveSameApps());
|
|
|
| @@ -266,6 +284,7 @@
|
| // launch ordinal for the app.
|
| IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest,
|
| E2E_ENABLED(UpdateAppLaunchOrdinal)) {
|
| + DisableVerifier();
|
| ASSERT_TRUE(SetupSync());
|
| ASSERT_TRUE(AwaitAllProfilesHaveSameApps());
|
|
|
| @@ -284,6 +303,7 @@
|
| // 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_F(TwoClientAppsSyncTest, E2E_ENABLED(UpdateCWSOrdinals)) {
|
| + DisableVerifier();
|
| ASSERT_TRUE(SetupSync());
|
| ASSERT_TRUE(AwaitAllProfilesHaveSameApps());
|
|
|
| @@ -313,6 +333,7 @@
|
| // 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_F(TwoClientAppsSyncTest, E2E_ENABLED(UpdateLaunchType)) {
|
| + DisableVerifier();
|
| ASSERT_TRUE(SetupSync());
|
| ASSERT_TRUE(AwaitAllProfilesHaveSameApps());
|
|
|
| @@ -340,9 +361,11 @@
|
|
|
| IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, UnexpectedLaunchType) {
|
| ASSERT_TRUE(SetupSync());
|
| - ASSERT_TRUE(AllProfilesHaveSameApps());
|
| + ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
|
|
|
| extensions::SetLaunchType(GetProfile(1), extensions::kWebStoreAppId,
|
| + extensions::LAUNCH_TYPE_REGULAR);
|
| + extensions::SetLaunchType(verifier(), extensions::kWebStoreAppId,
|
| extensions::LAUNCH_TYPE_REGULAR);
|
| ASSERT_TRUE(AwaitAllProfilesHaveSameApps());
|
|
|
| @@ -379,7 +402,7 @@
|
|
|
| IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, BookmarkApp) {
|
| ASSERT_TRUE(SetupSync());
|
| - ASSERT_TRUE(AllProfilesHaveSameApps());
|
| + ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
|
|
|
| size_t num_extensions =
|
| GetExtensionRegistry(GetProfile(0))->enabled_extensions().size();
|
| @@ -400,10 +423,20 @@
|
| GetExtensionRegistry(GetProfile(0))->enabled_extensions().size());
|
| }
|
| {
|
| + content::WindowedNotificationObserver windowed_observer(
|
| + extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
| + content::NotificationService::AllSources());
|
| + extensions::CreateOrUpdateBookmarkApp(GetExtensionService(verifier()),
|
| + &web_app_info);
|
| + windowed_observer.Wait();
|
| + EXPECT_EQ(num_extensions,
|
| + GetExtensionRegistry(verifier())->enabled_extensions().size());
|
| + }
|
| + {
|
| // Wait for the synced app to install.
|
| content::WindowedNotificationObserver windowed_observer(
|
| extensions::NOTIFICATION_CRX_INSTALLER_DONE,
|
| - base::Bind(&AllProfilesHaveSameApps));
|
| + base::Bind(&AllProfilesHaveSameAppsAsVerifier));
|
| windowed_observer.Wait();
|
| }
|
| }
|
|
|