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

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

Issue 167913002: sync: Add helper class for P2P invalidations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes Created 6 years, 10 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
« no previous file with comments | « chrome/browser/sync/test/integration/profile_sync_service_harness.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/test/integration/profile_sync_service_harness.cc
diff --git a/chrome/browser/sync/test/integration/profile_sync_service_harness.cc b/chrome/browser/sync/test/integration/profile_sync_service_harness.cc
index c311344c52b3fc291a93eccbfe40e5482250ab4b..d0478873e242e13714a576edab6915c869d197fa 100644
--- a/chrome/browser/sync/test/integration/profile_sync_service_harness.cc
+++ b/chrome/browser/sync/test/integration/profile_sync_service_harness.cc
@@ -31,6 +31,7 @@
#include "chrome/browser/sync/about_sync_util.h"
#include "chrome/browser/sync/backend_migrator.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
+#include "chrome/browser/sync/test/integration/p2p_invalidation_forwarder.h"
#include "chrome/browser/sync/test/integration/status_change_checker.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
@@ -162,13 +163,15 @@ ProfileSyncServiceHarness::ProfileSyncServiceHarness(
P2PInvalidationService* p2p_invalidation_service)
: profile_(profile),
service_(ProfileSyncServiceFactory::GetForProfile(profile)),
- p2p_invalidation_service_(p2p_invalidation_service),
progress_marker_partner_(NULL),
username_(username),
password_(password),
oauth2_refesh_token_number_(0),
profile_debug_name_(profile->GetDebugName()),
status_change_checker_(NULL) {
+ // Start listening for and emitting notifications of commits.
+ p2p_invalidation_forwarder_.reset(
+ new P2PInvalidationForwarder(service_, p2p_invalidation_service));
}
ProfileSyncServiceHarness::~ProfileSyncServiceHarness() {
@@ -311,16 +314,6 @@ void ProfileSyncServiceHarness::OnStateChanged() {
}
void ProfileSyncServiceHarness::OnSyncCycleCompleted() {
- // Integration tests still use p2p notifications.
- const SyncSessionSnapshot& snap = GetLastSessionSnapshot();
- bool is_notifiable_commit =
- (snap.model_neutral_state().num_successful_commits > 0);
- if (is_notifiable_commit && p2p_invalidation_service_) {
- syncer::ModelTypeSet model_types =
- snap.model_neutral_state().commit_request_types;
- syncer::ObjectIdSet ids = ModelTypeSetToObjectIdSet(model_types);
- p2p_invalidation_service_->SendInvalidation(ids);
- }
OnStateChanged();
}
« no previous file with comments | « chrome/browser/sync/test/integration/profile_sync_service_harness.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698