Index: cc/test/scheduler_test_common.h |
diff --git a/cc/test/scheduler_test_common.h b/cc/test/scheduler_test_common.h |
index a50233653410836c44189d5d53381dfaf0d6d3b3..8d5bf69a37d686d51b8a836dbc8aa44f162c5a2a 100644 |
--- a/cc/test/scheduler_test_common.h |
+++ b/cc/test/scheduler_test_common.h |
@@ -73,6 +73,47 @@ class TestDelayBasedTimeSource : public DelayBasedTimeSource { |
scoped_refptr<TestNowSource> now_src_; |
}; |
+struct FakeBeginFrameSource : public BeginFrameSource { |
+ bool needs_begin_frames_; |
+ bool remaining_frames_; |
+ |
+ BeginFrameObserver* GetObserver() { return observer_; } |
+ |
+ void TestSendBeginFrame(const BeginFrameArgs& args) { SendBeginFrame(args); } |
+ |
+ // BeginFrameSource |
+ virtual bool NeedsBeginFrames() OVERRIDE; |
+ virtual void SetNeedsBeginFrames(bool needs_begin_frames) OVERRIDE; |
+ virtual void FinishedFrame(size_t remaining_frames) OVERRIDE; |
+ |
+ virtual void AsValueInto(base::debug::TracedValue* dict) const OVERRIDE; |
+ |
+ virtual ~FakeBeginFrameSource() {} |
+}; |
+ |
+class TestSyntheticBeginFrameSource : public SyntheticBeginFrameSource { |
+ public: |
+ static scoped_ptr<TestSyntheticBeginFrameSource> Create( |
+ scoped_refptr<TestNowSource> now_src, |
+ OrderedSimpleTaskRunner* task_runner, |
+ base::TimeDelta initial_interval) { |
+ base::TimeTicks initial_timebase = now_src->Now(); |
+ return make_scoped_ptr(new TestSyntheticBeginFrameSource( |
+ TestDelayBasedTimeSource::Create( |
+ now_src, initial_interval, task_runner), |
+ initial_timebase, |
+ initial_interval)); |
+ } |
+ |
+ protected: |
+ TestSyntheticBeginFrameSource(scoped_refptr<DelayBasedTimeSource> time_source, |
+ base::TimeTicks initial_timebase, |
+ base::TimeDelta initial_interval) |
+ : SyntheticBeginFrameSource(time_source, |
+ initial_timebase, |
+ initial_interval) {} |
+}; |
+ |
class TestScheduler : public Scheduler { |
public: |
static scoped_ptr<TestScheduler> Create( |
@@ -97,16 +138,15 @@ class TestScheduler : public Scheduler { |
return begin_retro_frame_args_.empty(); |
} |
- bool IsSyntheticBeginFrameSourceActive() const { |
- return synthetic_begin_frame_source_->IsActive(); |
- } |
- |
+ BeginFrameSource& frame_source() { return *frame_source_; } |
OrderedSimpleTaskRunner& task_runner() { return *test_task_runner_; } |
virtual ~TestScheduler(); |
protected: |
// Overridden from Scheduler. |
+ virtual void SetUpBackgroundFrameSource() OVERRIDE; |
+ virtual void SetUpPrimaryFrameSource() OVERRIDE; |
virtual base::TimeTicks Now() const OVERRIDE; |
private: |