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

Unified Diff: chrome/browser/sync/profile_sync_service.cc

Issue 10915216: Browser test for the push messaging feature (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: CR changes per DCheng Created 8 years, 3 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/profile_sync_service.cc
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index 366026f19d0ee7d468d93903afe21b9b920ee832..516c1f33a483693dceebfdae8b199370a4429dee 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -472,6 +472,22 @@ syncer::InvalidatorState ProfileSyncService::GetInvalidatorState() const {
return invalidator_registrar_.GetInvalidatorState();
}
+// Test method for system test to allow a test to send in an invalidation.
+void ProfileSyncService::SendInvalidationForTest(
+ const invalidation::ObjectId objId,
+ const std::string& payload) {
+ // insert the object into the list of IDs to notify
+ syncer::ObjectIdSet notify_ids;
+ notify_ids.insert(objId);
+
+ // Build an object state map, and use it to forward the call to
+ // registered clients such as PushMessagingHandler::OnIncomingNotification
+ // as if this came from the server.
+ const syncer::ObjectIdStateMap& id_state_map =
+ ObjectIdSetToStateMap(notify_ids, payload);
+ OnIncomingInvalidation(id_state_map, syncer::REMOTE_INVALIDATION);
+}
+
void ProfileSyncService::Shutdown() {
ShutdownImpl(false);
}
« chrome/browser/sync/profile_sync_service.h ('K') | « chrome/browser/sync/profile_sync_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698