Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: cc/test/scheduler_test_common.h

Issue 2150533004: cc: Send all begin frames using a PostTask. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scheduler_unittest_no_deadline
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 20 matching lines...) Expand all
31 // DelayBasedTimeSourceClient implementation. 31 // DelayBasedTimeSourceClient implementation.
32 void OnTimerTick() override; 32 void OnTimerTick() override;
33 33
34 protected: 34 protected:
35 bool tick_called_; 35 bool tick_called_;
36 36
37 private: 37 private:
38 DISALLOW_COPY_AND_ASSIGN(FakeDelayBasedTimeSourceClient); 38 DISALLOW_COPY_AND_ASSIGN(FakeDelayBasedTimeSourceClient);
39 }; 39 };
40 40
41 class FakeDelayBasedTimeSource : public DelayBasedTimeSource {
42 public:
43 explicit FakeDelayBasedTimeSource(base::SingleThreadTaskRunner* task_runner)
44 : DelayBasedTimeSource(task_runner) {}
45 ~FakeDelayBasedTimeSource() override {}
46
47 void SetNow(base::TimeTicks time) { now_ = time; }
48 base::TimeTicks Now() const override;
49
50 protected:
51 base::TimeTicks now_;
52
53 private:
54 DISALLOW_COPY_AND_ASSIGN(FakeDelayBasedTimeSource);
55 };
56
57 class TestDelayBasedTimeSource : public DelayBasedTimeSource {
58 public:
59 TestDelayBasedTimeSource(base::SimpleTestTickClock* now_src,
60 OrderedSimpleTaskRunner* task_runner);
61 ~TestDelayBasedTimeSource() override;
62
63 protected:
64 // Overridden from DelayBasedTimeSource
65 base::TimeTicks Now() const override;
66 std::string TypeString() const override;
67
68 // Not owned.
69 base::SimpleTestTickClock* now_src_;
70
71 private:
72 DISALLOW_COPY_AND_ASSIGN(TestDelayBasedTimeSource);
73 };
74
75 class FakeCompositorTimingHistory : public CompositorTimingHistory { 41 class FakeCompositorTimingHistory : public CompositorTimingHistory {
76 public: 42 public:
77 static std::unique_ptr<FakeCompositorTimingHistory> Create( 43 static std::unique_ptr<FakeCompositorTimingHistory> Create(
78 bool using_synchronous_renderer_compositor); 44 bool using_synchronous_renderer_compositor);
79 ~FakeCompositorTimingHistory() override; 45 ~FakeCompositorTimingHistory() override;
80 46
81 void SetAllEstimatesTo(base::TimeDelta duration); 47 void SetAllEstimatesTo(base::TimeDelta duration);
82 48
83 void SetBeginMainFrameQueueDurationCriticalEstimate(base::TimeDelta duration); 49 void SetBeginMainFrameQueueDurationCriticalEstimate(base::TimeDelta duration);
84 void SetBeginMainFrameQueueDurationNotCriticalEstimate( 50 void SetBeginMainFrameQueueDurationNotCriticalEstimate(
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 136
171 private: 137 private:
172 base::SimpleTestTickClock* now_src_; 138 base::SimpleTestTickClock* now_src_;
173 139
174 DISALLOW_COPY_AND_ASSIGN(TestScheduler); 140 DISALLOW_COPY_AND_ASSIGN(TestScheduler);
175 }; 141 };
176 142
177 } // namespace cc 143 } // namespace cc
178 144
179 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_ 145 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698