diff options
Diffstat (limited to 'chrome/browser/sync/test/integration/sync_test.cc')
-rw-r--r-- | chrome/browser/sync/test/integration/sync_test.cc | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc index 8db1baa..c45ea1e 100644 --- a/chrome/browser/sync/test/integration/sync_test.cc +++ b/chrome/browser/sync/test/integration/sync_test.cc @@ -21,6 +21,8 @@ #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/invalidation_service_factory.h" +#include "chrome/browser/invalidation/p2p_invalidation_service.h" #include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" @@ -60,6 +62,7 @@ #include "sync/protocol/sync.pb.h" using content::BrowserThread; +using invalidation::InvalidationServiceFactory; namespace switches { const char kPasswordFileForTest[] = "password-file-for-test"; @@ -196,11 +199,6 @@ void SyncTest::SetUpCommandLine(CommandLine* cl) { } void SyncTest::AddTestSwitches(CommandLine* cl) { - // TODO(rsimha): Until we implement a fake Tango server against which tests - // can run, we need to set the --sync-notification-method to "p2p". - if (!cl->HasSwitch(switches::kSyncNotificationMethod)) - cl->AppendSwitchASCII(switches::kSyncNotificationMethod, "p2p"); - // Disable non-essential access of external network resources. if (!cl->HasSwitch(switches::kDisableBackgroundNetworking)) cl->AppendSwitch(switches::kDisableBackgroundNetworking); @@ -306,14 +304,22 @@ void SyncTest::InitializeInstance(int index) { EXPECT_FALSE(GetBrowser(index) == NULL) << "Could not create Browser " << index << "."; + invalidation::P2PInvalidationService* p2p_invalidation_service = + InvalidationServiceFactory::GetInstance()-> + BuildAndUseP2PInvalidationServiceForTest(GetProfile(index)); + 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), - username_, - password_); + clients_[index] = + ProfileSyncServiceHarness::CreateForIntegrationTest( + GetProfile(index), + username_, + password_, + p2p_invalidation_service); EXPECT_FALSE(GetClient(index) == NULL) << "Could not create Client " << index << "."; |