| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 // A fake TaskRunner for use in unit tests. | 11 // A fake TaskRunner for use in unit tests. |
| 12 | 12 |
| 13 #ifndef WEBRTC_BASE_FAKETASKRUNNER_H_ | 13 #ifndef WEBRTC_BASE_FAKETASKRUNNER_H_ |
| 14 #define WEBRTC_BASE_FAKETASKRUNNER_H_ | 14 #define WEBRTC_BASE_FAKETASKRUNNER_H_ |
| 15 | 15 |
| 16 #include "webrtc/base/taskparent.h" | 16 #include "webrtc/base/taskparent.h" |
| 17 #include "webrtc/base/taskrunner.h" | 17 #include "webrtc/base/taskrunner.h" |
| 18 | 18 |
| 19 namespace rtc { | 19 namespace rtc { |
| 20 | 20 |
| 21 class FakeTaskRunner : public TaskRunner { | 21 class FakeTaskRunner : public TaskRunner { |
| 22 public: | 22 public: |
| 23 FakeTaskRunner() : current_time_(0) {} | 23 FakeTaskRunner() : current_time_(0) {} |
| 24 virtual ~FakeTaskRunner() {} | 24 virtual ~FakeTaskRunner() {} |
| 25 | 25 |
| 26 virtual void WakeTasks() { RunTasks(); } | 26 virtual void WakeTasks() { RunTasks(); } |
| 27 | 27 |
| 28 virtual int64 CurrentTime() { | 28 virtual int64_t CurrentTime() { |
| 29 // Implement if needed. | 29 // Implement if needed. |
| 30 return current_time_++; | 30 return current_time_++; |
| 31 } | 31 } |
| 32 | 32 |
| 33 int64 current_time_; | 33 int64_t current_time_; |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 } // namespace rtc | 36 } // namespace rtc |
| 37 | 37 |
| 38 #endif // WEBRTC_BASE_FAKETASKRUNNER_H_ | 38 #endif // WEBRTC_BASE_FAKETASKRUNNER_H_ |
| OLD | NEW |