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 #ifndef CONTENT_RENDERER_SCHEDULER_NESTABLE_TASK_RUNNER_FOR_TEST_H_
6 #define CONTENT_RENDERER_SCHEDULER_NESTABLE_TASK_RUNNER_FOR_TEST_H_
8 #include "content/child/scheduler/nestable_single_thread_task_runner.h"
12 class NestableTaskRunnerForTest
: public NestableSingleThreadTaskRunner
{
14 static scoped_refptr
<NestableTaskRunnerForTest
> Create(
15 scoped_refptr
<base::SingleThreadTaskRunner
> task_runner
);
17 void SetNested(bool is_nested
);
19 // NestableSingleThreadTaskRunner implementation
20 bool PostDelayedTask(const tracked_objects::Location
& from_here
,
21 const base::Closure
& task
,
22 base::TimeDelta delay
) override
;
23 bool PostNonNestableDelayedTask(const tracked_objects::Location
& from_here
,
24 const base::Closure
& task
,
25 base::TimeDelta delay
) override
;
26 bool RunsTasksOnCurrentThread() const override
;
27 bool IsNested() const override
;
30 ~NestableTaskRunnerForTest() override
;
33 NestableTaskRunnerForTest(
34 scoped_refptr
<base::SingleThreadTaskRunner
> task_runner
);
36 scoped_refptr
<base::SingleThreadTaskRunner
> task_runner_
;
39 DISALLOW_COPY_AND_ASSIGN(NestableTaskRunnerForTest
);
42 } // namespace content
44 #endif // CONTENT_RENDERER_SCHEDULER_NESTABLE_TASK_RUNNER_FOR_TEST_H_