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/p2p_invalidator.h" | 5 #include "components/invalidation/p2p_invalidator.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 | 8 |
9 #include "components/invalidation/fake_invalidation_handler.h" | 9 #include "components/invalidation/fake_invalidation_handler.h" |
10 #include "components/invalidation/invalidator_state.h" | 10 #include "components/invalidation/invalidator_state.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 P2PInvalidatorTest() | 86 P2PInvalidatorTest() |
87 : next_sent_notification_to_reflect_(0) { | 87 : next_sent_notification_to_reflect_(0) { |
88 default_enabled_ids_.insert(invalidation::ObjectId(10, "A")); | 88 default_enabled_ids_.insert(invalidation::ObjectId(10, "A")); |
89 default_enabled_ids_.insert(invalidation::ObjectId(10, "B")); | 89 default_enabled_ids_.insert(invalidation::ObjectId(10, "B")); |
90 delegate_.CreateInvalidator("sender", | 90 delegate_.CreateInvalidator("sender", |
91 "fake_state", | 91 "fake_state", |
92 base::WeakPtr<InvalidationStateTracker>()); | 92 base::WeakPtr<InvalidationStateTracker>()); |
93 delegate_.GetInvalidator()->RegisterHandler(&fake_handler_); | 93 delegate_.GetInvalidator()->RegisterHandler(&fake_handler_); |
94 } | 94 } |
95 | 95 |
96 virtual ~P2PInvalidatorTest() { | 96 ~P2PInvalidatorTest() override { |
97 delegate_.GetInvalidator()->UnregisterHandler(&fake_handler_); | 97 delegate_.GetInvalidator()->UnregisterHandler(&fake_handler_); |
98 } | 98 } |
99 | 99 |
100 ObjectIdInvalidationMap MakeInvalidationMap(ObjectIdSet ids) { | 100 ObjectIdInvalidationMap MakeInvalidationMap(ObjectIdSet ids) { |
101 return ObjectIdInvalidationMap::InvalidateAll(ids); | 101 return ObjectIdInvalidationMap::InvalidateAll(ids); |
102 } | 102 } |
103 | 103 |
104 // Simulate receiving all the notifications we sent out since last | 104 // Simulate receiving all the notifications we sent out since last |
105 // time this was called. | 105 // time this was called. |
106 void ReflectSentNotifications() { | 106 void ReflectSentNotifications() { |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 EXPECT_EQ(5, fake_handler_.GetInvalidationCount()); | 349 EXPECT_EQ(5, fake_handler_.GetInvalidationCount()); |
350 } | 350 } |
351 | 351 |
352 INSTANTIATE_TYPED_TEST_CASE_P( | 352 INSTANTIATE_TYPED_TEST_CASE_P( |
353 P2PInvalidatorTest, InvalidatorTest, | 353 P2PInvalidatorTest, InvalidatorTest, |
354 P2PInvalidatorTestDelegate); | 354 P2PInvalidatorTestDelegate); |
355 | 355 |
356 } // namespace | 356 } // namespace |
357 | 357 |
358 } // namespace syncer | 358 } // namespace syncer |
OLD | NEW |