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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/test/fake_web_task_runner.cc

Issue 2266443002: Optimize posting of WTF::Closure and improve scheduler test mocks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cut back to just the WTF::Closure fix plus the scheduler test mock refactor. Created 4 years, 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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.
4
5 #include "platform/scheduler/test/fake_web_task_runner.h"
6
7 namespace blink {
8 namespace scheduler {
9
10 FakeWebTaskRunner::FakeWebTaskRunner() : time_(0.0) {}
11
12 FakeWebTaskRunner::~FakeWebTaskRunner() {}
13
14 void FakeWebTaskRunner::setTime(double new_time) {
15 time_ = new_time;
16 }
17
18 void FakeWebTaskRunner::postTask(const WebTraceLocation&, Task*) {}
19
20 void FakeWebTaskRunner::postDelayedTask(const WebTraceLocation&,
21 Task* task,
22 double) {
23 task_.reset(task);
24 }
25
26 bool FakeWebTaskRunner::runsTasksOnCurrentThread() {
27 return true;
28 }
29
30 std::unique_ptr<WebTaskRunner> FakeWebTaskRunner::clone() {
31 return nullptr;
32 }
33
34 double FakeWebTaskRunner::virtualTimeSeconds() const {
35 return time_;
36 }
37
38 double FakeWebTaskRunner::monotonicallyIncreasingVirtualTimeSeconds() const {
39 return time_;
40 }
41
42 SingleThreadTaskRunner* FakeWebTaskRunner::toSingleThreadTaskRunner() {
43 return nullptr;
44 }
45
46 } // namespace scheduler
47 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698