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

Unified Diff: sync/notifier/fake_invalidator.cc

Issue 10874096: [Sync] Rework Invalidator-related unit tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 4 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 | « sync/notifier/fake_invalidator.h ('k') | sync/notifier/fake_invalidator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/fake_invalidator.cc
diff --git a/sync/notifier/fake_invalidator.cc b/sync/notifier/fake_invalidator.cc
index 85696ad4d64baf8ddd286cbabc702432d1e4e330..7468dae06cf78c686caada0ac9e0619a07e5eef6 100644
--- a/sync/notifier/fake_invalidator.cc
+++ b/sync/notifier/fake_invalidator.cc
@@ -16,11 +16,7 @@ bool FakeInvalidator::IsHandlerRegistered(InvalidationHandler* handler) const {
ObjectIdSet FakeInvalidator::GetRegisteredIds(
InvalidationHandler* handler) const {
- return registrar_.GetRegisteredIdsForTest(handler);
-}
-
-void FakeInvalidator::RegisterHandler(InvalidationHandler* handler) {
- registrar_.RegisterHandler(handler);
+ return registrar_.GetRegisteredIds(handler);
}
const std::string& FakeInvalidator::GetUniqueId() const {
@@ -39,8 +35,27 @@ const std::string& FakeInvalidator::GetCredentialsToken() const {
return token_;
}
-ModelTypeSet FakeInvalidator::GetLastChangedTypes() const {
- return last_changed_types_;
+const ObjectIdStateMap& FakeInvalidator::GetLastSentIdStateMap() const {
+ return last_sent_id_state_map_;
+}
+
+void FakeInvalidator::EmitOnNotificationsEnabled() {
+ registrar_.EmitOnNotificationsEnabled();
+}
+
+void FakeInvalidator::EmitOnIncomingNotification(
+ const ObjectIdStateMap& id_state_map,
+ IncomingNotificationSource source) {
+ registrar_.DispatchInvalidationsToHandlers(id_state_map, source);
+}
+
+void FakeInvalidator::EmitOnNotificationsDisabled(
+ NotificationsDisabledReason reason) {
+ registrar_.EmitOnNotificationsDisabled(reason);
+}
+
+void FakeInvalidator::RegisterHandler(InvalidationHandler* handler) {
+ registrar_.RegisterHandler(handler);
}
void FakeInvalidator::UpdateRegisteredIds(InvalidationHandler* handler,
@@ -66,8 +81,8 @@ void FakeInvalidator::UpdateCredentials(
token_ = token;
}
-void FakeInvalidator::SendNotification(ModelTypeSet changed_types) {
- last_changed_types_ = changed_types;
+void FakeInvalidator::SendNotification(const ObjectIdStateMap& id_state_map) {
+ last_sent_id_state_map_ = id_state_map;
}
} // namespace syncer
« no previous file with comments | « sync/notifier/fake_invalidator.h ('k') | sync/notifier/fake_invalidator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698