OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 #ifndef CC_TEST_SCHEDULER_TEST_COMMON_H_ | 5 #ifndef CC_TEST_SCHEDULER_TEST_COMMON_H_ |
6 #define CC_TEST_SCHEDULER_TEST_COMMON_H_ | 6 #define CC_TEST_SCHEDULER_TEST_COMMON_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 }; | 157 }; |
158 | 158 |
159 class TestScheduler : public Scheduler { | 159 class TestScheduler : public Scheduler { |
160 public: | 160 public: |
161 static scoped_ptr<TestScheduler> Create( | 161 static scoped_ptr<TestScheduler> Create( |
162 scoped_refptr<TestNowSource> now_src, | 162 scoped_refptr<TestNowSource> now_src, |
163 SchedulerClient* client, | 163 SchedulerClient* client, |
164 const SchedulerSettings& scheduler_settings, | 164 const SchedulerSettings& scheduler_settings, |
165 int layer_tree_host_id, | 165 int layer_tree_host_id, |
166 const scoped_refptr<OrderedSimpleTaskRunner>& task_runner, | 166 const scoped_refptr<OrderedSimpleTaskRunner>& task_runner, |
167 base::PowerMonitor* power_monitor, | |
168 scoped_ptr<BeginFrameSource> external_begin_frame_source) { | 167 scoped_ptr<BeginFrameSource> external_begin_frame_source) { |
169 TestSchedulerFrameSourcesConstructor frame_sources_constructor( | 168 TestSchedulerFrameSourcesConstructor frame_sources_constructor( |
170 task_runner.get(), now_src.get()); | 169 task_runner.get(), now_src.get()); |
171 return make_scoped_ptr(new TestScheduler( | 170 return make_scoped_ptr(new TestScheduler( |
172 now_src, | 171 now_src, |
173 client, | 172 client, |
174 scheduler_settings, | 173 scheduler_settings, |
175 layer_tree_host_id, | 174 layer_tree_host_id, |
176 task_runner, | 175 task_runner, |
177 power_monitor, | |
178 &frame_sources_constructor, | 176 &frame_sources_constructor, |
179 external_begin_frame_source.Pass())); | 177 external_begin_frame_source.Pass())); |
180 } | 178 } |
181 | 179 |
182 // Extra test helper functionality | 180 // Extra test helper functionality |
183 bool IsBeginRetroFrameArgsEmpty() const { | 181 bool IsBeginRetroFrameArgsEmpty() const { |
184 return begin_retro_frame_args_.empty(); | 182 return begin_retro_frame_args_.empty(); |
185 } | 183 } |
186 | 184 |
187 bool CanStart() const { return state_machine_.CanStartForTesting(); } | 185 bool CanStart() const { return state_machine_.CanStartForTesting(); } |
(...skipping 14 matching lines...) Expand all Loading... |
202 // Overridden from Scheduler. | 200 // Overridden from Scheduler. |
203 base::TimeTicks Now() const override; | 201 base::TimeTicks Now() const override; |
204 | 202 |
205 private: | 203 private: |
206 TestScheduler( | 204 TestScheduler( |
207 scoped_refptr<TestNowSource> now_src, | 205 scoped_refptr<TestNowSource> now_src, |
208 SchedulerClient* client, | 206 SchedulerClient* client, |
209 const SchedulerSettings& scheduler_settings, | 207 const SchedulerSettings& scheduler_settings, |
210 int layer_tree_host_id, | 208 int layer_tree_host_id, |
211 const scoped_refptr<OrderedSimpleTaskRunner>& test_task_runner, | 209 const scoped_refptr<OrderedSimpleTaskRunner>& test_task_runner, |
212 base::PowerMonitor* power_monitor, | |
213 TestSchedulerFrameSourcesConstructor* frame_sources_constructor, | 210 TestSchedulerFrameSourcesConstructor* frame_sources_constructor, |
214 scoped_ptr<BeginFrameSource> external_begin_frame_source); | 211 scoped_ptr<BeginFrameSource> external_begin_frame_source); |
215 | 212 |
216 scoped_refptr<TestNowSource> now_src_; | 213 scoped_refptr<TestNowSource> now_src_; |
217 }; | 214 }; |
218 | 215 |
219 } // namespace cc | 216 } // namespace cc |
220 | 217 |
221 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_ | 218 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_ |
OLD | NEW |