Index: webrtc/base/test/faketiming.h |
diff --git a/webrtc/base/test/faketiming.h b/webrtc/base/test/faketiming.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..63d9573dab8472e4833dc2d4c301099244ad188c |
--- /dev/null |
+++ b/webrtc/base/test/faketiming.h |
@@ -0,0 +1,32 @@ |
+/* |
+ * Copyright 2016 The WebRTC project authors. All Rights Reserved. |
+ * |
+ * Use of this source code is governed by a BSD-style license |
+ * that can be found in the LICENSE file in the root of the source |
+ * tree. An additional intellectual property rights grant can be found |
+ * in the file PATENTS. All contributing project authors may |
+ * be found in the AUTHORS file in the root of the source tree. |
+ */ |
+ |
+#ifndef WEBRTC_BASE_TEST_FAKETIMING_H_ |
+#define WEBRTC_BASE_TEST_FAKETIMING_H_ |
+ |
+#include "webrtc/base/timing.h" |
+#include "webrtc/base/timeutils.h" |
+ |
+namespace rtc { |
+ |
+class FakeTiming : public Timing { |
+ public: |
+ FakeTiming() : now_(0.0) {} |
hta - Chromium
2016/08/13 06:16:38
A matter of style: Can you make this class start a
hbos
2016/08/13 07:24:37
Done. :) Those were the days.
|
+ double TimerNow() override { return now_; } |
+ void AdvanceTimeSecs(double seconds) { now_ += seconds; } |
+ void AdvanceTimeMillisecs(double ms) { now_ += (ms / kNumMillisecsPerSec); } |
+ |
+ private: |
+ double now_; |
+}; |
+ |
+} // namespace rtc |
+ |
+#endif // WEBRTC_BASE_TEST_FAKETIMING_H_ |