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

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

Issue 1200113003: cc: Cleanup DelayBasedTimeSource code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@task_runner_refptr
Patch Set: mithro's review Created 5 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
« no previous file with comments | « cc/scheduler/delay_based_time_source_unittest.cc ('k') | cc/test/scheduler_test_common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "cc/scheduler/compositor_timing_history.h" 13 #include "cc/scheduler/compositor_timing_history.h"
14 #include "cc/scheduler/scheduler.h" 14 #include "cc/scheduler/scheduler.h"
15 #include "cc/test/ordered_simple_task_runner.h" 15 #include "cc/test/ordered_simple_task_runner.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 17
18 namespace cc { 18 namespace cc {
19 19
20 class RenderingStatsInstrumentation; 20 class RenderingStatsInstrumentation;
21 21
22 class FakeTimeSourceClient : public TimeSourceClient { 22 class FakeDelayBasedTimeSourceClient : public DelayBasedTimeSourceClient {
23 public: 23 public:
24 FakeTimeSourceClient() : tick_called_(false) {} 24 FakeDelayBasedTimeSourceClient() : tick_called_(false) {}
25 void Reset() { tick_called_ = false; } 25 void Reset() { tick_called_ = false; }
26 bool TickCalled() const { return tick_called_; } 26 bool TickCalled() const { return tick_called_; }
27 27
28 // TimeSourceClient implementation. 28 // DelayBasedTimeSourceClient implementation.
29 void OnTimerTick() override; 29 void OnTimerTick() override;
30 30
31 protected: 31 protected:
32 bool tick_called_; 32 bool tick_called_;
33 33
34 private: 34 private:
35 DISALLOW_COPY_AND_ASSIGN(FakeTimeSourceClient); 35 DISALLOW_COPY_AND_ASSIGN(FakeDelayBasedTimeSourceClient);
36 }; 36 };
37 37
38 class FakeDelayBasedTimeSource : public DelayBasedTimeSource { 38 class FakeDelayBasedTimeSource : public DelayBasedTimeSource {
39 public: 39 public:
40 static scoped_ptr<FakeDelayBasedTimeSource> Create( 40 static scoped_ptr<FakeDelayBasedTimeSource> Create(
41 base::TimeDelta interval, 41 base::TimeDelta interval,
42 base::SingleThreadTaskRunner* task_runner) { 42 base::SingleThreadTaskRunner* task_runner) {
43 return make_scoped_ptr(new FakeDelayBasedTimeSource(interval, task_runner)); 43 return make_scoped_ptr(new FakeDelayBasedTimeSource(interval, task_runner));
44 } 44 }
45 45
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 scoped_ptr<CompositorTimingHistory> compositor_timing_history); 233 scoped_ptr<CompositorTimingHistory> compositor_timing_history);
234 234
235 base::SimpleTestTickClock* now_src_; 235 base::SimpleTestTickClock* now_src_;
236 236
237 DISALLOW_COPY_AND_ASSIGN(TestScheduler); 237 DISALLOW_COPY_AND_ASSIGN(TestScheduler);
238 }; 238 };
239 239
240 } // namespace cc 240 } // namespace cc
241 241
242 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_ 242 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_
OLDNEW
« no previous file with comments | « cc/scheduler/delay_based_time_source_unittest.cc ('k') | cc/test/scheduler_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698