Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7563)

Unified Diff: chrome/test/live_sync/two_client_live_apps_sync_test.cc

Issue 7599019: Allow sync integration tests to operate on multiple datatypes: Apps, Extensions, Themes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR feedback Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/live_sync/two_client_live_apps_sync_test.cc
diff --git a/chrome/test/live_sync/two_client_live_apps_sync_test.cc b/chrome/test/live_sync/two_client_live_apps_sync_test.cc
deleted file mode 100644
index da36ce4dedf1e095667b15a76c4ac1b0038342bb..0000000000000000000000000000000000000000
--- a/chrome/test/live_sync/two_client_live_apps_sync_test.cc
+++ /dev/null
@@ -1,275 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/basictypes.h"
-#include "chrome/browser/sync/profile_sync_service_harness.h"
-#include "chrome/test/live_sync/live_apps_sync_test.h"
-
-class TwoClientLiveAppsSyncTest : public LiveAppsSyncTest {
- public:
- TwoClientLiveAppsSyncTest()
- : LiveAppsSyncTest(TWO_CLIENT) {}
-
- virtual ~TwoClientLiveAppsSyncTest() {}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TwoClientLiveAppsSyncTest);
-};
-
-IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest,
- StartWithNoApps) {
- ASSERT_TRUE(SetupSync());
-
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-}
-
-IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest,
- StartWithSameApps) {
- ASSERT_TRUE(SetupClients());
-
- const int kNumApps = 5;
- for (int i = 0; i < kNumApps; ++i) {
- InstallApp(GetProfile(0), i);
- InstallApp(GetProfile(1), i);
- InstallApp(verifier(), i);
- }
-
- ASSERT_TRUE(SetupSync());
-
- ASSERT_TRUE(AwaitQuiescence());
-
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-}
-
-IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest,
- StartWithDifferentApps) {
- ASSERT_TRUE(SetupClients());
-
- int i = 0;
-
- const int kNumCommonApps = 5;
- 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);
- }
-
- const int kNumProfile1Apps = 10;
- for (int j = 0; j < kNumProfile1Apps; ++i, ++j) {
- InstallApp(GetProfile(1), i);
- InstallApp(verifier(), i);
- }
-
- ASSERT_TRUE(SetupSync());
-
- ASSERT_TRUE(AwaitQuiescence());
-
- InstallAppsPendingForSync(GetProfile(0));
- InstallAppsPendingForSync(GetProfile(1));
-
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-}
-
-IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest,
- InstallDifferentApps) {
- ASSERT_TRUE(SetupClients());
-
- int i = 0;
-
- const int kNumCommonApps = 5;
- for (int j = 0; j < kNumCommonApps; ++i, ++j) {
- InstallApp(GetProfile(0), i);
- InstallApp(GetProfile(1), i);
- InstallApp(verifier(), i);
- }
-
- ASSERT_TRUE(SetupSync());
-
- ASSERT_TRUE(AwaitQuiescence());
-
- const int kNumProfile0Apps = 10;
- for (int j = 0; j < kNumProfile0Apps; ++i, ++j) {
- InstallApp(GetProfile(0), i);
- InstallApp(verifier(), i);
- }
-
- const int kNumProfile1Apps = 10;
- for (int j = 0; j < kNumProfile1Apps; ++i, ++j) {
- InstallApp(GetProfile(1), i);
- InstallApp(verifier(), i);
- }
-
- ASSERT_TRUE(AwaitQuiescence());
-
- InstallAppsPendingForSync(GetProfile(0));
- InstallAppsPendingForSync(GetProfile(1));
-
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-}
-
-// TCM ID - 3711279.
-IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, Add) {
- ASSERT_TRUE(SetupSync());
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-
- InstallApp(GetProfile(0), 0);
- InstallApp(verifier(), 0);
- ASSERT_TRUE(AwaitQuiescence());
-
- InstallAppsPendingForSync(GetProfile(0));
- InstallAppsPendingForSync(GetProfile(1));
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-}
-
-// TCM ID - 3706267.
-IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, Uninstall) {
- ASSERT_TRUE(SetupSync());
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-
- InstallApp(GetProfile(0), 0);
- InstallApp(verifier(), 0);
- ASSERT_TRUE(AwaitQuiescence());
-
- InstallAppsPendingForSync(GetProfile(0));
- InstallAppsPendingForSync(GetProfile(1));
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-
- UninstallApp(GetProfile(0), 0);
- UninstallApp(verifier(), 0);
- ASSERT_TRUE(AwaitQuiescence());
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-}
-
-// TCM ID - 3699295.
-IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, Merge) {
- ASSERT_TRUE(SetupSync());
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-
- InstallApp(GetProfile(0), 0);
- InstallApp(GetProfile(1), 0);
- ASSERT_TRUE(AwaitQuiescence());
-
- UninstallApp(GetProfile(0), 0);
- InstallApp(GetProfile(0), 1);
- InstallApp(verifier(), 1);
-
- InstallApp(GetProfile(0), 2);
- InstallApp(GetProfile(1), 2);
- InstallApp(verifier(), 2);
-
- InstallApp(GetProfile(1), 3);
- InstallApp(verifier(), 3);
-
- ASSERT_TRUE(AwaitQuiescence());
- InstallAppsPendingForSync(GetProfile(0));
- InstallAppsPendingForSync(GetProfile(1));
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-}
-
-// TCM ID - 7723126.
-IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, UpdateEnableDisableApp) {
- ASSERT_TRUE(SetupSync());
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-
- InstallApp(GetProfile(0), 0);
- InstallApp(GetProfile(1), 0);
- InstallApp(verifier(), 0);
- ASSERT_TRUE(AwaitQuiescence());
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-
- DisableApp(GetProfile(0), 0);
- DisableApp(verifier(), 0);
- ASSERT_TRUE(HasSameAppsAsVerifier(0));
- ASSERT_FALSE(HasSameAppsAsVerifier(1));
-
- ASSERT_TRUE(AwaitQuiescence());
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-
- EnableApp(GetProfile(1), 0);
- EnableApp(verifier(), 0);
- ASSERT_TRUE(HasSameAppsAsVerifier(1));
- ASSERT_FALSE(HasSameAppsAsVerifier(0));
-
- ASSERT_TRUE(AwaitQuiescence());
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-}
-
-// TCM ID - 7706637.
-IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest,
- UpdateIncognitoEnableDisable) {
- ASSERT_TRUE(SetupSync());
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-
- InstallApp(GetProfile(0), 0);
- InstallApp(GetProfile(1), 0);
- InstallApp(verifier(), 0);
- ASSERT_TRUE(AwaitQuiescence());
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-
- IncognitoEnableApp(GetProfile(0), 0);
- IncognitoEnableApp(verifier(), 0);
- ASSERT_TRUE(HasSameAppsAsVerifier(0));
- ASSERT_FALSE(HasSameAppsAsVerifier(1));
-
- ASSERT_TRUE(AwaitQuiescence());
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-
- IncognitoDisableApp(GetProfile(1), 0);
- IncognitoDisableApp(verifier(), 0);
- ASSERT_TRUE(HasSameAppsAsVerifier(1));
- ASSERT_FALSE(HasSameAppsAsVerifier(0));
-
- ASSERT_TRUE(AwaitQuiescence());
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-}
-
-// TCM ID - 3718276.
-IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, DisableApps) {
- ASSERT_TRUE(SetupSync());
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-
- ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncable::APPS));
- InstallApp(GetProfile(0), 0);
- InstallApp(verifier(), 0);
- ASSERT_TRUE(AwaitQuiescence());
- ASSERT_TRUE(HasSameAppsAsVerifier(0));
- ASSERT_FALSE(HasSameAppsAsVerifier(1));
-
- ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncable::APPS));
- ASSERT_TRUE(AwaitQuiescence());
-
- InstallAppsPendingForSync(GetProfile(0));
- InstallAppsPendingForSync(GetProfile(1));
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-}
-
-// TCM ID - 3720303.
-IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, DisableSync) {
- ASSERT_TRUE(SetupSync());
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-
- ASSERT_TRUE(GetClient(1)->DisableSyncForAllDatatypes());
- InstallApp(GetProfile(0), 0);
- InstallApp(verifier(), 0);
- ASSERT_TRUE(GetClient(0)->AwaitSyncCycleCompletion("Installed an app."));
- ASSERT_TRUE(HasSameAppsAsVerifier(0));
- ASSERT_FALSE(HasSameAppsAsVerifier(1));
-
- ASSERT_TRUE(GetClient(1)->EnableSyncForAllDatatypes());
- ASSERT_TRUE(AwaitQuiescence());
-
- InstallAppsPendingForSync(GetProfile(0));
- InstallAppsPendingForSync(GetProfile(1));
- ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
-}
-
-// TODO(akalin): Add tests exercising:
-// - Offline installation/uninstallation behavior
-// - App-specific properties

Powered by Google App Engine
This is Rietveld 408576698