Introduce a SchedulerHelper in content/child/scheduler
[chromium-blink-merge.git] / content / child / scheduler / nestable_task_runner_for_test.cc
blobabab53bb0ff0d7245dc901e10156464c448da06f
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/child/scheduler/nestable_task_runner_for_test.h"
7 namespace content {
9 // static
10 scoped_refptr<NestableTaskRunnerForTest> NestableTaskRunnerForTest::Create(
11 scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
12 return make_scoped_refptr(new NestableTaskRunnerForTest(task_runner));
15 NestableTaskRunnerForTest::NestableTaskRunnerForTest(
16 scoped_refptr<base::SingleThreadTaskRunner> task_runner)
17 : task_runner_(task_runner), is_nested_(false) {
20 NestableTaskRunnerForTest::~NestableTaskRunnerForTest() {
23 bool NestableTaskRunnerForTest::PostDelayedTask(
24 const tracked_objects::Location& from_here,
25 const base::Closure& task,
26 base::TimeDelta delay) {
27 return task_runner_->PostDelayedTask(from_here, task, delay);
30 bool NestableTaskRunnerForTest::PostNonNestableDelayedTask(
31 const tracked_objects::Location& from_here,
32 const base::Closure& task,
33 base::TimeDelta delay) {
34 return task_runner_->PostNonNestableDelayedTask(from_here, task, delay);
37 bool NestableTaskRunnerForTest::RunsTasksOnCurrentThread() const {
38 return task_runner_->RunsTasksOnCurrentThread();
41 bool NestableTaskRunnerForTest::IsNested() const {
42 return is_nested_;
45 void NestableTaskRunnerForTest::SetNested(bool is_nested) {
46 is_nested_ = is_nested;
49 } // namespace content