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/invalidation_notifier.h" | 5 #include "sync/notifier/invalidation_notifier.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "jingle/notifier/base/fake_base_task.h" | 9 #include "jingle/notifier/base/fake_base_task.h" |
10 #include "jingle/notifier/base/notifier_options.h" | 10 #include "jingle/notifier/base/notifier_options.h" |
11 #include "jingle/notifier/listener/fake_push_client.h" | 11 #include "jingle/notifier/listener/fake_push_client.h" |
12 #include "net/url_request/url_request_test_util.h" | 12 #include "net/url_request/url_request_test_util.h" |
13 #include "sync/internal_api/public/base/model_type.h" | 13 #include "sync/internal_api/public/base/model_type.h" |
14 #include "sync/internal_api/public/base/model_type_state_map.h" | 14 #include "sync/internal_api/public/base/model_type_invalidation_map.h" |
15 #include "sync/internal_api/public/util/weak_handle.h" | 15 #include "sync/internal_api/public/util/weak_handle.h" |
16 #include "sync/notifier/fake_invalidation_handler.h" | 16 #include "sync/notifier/fake_invalidation_handler.h" |
17 #include "sync/notifier/fake_invalidation_state_tracker.h" | 17 #include "sync/notifier/fake_invalidation_state_tracker.h" |
18 #include "sync/notifier/invalidation_state_tracker.h" | 18 #include "sync/notifier/invalidation_state_tracker.h" |
19 #include "sync/notifier/invalidator_test_template.h" | 19 #include "sync/notifier/invalidator_test_template.h" |
20 #include "sync/notifier/object_id_state_map_test_util.h" | 20 #include "sync/notifier/object_id_invalidation_map_test_util.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 | 22 |
23 namespace syncer { | 23 namespace syncer { |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 class InvalidationNotifierTestDelegate { | 27 class InvalidationNotifierTestDelegate { |
28 public: | 28 public: |
29 InvalidationNotifierTestDelegate() {} | 29 InvalidationNotifierTestDelegate() {} |
30 | 30 |
(...skipping 30 matching lines...) Expand all Loading... |
61 } | 61 } |
62 | 62 |
63 void WaitForInvalidator() { | 63 void WaitForInvalidator() { |
64 message_loop_.RunAllPending(); | 64 message_loop_.RunAllPending(); |
65 } | 65 } |
66 | 66 |
67 void TriggerOnInvalidatorStateChange(InvalidatorState state) { | 67 void TriggerOnInvalidatorStateChange(InvalidatorState state) { |
68 invalidator_->OnInvalidatorStateChange(state); | 68 invalidator_->OnInvalidatorStateChange(state); |
69 } | 69 } |
70 | 70 |
71 void TriggerOnIncomingInvalidation(const ObjectIdStateMap& id_state_map, | 71 void TriggerOnIncomingInvalidation( |
72 IncomingInvalidationSource source) { | 72 const ObjectIdInvalidationMap& invalidation_map, |
| 73 IncomingInvalidationSource source) { |
73 // None of the tests actually care about |source|. | 74 // None of the tests actually care about |source|. |
74 invalidator_->OnInvalidate(id_state_map); | 75 invalidator_->OnInvalidate(invalidation_map); |
75 } | 76 } |
76 | 77 |
77 static bool InvalidatorHandlesDeprecatedState() { | 78 static bool InvalidatorHandlesDeprecatedState() { |
78 return true; | 79 return true; |
79 } | 80 } |
80 | 81 |
81 private: | 82 private: |
82 MessageLoop message_loop_; | 83 MessageLoop message_loop_; |
83 scoped_ptr<InvalidationNotifier> invalidator_; | 84 scoped_ptr<InvalidationNotifier> invalidator_; |
84 }; | 85 }; |
85 | 86 |
86 INSTANTIATE_TYPED_TEST_CASE_P( | 87 INSTANTIATE_TYPED_TEST_CASE_P( |
87 InvalidationNotifierTest, InvalidatorTest, | 88 InvalidationNotifierTest, InvalidatorTest, |
88 InvalidationNotifierTestDelegate); | 89 InvalidationNotifierTestDelegate); |
89 | 90 |
90 } // namespace | 91 } // namespace |
91 | 92 |
92 } // namespace syncer | 93 } // namespace syncer |
OLD | NEW |