| 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 6b538269529cde5d62bdc6e5f9a75a6986d2ea69..bf0ab849d77ca506660348a3f998af1176593c2f 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 << ".";
|
|
|
|
|