| Index: cc/test/scheduler_test_common.cc
|
| diff --git a/cc/test/scheduler_test_common.cc b/cc/test/scheduler_test_common.cc
|
| index 3b35a54a9b713423dd91c55b428dc6997937f01c..1c1d9fda26d7db65b183e2819dda68e659e5e489 100644
|
| --- a/cc/test/scheduler_test_common.cc
|
| +++ b/cc/test/scheduler_test_common.cc
|
| @@ -4,6 +4,8 @@
|
|
|
| #include "cc/test/scheduler_test_common.h"
|
|
|
| +#include <string>
|
| +
|
| #include "base/logging.h"
|
|
|
| namespace cc {
|
| @@ -14,4 +16,42 @@ void FakeTimeSourceClient::OnTimerTick() {
|
|
|
| base::TimeTicks FakeDelayBasedTimeSource::Now() const { return now_; }
|
|
|
| +void TestDelayBasedTimeSource::SetNow(base::TimeTicks time) {
|
| + test_task_runner_->SetNow(time);
|
| +}
|
| +
|
| +std::string TestDelayBasedTimeSource::TypeString() const {
|
| + return "TestDelayBasedTimeSource";
|
| +}
|
| +
|
| +base::TimeTicks TestDelayBasedTimeSource::Now() const {
|
| + return test_task_runner_->Now();
|
| +}
|
| +
|
| +base::TimeTicks TestScheduler::Now() const {
|
| + return test_task_runner_->Now();
|
| +}
|
| +
|
| +TestScheduler::TestScheduler(
|
| + SchedulerClient* client,
|
| + const SchedulerSettings& scheduler_settings,
|
| + int layer_tree_host_id,
|
| + const scoped_refptr<OrderedSimpleTaskRunner>& test_task_runner)
|
| + : Scheduler(client,
|
| + scheduler_settings,
|
| + layer_tree_host_id,
|
| + test_task_runner),
|
| + test_task_runner_(test_task_runner.get()) {
|
| + if (!settings_.begin_frame_scheduling_enabled) {
|
| + scoped_refptr<DelayBasedTimeSource> time_source =
|
| + TestDelayBasedTimeSource::Create(VSyncInterval(), test_task_runner_);
|
| + synthetic_begin_frame_source_.reset(
|
| + new SyntheticBeginFrameSource(this, time_source));
|
| + }
|
| +}
|
| +
|
| +void TestScheduler::SetNow(base::TimeTicks time) {
|
| + test_task_runner_->SetNow(time);
|
| +}
|
| +
|
| } // namespace cc
|
|
|