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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "google/cacheinvalidation/types.pb.h" | 8 #include "google/cacheinvalidation/types.pb.h" |
9 #include "sync/notifier/fake_invalidation_handler.h" | 9 #include "sync/notifier/fake_invalidation_handler.h" |
10 #include "sync/notifier/invalidator_registrar.h" | 10 #include "sync/notifier/invalidator_registrar.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 void WaitForInvalidator() { | 94 void WaitForInvalidator() { |
95 // Do nothing. | 95 // Do nothing. |
96 } | 96 } |
97 | 97 |
98 void TriggerOnInvalidatorStateChange(InvalidatorState state) { | 98 void TriggerOnInvalidatorStateChange(InvalidatorState state) { |
99 invalidator_->GetRegistrar()->UpdateInvalidatorState(state); | 99 invalidator_->GetRegistrar()->UpdateInvalidatorState(state); |
100 } | 100 } |
101 | 101 |
102 void TriggerOnIncomingInvalidation( | 102 void TriggerOnIncomingInvalidation( |
103 const ObjectIdInvalidationMap& invalidation_map, | 103 const ObjectIdInvalidationMap& invalidation_map) { |
104 IncomingInvalidationSource source) { | |
105 invalidator_->GetRegistrar()->DispatchInvalidationsToHandlers( | 104 invalidator_->GetRegistrar()->DispatchInvalidationsToHandlers( |
106 invalidation_map, source); | 105 invalidation_map); |
107 } | 106 } |
108 | 107 |
109 private: | 108 private: |
110 scoped_ptr<RegistrarInvalidator> invalidator_; | 109 scoped_ptr<RegistrarInvalidator> invalidator_; |
111 }; | 110 }; |
112 | 111 |
113 INSTANTIATE_TYPED_TEST_CASE_P( | 112 INSTANTIATE_TYPED_TEST_CASE_P( |
114 RegistrarInvalidatorTest, InvalidatorTest, | 113 RegistrarInvalidatorTest, InvalidatorTest, |
115 RegistrarInvalidatorTestDelegate); | 114 RegistrarInvalidatorTestDelegate); |
116 | 115 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 EXPECT_DEATH({ registrar.UpdateRegisteredIds(&handler2, ids); }, ""); | 158 EXPECT_DEATH({ registrar.UpdateRegisteredIds(&handler2, ids); }, ""); |
160 | 159 |
161 registrar.UnregisterHandler(&handler2); | 160 registrar.UnregisterHandler(&handler2); |
162 registrar.UnregisterHandler(&handler1); | 161 registrar.UnregisterHandler(&handler1); |
163 } | 162 } |
164 #endif // GTEST_HAS_DEATH_TEST | 163 #endif // GTEST_HAS_DEATH_TEST |
165 | 164 |
166 } // namespace | 165 } // namespace |
167 | 166 |
168 } // namespace syncer | 167 } // namespace syncer |
OLD | NEW |