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

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

Issue 15580002: Make use of InvalidationService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 6 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 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 << ".";
« no previous file with comments | « chrome/browser/sync/profile_sync_service_unittest.cc ('k') | chrome/browser/sync/test_profile_sync_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698