OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/invalidation/registration_manager.h" | 5 #include "components/invalidation/registration_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <cstddef> | 9 #include <cstddef> |
10 #include <deque> | 10 #include <deque> |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 141 } |
142 } | 142 } |
143 EXPECT_EQ(expected_pending_ids, pending_ids); | 143 EXPECT_EQ(expected_pending_ids, pending_ids); |
144 } | 144 } |
145 | 145 |
146 class RegistrationManagerTest : public testing::Test { | 146 class RegistrationManagerTest : public testing::Test { |
147 protected: | 147 protected: |
148 RegistrationManagerTest() | 148 RegistrationManagerTest() |
149 : fake_registration_manager_(&fake_invalidation_client_) {} | 149 : fake_registration_manager_(&fake_invalidation_client_) {} |
150 | 150 |
151 virtual ~RegistrationManagerTest() {} | 151 ~RegistrationManagerTest() override {} |
152 | 152 |
153 void LoseRegistrations(const ObjectIdSet& oids) { | 153 void LoseRegistrations(const ObjectIdSet& oids) { |
154 for (ObjectIdSet::const_iterator it = oids.begin(); it != oids.end(); | 154 for (ObjectIdSet::const_iterator it = oids.begin(); it != oids.end(); |
155 ++it) { | 155 ++it) { |
156 fake_invalidation_client_.LoseRegistration(*it); | 156 fake_invalidation_client_.LoseRegistration(*it); |
157 fake_registration_manager_.MarkRegistrationLost(*it); | 157 fake_registration_manager_.MarkRegistrationLost(*it); |
158 } | 158 } |
159 } | 159 } |
160 | 160 |
161 void DisableIds(const ObjectIdSet& oids) { | 161 void DisableIds(const ObjectIdSet& oids) { |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 fake_registration_manager_.GetPendingRegistrationsForTest()); | 420 fake_registration_manager_.GetPendingRegistrationsForTest()); |
421 | 421 |
422 fake_registration_manager_.MarkAllRegistrationsLost(); | 422 fake_registration_manager_.MarkAllRegistrationsLost(); |
423 ExpectPendingRegistrations( | 423 ExpectPendingRegistrations( |
424 enabled_ids, 0.0, | 424 enabled_ids, 0.0, |
425 fake_registration_manager_.GetPendingRegistrationsForTest()); | 425 fake_registration_manager_.GetPendingRegistrationsForTest()); |
426 } | 426 } |
427 | 427 |
428 } // namespace | 428 } // namespace |
429 } // namespace syncer | 429 } // namespace syncer |
OLD | NEW |