| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 DISALLOW_COPY_AND_ASSIGN(TestSyntheticBeginFrameSource); | 159 DISALLOW_COPY_AND_ASSIGN(TestSyntheticBeginFrameSource); |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 class TestScheduler : public Scheduler { | 162 class TestScheduler : public Scheduler { |
| 163 public: | 163 public: |
| 164 static scoped_ptr<TestScheduler> Create( | 164 static scoped_ptr<TestScheduler> Create( |
| 165 base::SimpleTestTickClock* now_src, | 165 base::SimpleTestTickClock* now_src, |
| 166 SchedulerClient* client, | 166 SchedulerClient* client, |
| 167 const SchedulerSettings& scheduler_settings, | 167 const SchedulerSettings& scheduler_settings, |
| 168 int layer_tree_host_id, | 168 int layer_tree_host_id, |
| 169 const scoped_refptr<OrderedSimpleTaskRunner>& task_runner, | 169 OrderedSimpleTaskRunner* task_runner, |
| 170 BeginFrameSource* external_frame_source); | 170 BeginFrameSource* external_frame_source); |
| 171 | 171 |
| 172 // Extra test helper functionality | 172 // Extra test helper functionality |
| 173 bool IsBeginRetroFrameArgsEmpty() const { | 173 bool IsBeginRetroFrameArgsEmpty() const { |
| 174 return begin_retro_frame_args_.empty(); | 174 return begin_retro_frame_args_.empty(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 bool CanStart() const { return state_machine_.CanStartForTesting(); } | 177 bool CanStart() const { return state_machine_.CanStartForTesting(); } |
| 178 | 178 |
| 179 BeginFrameSource& frame_source() { return *frame_source_; } | 179 BeginFrameSource& frame_source() { return *frame_source_; } |
| 180 bool FrameProductionThrottled() { return throttle_frame_production_; } | 180 bool FrameProductionThrottled() { return throttle_frame_production_; } |
| 181 | 181 |
| 182 ~TestScheduler() override; | 182 ~TestScheduler() override; |
| 183 | 183 |
| 184 base::TimeDelta BeginImplFrameInterval() { | 184 base::TimeDelta BeginImplFrameInterval() { |
| 185 return begin_impl_frame_tracker_.Interval(); | 185 return begin_impl_frame_tracker_.Interval(); |
| 186 } | 186 } |
| 187 | 187 |
| 188 protected: | 188 protected: |
| 189 // Overridden from Scheduler. | 189 // Overridden from Scheduler. |
| 190 base::TimeTicks Now() const override; | 190 base::TimeTicks Now() const override; |
| 191 | 191 |
| 192 private: | 192 private: |
| 193 TestScheduler( | 193 TestScheduler( |
| 194 base::SimpleTestTickClock* now_src, | 194 base::SimpleTestTickClock* now_src, |
| 195 SchedulerClient* client, | 195 SchedulerClient* client, |
| 196 const SchedulerSettings& scheduler_settings, | 196 const SchedulerSettings& scheduler_settings, |
| 197 int layer_tree_host_id, | 197 int layer_tree_host_id, |
| 198 const scoped_refptr<OrderedSimpleTaskRunner>& task_runner, | 198 OrderedSimpleTaskRunner* task_runner, |
| 199 BeginFrameSource* external_frame_source, | 199 BeginFrameSource* external_frame_source, |
| 200 scoped_ptr<TestSyntheticBeginFrameSource> synthetic_frame_source, | 200 scoped_ptr<TestSyntheticBeginFrameSource> synthetic_frame_source, |
| 201 scoped_ptr<TestBackToBackBeginFrameSource> unthrottled_frame_source); | 201 scoped_ptr<TestBackToBackBeginFrameSource> unthrottled_frame_source); |
| 202 | 202 |
| 203 // Not owned. | 203 // Not owned. |
| 204 base::SimpleTestTickClock* now_src_; | 204 base::SimpleTestTickClock* now_src_; |
| 205 | 205 |
| 206 DISALLOW_COPY_AND_ASSIGN(TestScheduler); | 206 DISALLOW_COPY_AND_ASSIGN(TestScheduler); |
| 207 }; | 207 }; |
| 208 | 208 |
| 209 } // namespace cc | 209 } // namespace cc |
| 210 | 210 |
| 211 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_ | 211 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_ |
| OLD | NEW |