1 // Copyright 2014 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_TEST_FAKE_RENDERER_SCHEDULER_H_
6 #define CONTENT_TEST_FAKE_RENDERER_SCHEDULER_H_
8 #include "components/scheduler/renderer/renderer_scheduler.h"
12 class FakeRendererScheduler
: public scheduler::RendererScheduler
{
14 FakeRendererScheduler();
15 ~FakeRendererScheduler() override
;
17 // RendererScheduler implementation.
18 scoped_refptr
<scheduler::TaskQueue
> DefaultTaskRunner() override
;
19 scoped_refptr
<base::SingleThreadTaskRunner
> CompositorTaskRunner() override
;
20 scoped_refptr
<base::SingleThreadTaskRunner
> LoadingTaskRunner() override
;
21 scoped_refptr
<scheduler::SingleThreadIdleTaskRunner
> IdleTaskRunner()
23 scoped_refptr
<scheduler::TaskQueue
> TimerTaskRunner() override
;
24 void WillBeginFrame(const cc::BeginFrameArgs
& args
) override
;
25 void BeginFrameNotExpectedSoon() override
;
26 void DidCommitFrameToCompositor() override
;
27 void DidHandleInputEventOnCompositorThread(
28 const blink::WebInputEvent
& web_input_event
,
29 InputEventState event_state
) override
;
30 void DidHandleInputEventOnMainThread(
31 const blink::WebInputEvent
& web_input_event
) override
;
32 void DidAnimateForInputOnCompositorThread() override
;
33 void OnRendererHidden() override
;
34 void OnRendererVisible() override
;
35 void OnRendererBackgrounded() override
;
36 void OnRendererForegrounded() override
;
37 void OnPageLoadStarted() override
;
38 bool IsHighPriorityWorkAnticipated() override
;
39 bool CanExceedIdleDeadlineIfRequired() const override
;
40 bool ShouldYieldForHighPriorityWork() override
;
41 void AddTaskObserver(base::MessageLoop::TaskObserver
* task_observer
) override
;
42 void RemoveTaskObserver(
43 base::MessageLoop::TaskObserver
* task_observer
) override
;
44 void Shutdown() override
;
45 void SuspendTimerQueue() override
;
46 void ResumeTimerQueue() override
;
47 void SetTimerQueueSuspensionWhenBackgroundedEnabled(bool enabled
) override
;
50 DISALLOW_COPY_AND_ASSIGN(FakeRendererScheduler
);
53 } // namespace content
55 #endif // CONTENT_TEST_FAKE_RENDERER_SCHEDULER_H_