blob: 88e48261b30eee34490bf183bf55bfd14ba49c09 [file] [log] [blame]
henrike@webrtc.orgf0488722014-05-13 18:00:26 +00001/*
2 * Copyright 2011 The WebRTC Project Authors. All rights reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11// A fake TaskRunner for use in unit tests.
12
13#ifndef WEBRTC_BASE_FAKETASKRUNNER_H_
14#define WEBRTC_BASE_FAKETASKRUNNER_H_
15
16#include "webrtc/base/taskparent.h"
17#include "webrtc/base/taskrunner.h"
18
19namespace rtc {
20
21class FakeTaskRunner : public TaskRunner {
22 public:
23 FakeTaskRunner() : current_time_(0) {}
24 virtual ~FakeTaskRunner() {}
25
26 virtual void WakeTasks() { RunTasks(); }
27
Peter Boström0c4e06b2015-10-07 12:23:21 +020028 virtual int64_t CurrentTime() {
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000029 // Implement if needed.
30 return current_time_++;
31 }
32
Peter Boström0c4e06b2015-10-07 12:23:21 +020033 int64_t current_time_;
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000034};
35
36} // namespace rtc
37
38#endif // WEBRTC_BASE_FAKETASKRUNNER_H_