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

Unified Diff: chrome/browser/sync/test/integration/sync_test.cc

Issue 13197004: Draft: InvalidationService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Passes tests Created 7 years, 8 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/browser/sync/test/integration/sync_test.cc
diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc
index fbe950088d15d384222e26b4881d0e9e45055d26..210cb6913b70c30ab9b8f001b45087eeddeae256 100644
--- a/chrome/browser/sync/test/integration/sync_test.cc
+++ b/chrome/browser/sync/test/integration/sync_test.cc
@@ -21,7 +21,9 @@
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/google/google_url_tracker.h"
#include "chrome/browser/history/history_service_factory.h"
+#include "chrome/browser/invalidation_service_factory.h"
#include "chrome/browser/lifetime/application_lifetime.h"
+#include "chrome/browser/p2p_invalidation_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/search_engines/template_url_service.h"
@@ -308,12 +310,20 @@ void SyncTest::InitializeInstance(int index) {
EXPECT_FALSE(GetBrowser(index) == NULL) << "Could not create Browser "
<< index << ".";
+ P2PInvalidationService* p2p_invalidation_service =
+ static_cast<P2PInvalidationService*>(
+ InvalidationServiceFactory::GetInstance()->SetTestingFactoryAndUse(
+ GetProfile(index),
+ InvalidationServiceFactory::BuildP2PInvalidationServiceFor));
+ p2p_invalidation_service->UpdateCredentials(username_, password_);
+
// Make sure the ProfileSyncService has been created before creating the
// ProfileSyncServiceHarness - some tests expect the ProfileSyncService to
// already exist.
ProfileSyncServiceFactory::GetForProfile(GetProfile(index));
clients_[index] = new ProfileSyncServiceHarness(GetProfile(index),
+ p2p_invalidation_service,
username_,
password_);
EXPECT_FALSE(GetClient(index) == NULL) << "Could not create Client "
@@ -327,20 +337,6 @@ void SyncTest::InitializeInstance(int index) {
TemplateURLServiceFactory::GetForProfile(GetProfile(index)));
}
-void SyncTest::RestartSyncService(int index) {
- DVLOG(1) << "Restarting profile sync service for profile " << index << ".";
- delete clients_[index];
- Profile* profile = GetProfile(index);
- ProfileSyncService* service =
- ProfileSyncServiceFactory::GetForProfile(profile);
- service->ResetForTest();
- clients_[index] = new ProfileSyncServiceHarness(profile,
- username_,
- password_);
- service->Initialize();
- GetClient(index)->AwaitSyncRestart();
-}
-
bool SyncTest::SetupSync() {
// Create sync profiles and clients if they haven't already been created.
if (profiles_.empty()) {

Powered by Google App Engine
This is Rietveld 408576698