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

Side by Side Diff: sync/notifier/fake_invalidator.h

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, 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sync/internal_api/sync_manager_impl.cc ('k') | sync/notifier/fake_invalidator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SYNC_NOTIFIER_FAKE_INVALIDATOR_H_ 5 #ifndef SYNC_NOTIFIER_FAKE_INVALIDATOR_H_
6 #define SYNC_NOTIFIER_FAKE_INVALIDATOR_H_ 6 #define SYNC_NOTIFIER_FAKE_INVALIDATOR_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "sync/notifier/invalidation_util.h" 11 #include "sync/notifier/invalidation_util.h"
12 #include "sync/notifier/invalidator.h" 12 #include "sync/notifier/invalidator.h"
13 #include "sync/notifier/invalidator_registrar.h" 13 #include "sync/notifier/invalidator_registrar.h"
14 14
15 namespace syncer { 15 namespace syncer {
16 16
17 class FakeInvalidator : public Invalidator { 17 class FakeInvalidator : public Invalidator {
18 public: 18 public:
19 FakeInvalidator(); 19 FakeInvalidator();
20 virtual ~FakeInvalidator(); 20 virtual ~FakeInvalidator();
21 21
22 bool IsHandlerRegistered(InvalidationHandler* handler) const; 22 bool IsHandlerRegistered(InvalidationHandler* handler) const;
23 ObjectIdSet GetRegisteredIds(InvalidationHandler* handler) const; 23 ObjectIdSet GetRegisteredIds(InvalidationHandler* handler) const;
24 const std::string& GetUniqueId() const; 24 const std::string& GetUniqueId() const;
25 const std::string& GetStateDeprecated() const; 25 const std::string& GetStateDeprecated() const;
26 const std::string& GetCredentialsEmail() const; 26 const std::string& GetCredentialsEmail() const;
27 const std::string& GetCredentialsToken() const; 27 const std::string& GetCredentialsToken() const;
28 ModelTypeSet GetLastChangedTypes() const; 28 const ObjectIdStateMap& GetLastSentIdStateMap() const;
29
30 void EmitOnNotificationsEnabled();
31 void EmitOnIncomingNotification(const ObjectIdStateMap& id_state_map,
32 IncomingNotificationSource source);
33 void EmitOnNotificationsDisabled(NotificationsDisabledReason reason);
29 34
30 virtual void RegisterHandler(InvalidationHandler* handler) OVERRIDE; 35 virtual void RegisterHandler(InvalidationHandler* handler) OVERRIDE;
31 virtual void UpdateRegisteredIds(InvalidationHandler* handler, 36 virtual void UpdateRegisteredIds(InvalidationHandler* handler,
32 const ObjectIdSet& ids) OVERRIDE; 37 const ObjectIdSet& ids) OVERRIDE;
33 virtual void UnregisterHandler(InvalidationHandler* handler) OVERRIDE; 38 virtual void UnregisterHandler(InvalidationHandler* handler) OVERRIDE;
34 virtual void SetUniqueId(const std::string& unique_id) OVERRIDE; 39 virtual void SetUniqueId(const std::string& unique_id) OVERRIDE;
35 virtual void SetStateDeprecated(const std::string& state) OVERRIDE; 40 virtual void SetStateDeprecated(const std::string& state) OVERRIDE;
36 virtual void UpdateCredentials( 41 virtual void UpdateCredentials(
37 const std::string& email, const std::string& token) OVERRIDE; 42 const std::string& email, const std::string& token) OVERRIDE;
38 virtual void SendNotification(ModelTypeSet changed_types) OVERRIDE; 43 virtual void SendNotification(const ObjectIdStateMap& id_state_map) OVERRIDE;
39 44
40 private: 45 private:
41 InvalidatorRegistrar registrar_; 46 InvalidatorRegistrar registrar_;
42 std::string unique_id_; 47 std::string unique_id_;
43 std::string state_; 48 std::string state_;
44 std::string email_; 49 std::string email_;
45 std::string token_; 50 std::string token_;
46 ModelTypeSet last_changed_types_; 51 ObjectIdStateMap last_sent_id_state_map_;
47 }; 52 };
48 53
49 } // namespace syncer 54 } // namespace syncer
50 55
51 #endif // SYNC_NOTIFIER_FAKE_INVALIDATOR_H_ 56 #endif // SYNC_NOTIFIER_FAKE_INVALIDATOR_H_
OLDNEW
« no previous file with comments | « sync/internal_api/sync_manager_impl.cc ('k') | sync/notifier/fake_invalidator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698