OLD | NEW |
| (Empty) |
1 /* | |
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 | |
19 namespace rtc { | |
20 | |
21 class FakeTaskRunner : public TaskRunner { | |
22 public: | |
23 FakeTaskRunner() : current_time_(0) {} | |
24 virtual ~FakeTaskRunner() {} | |
25 | |
26 virtual void WakeTasks() { RunTasks(); } | |
27 | |
28 virtual int64_t CurrentTime() { | |
29 // Implement if needed. | |
30 return current_time_++; | |
31 } | |
32 | |
33 int64_t current_time_; | |
34 }; | |
35 | |
36 } // namespace rtc | |
37 | |
38 #endif // WEBRTC_BASE_FAKETASKRUNNER_H_ | |
OLD | NEW |