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..53a305d80295c5a82e672993a02dc0f64add11c2 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" |
@@ -205,6 +206,9 @@ bool ProfileSyncServiceHarness::SetupSync( |
// Subscribe sync client to notifications from the profile sync service. |
if (!service()->HasObserver(this)) |
service()->AddObserver(this); |
+ // Start listening for and emitting notifications of commits. |
+ p2p_invalidation_forwarder_.reset( |
+ new P2PInvalidationForwarder(service(), p2p_invalidation_service_)); |
haitaol1
2014/02/19 21:15:21
You don't need p2p_invalidation_service_ if creati
rlarocque
2014/02/19 22:21:14
Good point. I hadn't thought of that.
Fixed.
|
// Tell the sync service that setup is in progress so we don't start syncing |
// until we've finished configuration. |
@@ -312,15 +316,6 @@ void ProfileSyncServiceHarness::OnStateChanged() { |
void ProfileSyncServiceHarness::OnSyncCycleCompleted() { |
// Integration tests still use p2p notifications. |
haitaol1
2014/02/19 21:15:21
obsolete comment?
rlarocque
2014/02/19 22:21:14
Correct. Removed.
|
- 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(); |
} |