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/impl/invalidation_notifier.h" | 5 #include "components/invalidation/impl/invalidation_notifier.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "base/test/scoped_task_environment.h" |
11 #include "base/threading/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
12 #include "components/invalidation/impl/fake_invalidation_handler.h" | 13 #include "components/invalidation/impl/fake_invalidation_handler.h" |
13 #include "components/invalidation/impl/fake_invalidation_state_tracker.h" | 14 #include "components/invalidation/impl/fake_invalidation_state_tracker.h" |
14 #include "components/invalidation/impl/invalidation_state_tracker.h" | 15 #include "components/invalidation/impl/invalidation_state_tracker.h" |
15 #include "components/invalidation/impl/invalidator_test_template.h" | 16 #include "components/invalidation/impl/invalidator_test_template.h" |
16 #include "components/invalidation/impl/push_client_channel.h" | 17 #include "components/invalidation/impl/push_client_channel.h" |
17 #include "jingle/notifier/base/fake_base_task.h" | 18 #include "jingle/notifier/base/fake_base_task.h" |
18 #include "jingle/notifier/base/notifier_options.h" | 19 #include "jingle/notifier/base/notifier_options.h" |
19 #include "jingle/notifier/listener/fake_push_client.h" | 20 #include "jingle/notifier/listener/fake_push_client.h" |
20 #include "net/url_request/url_request_test_util.h" | 21 #include "net/url_request/url_request_test_util.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 void TriggerOnInvalidatorStateChange(InvalidatorState state) { | 68 void TriggerOnInvalidatorStateChange(InvalidatorState state) { |
68 invalidator_->OnInvalidatorStateChange(state); | 69 invalidator_->OnInvalidatorStateChange(state); |
69 } | 70 } |
70 | 71 |
71 void TriggerOnIncomingInvalidation( | 72 void TriggerOnIncomingInvalidation( |
72 const ObjectIdInvalidationMap& invalidation_map) { | 73 const ObjectIdInvalidationMap& invalidation_map) { |
73 invalidator_->OnInvalidate(invalidation_map); | 74 invalidator_->OnInvalidate(invalidation_map); |
74 } | 75 } |
75 | 76 |
76 private: | 77 private: |
77 base::MessageLoop message_loop_; | 78 base::test::ScopedTaskEnvironment scoped_task_environment_; |
78 std::unique_ptr<InvalidationNotifier> invalidator_; | 79 std::unique_ptr<InvalidationNotifier> invalidator_; |
79 }; | 80 }; |
80 | 81 |
81 INSTANTIATE_TYPED_TEST_CASE_P( | 82 INSTANTIATE_TYPED_TEST_CASE_P( |
82 InvalidationNotifierTest, InvalidatorTest, | 83 InvalidationNotifierTest, InvalidatorTest, |
83 InvalidationNotifierTestDelegate); | 84 InvalidationNotifierTestDelegate); |
84 | 85 |
85 } // namespace | 86 } // namespace |
86 | 87 |
87 } // namespace syncer | 88 } // namespace syncer |
OLD | NEW |