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

Unified Diff: cc/test/scheduler_test_common.h

Issue 1132753008: Replaced TestNowSource with SimpleTestTickClock. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased again. Replaces TimeSource with TickClock in TestAlwaysFailTimeSource Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: cc/test/scheduler_test_common.h
diff --git a/cc/test/scheduler_test_common.h b/cc/test/scheduler_test_common.h
index a2982ee5fdaedb8ea8faafea30765337bfcd202b..b3e88113b8e86266da2d7bb001b5c2b726aaea30 100644
--- a/cc/test/scheduler_test_common.h
+++ b/cc/test/scheduler_test_common.h
@@ -53,7 +53,7 @@ class FakeDelayBasedTimeSource : public DelayBasedTimeSource {
class TestDelayBasedTimeSource : public DelayBasedTimeSource {
public:
static scoped_refptr<TestDelayBasedTimeSource> Create(
- scoped_refptr<TestNowSource> now_src,
+ base::SimpleTestTickClock* now_src,
base::TimeDelta interval,
OrderedSimpleTaskRunner* task_runner) {
return make_scoped_refptr(
@@ -61,7 +61,7 @@ class TestDelayBasedTimeSource : public DelayBasedTimeSource {
}
protected:
- TestDelayBasedTimeSource(scoped_refptr<TestNowSource> now_src,
+ TestDelayBasedTimeSource(base::SimpleTestTickClock* now_src,
base::TimeDelta interval,
OrderedSimpleTaskRunner* task_runner);
@@ -70,7 +70,7 @@ class TestDelayBasedTimeSource : public DelayBasedTimeSource {
base::TimeTicks Now() const override;
std::string TypeString() const override;
- scoped_refptr<TestNowSource> now_src_;
+ base::SimpleTestTickClock* now_src_;
Sami 2015/06/05 17:11:07 In general it would be good to document ownership
Ankur Verma 2015/06/08 07:11:34 Done.
};
struct FakeBeginFrameSource : public BeginFrameSourceMixIn {
@@ -100,19 +100,19 @@ class TestBackToBackBeginFrameSource : public BackToBackBeginFrameSource {
~TestBackToBackBeginFrameSource() override;
static scoped_ptr<TestBackToBackBeginFrameSource> Create(
- scoped_refptr<TestNowSource> now_src,
+ base::SimpleTestTickClock* now_src,
base::SingleThreadTaskRunner* task_runner) {
return make_scoped_ptr(
new TestBackToBackBeginFrameSource(now_src, task_runner));
}
protected:
- TestBackToBackBeginFrameSource(scoped_refptr<TestNowSource> now_src,
+ TestBackToBackBeginFrameSource(base::SimpleTestTickClock* now_src,
base::SingleThreadTaskRunner* task_runner);
base::TimeTicks Now() override;
- scoped_refptr<TestNowSource> now_src_;
+ base::SimpleTestTickClock* now_src_;
};
class TestSyntheticBeginFrameSource : public SyntheticBeginFrameSource {
@@ -120,7 +120,7 @@ class TestSyntheticBeginFrameSource : public SyntheticBeginFrameSource {
~TestSyntheticBeginFrameSource() override;
static scoped_ptr<TestSyntheticBeginFrameSource> Create(
- scoped_refptr<TestNowSource> now_src,
+ base::SimpleTestTickClock* now_src,
OrderedSimpleTaskRunner* task_runner,
base::TimeDelta initial_interval) {
return make_scoped_ptr(
@@ -145,26 +145,26 @@ class TestSchedulerFrameSourcesConstructor
Scheduler* scheduler) override;
OrderedSimpleTaskRunner* test_task_runner_;
- TestNowSource* now_src_;
+ base::SimpleTestTickClock* now_src_;
protected:
explicit TestSchedulerFrameSourcesConstructor(
OrderedSimpleTaskRunner* test_task_runner,
- TestNowSource* now_src);
+ base::SimpleTestTickClock* now_src);
friend class TestScheduler;
};
class TestScheduler : public Scheduler {
public:
static scoped_ptr<TestScheduler> Create(
- scoped_refptr<TestNowSource> now_src,
+ base::SimpleTestTickClock* now_src,
SchedulerClient* client,
const SchedulerSettings& scheduler_settings,
int layer_tree_host_id,
const scoped_refptr<OrderedSimpleTaskRunner>& task_runner,
scoped_ptr<BeginFrameSource> external_begin_frame_source) {
TestSchedulerFrameSourcesConstructor frame_sources_constructor(
- task_runner.get(), now_src.get());
+ task_runner.get(), now_src);
return make_scoped_ptr(new TestScheduler(
now_src,
client,
@@ -203,16 +203,15 @@ class TestScheduler : public Scheduler {
base::TimeTicks Now() const override;
private:
- TestScheduler(
- scoped_refptr<TestNowSource> now_src,
- SchedulerClient* client,
- const SchedulerSettings& scheduler_settings,
- int layer_tree_host_id,
- const scoped_refptr<OrderedSimpleTaskRunner>& test_task_runner,
- TestSchedulerFrameSourcesConstructor* frame_sources_constructor,
- scoped_ptr<BeginFrameSource> external_begin_frame_source);
-
- scoped_refptr<TestNowSource> now_src_;
+ TestScheduler(base::SimpleTestTickClock* now_src,
+ SchedulerClient* client,
+ const SchedulerSettings& scheduler_settings,
+ int layer_tree_host_id,
+ const scoped_refptr<OrderedSimpleTaskRunner>& test_task_runner,
+ TestSchedulerFrameSourcesConstructor* frame_sources_constructor,
+ scoped_ptr<BeginFrameSource> external_begin_frame_source);
+
+ base::SimpleTestTickClock* now_src_;
};
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698