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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "cc/output/begin_frame_args.h" |
11 #include "cc/scheduler/delay_based_time_source.h" | 12 #include "cc/scheduler/delay_based_time_source.h" |
| 13 #include "cc/scheduler/draw_swap_readback_result.h" |
| 14 #include "cc/scheduler/scheduler.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
13 | 16 |
14 namespace cc { | 17 namespace cc { |
15 | 18 |
16 class FakeTimeSourceClient : public TimeSourceClient { | 19 class FakeTimeSourceClient : public TimeSourceClient { |
17 public: | 20 public: |
18 FakeTimeSourceClient() { Reset(); } | 21 FakeTimeSourceClient() { Reset(); } |
19 void Reset() { tick_called_ = false; } | 22 void Reset() { tick_called_ = false; } |
20 bool TickCalled() const { return tick_called_; } | 23 bool TickCalled() const { return tick_called_; } |
21 | 24 |
(...skipping 17 matching lines...) Expand all Loading... |
39 | 42 |
40 protected: | 43 protected: |
41 FakeDelayBasedTimeSource(base::TimeDelta interval, | 44 FakeDelayBasedTimeSource(base::TimeDelta interval, |
42 base::SingleThreadTaskRunner* task_runner) | 45 base::SingleThreadTaskRunner* task_runner) |
43 : DelayBasedTimeSource(interval, task_runner) {} | 46 : DelayBasedTimeSource(interval, task_runner) {} |
44 virtual ~FakeDelayBasedTimeSource() {} | 47 virtual ~FakeDelayBasedTimeSource() {} |
45 | 48 |
46 base::TimeTicks now_; | 49 base::TimeTicks now_; |
47 }; | 50 }; |
48 | 51 |
| 52 // SchedulerClient which does minimal possible to satisfy the interface. |
| 53 class StubSchedulerClient : public SchedulerClient { |
| 54 public: |
| 55 virtual void WillBeginImplFrame(const BeginFrameArgs& args) OVERRIDE {} |
| 56 virtual void ScheduledActionSendBeginMainFrame() OVERRIDE {} |
| 57 virtual DrawSwapReadbackResult ScheduledActionDrawAndSwapIfPossible() |
| 58 OVERRIDE; |
| 59 virtual DrawSwapReadbackResult ScheduledActionDrawAndSwapForced() OVERRIDE; |
| 60 virtual DrawSwapReadbackResult ScheduledActionDrawAndReadback() OVERRIDE; |
| 61 virtual void ScheduledActionAnimate() OVERRIDE {} |
| 62 virtual void ScheduledActionCommit() OVERRIDE {} |
| 63 virtual void ScheduledActionUpdateVisibleTiles() OVERRIDE {} |
| 64 virtual void ScheduledActionActivatePendingTree() OVERRIDE {} |
| 65 virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE {} |
| 66 virtual void ScheduledActionManageTiles() OVERRIDE {} |
| 67 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) OVERRIDE {} |
| 68 virtual base::TimeDelta DrawDurationEstimate() OVERRIDE; |
| 69 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() OVERRIDE; |
| 70 virtual base::TimeDelta CommitToActivateDurationEstimate() OVERRIDE; |
| 71 virtual void DidBeginImplFrameDeadline() OVERRIDE {} |
| 72 |
| 73 protected: |
| 74 virtual ~StubSchedulerClient() {} |
| 75 }; |
| 76 |
49 } // namespace cc | 77 } // namespace cc |
50 | 78 |
51 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_ | 79 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_ |
OLD | NEW |