OLD | NEW |
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 #include "sync/notifier/fake_invalidator.h" | 5 #include "sync/notifier/fake_invalidator.h" |
6 | 6 |
7 namespace syncer { | 7 namespace syncer { |
8 | 8 |
9 FakeInvalidator::FakeInvalidator() {} | 9 FakeInvalidator::FakeInvalidator() {} |
10 | 10 |
11 FakeInvalidator::~FakeInvalidator() {} | 11 FakeInvalidator::~FakeInvalidator() {} |
12 | 12 |
13 bool FakeInvalidator::IsHandlerRegistered(InvalidationHandler* handler) const { | 13 bool FakeInvalidator::IsHandlerRegistered(InvalidationHandler* handler) const { |
14 return registrar_.IsHandlerRegisteredForTest(handler); | 14 return registrar_.IsHandlerRegisteredForTest(handler); |
15 } | 15 } |
16 | 16 |
17 ObjectIdSet FakeInvalidator::GetRegisteredIds( | 17 ObjectIdSet FakeInvalidator::GetRegisteredIds( |
18 InvalidationHandler* handler) const { | 18 InvalidationHandler* handler) const { |
19 return registrar_.GetRegisteredIds(handler); | 19 return registrar_.GetRegisteredIds(handler); |
20 } | 20 } |
21 | 21 |
22 const std::string& FakeInvalidator::GetCredentialsEmail() const { | 22 const std::string& FakeInvalidator::GetCredentialsEmail() const { |
23 return email_; | 23 return email_; |
24 } | 24 } |
25 | 25 |
26 const std::string& FakeInvalidator::GetCredentialsToken() const { | 26 const std::string& FakeInvalidator::GetCredentialsToken() const { |
27 return token_; | 27 return token_; |
28 } | 28 } |
29 | 29 |
| 30 const ObjectIdInvalidationMap& |
| 31 FakeInvalidator::GetLastSentInvalidationMap() const { |
| 32 return last_sent_invalidation_map_; |
| 33 } |
| 34 |
30 void FakeInvalidator::EmitOnInvalidatorStateChange(InvalidatorState state) { | 35 void FakeInvalidator::EmitOnInvalidatorStateChange(InvalidatorState state) { |
31 registrar_.UpdateInvalidatorState(state); | 36 registrar_.UpdateInvalidatorState(state); |
32 } | 37 } |
33 | 38 |
34 void FakeInvalidator::EmitOnIncomingInvalidation( | 39 void FakeInvalidator::EmitOnIncomingInvalidation( |
35 const ObjectIdInvalidationMap& invalidation_map) { | 40 const ObjectIdInvalidationMap& invalidation_map) { |
36 registrar_.DispatchInvalidationsToHandlers(invalidation_map); | 41 registrar_.DispatchInvalidationsToHandlers(invalidation_map); |
37 } | 42 } |
38 | 43 |
39 void FakeInvalidator::RegisterHandler(InvalidationHandler* handler) { | 44 void FakeInvalidator::RegisterHandler(InvalidationHandler* handler) { |
(...skipping 17 matching lines...) Expand all Loading... |
57 InvalidatorState FakeInvalidator::GetInvalidatorState() const { | 62 InvalidatorState FakeInvalidator::GetInvalidatorState() const { |
58 return registrar_.GetInvalidatorState(); | 63 return registrar_.GetInvalidatorState(); |
59 } | 64 } |
60 | 65 |
61 void FakeInvalidator::UpdateCredentials( | 66 void FakeInvalidator::UpdateCredentials( |
62 const std::string& email, const std::string& token) { | 67 const std::string& email, const std::string& token) { |
63 email_ = email; | 68 email_ = email; |
64 token_ = token; | 69 token_ = token; |
65 } | 70 } |
66 | 71 |
| 72 void FakeInvalidator::SendInvalidation( |
| 73 const ObjectIdInvalidationMap& invalidation_map) { |
| 74 last_sent_invalidation_map_ = invalidation_map; |
| 75 } |
| 76 |
67 } // namespace syncer | 77 } // namespace syncer |
OLD | NEW |