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

Unified Diff: webrtc/base/timeutils.h

Issue 2016863003: Implemented ScopedFakeTime, faking rtc::TimeNanos. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed comments. Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/base/timeutils.h
diff --git a/webrtc/base/timeutils.h b/webrtc/base/timeutils.h
index 222d5c26e4774efc568736bd2f9fcfa417978ed1..5d2c938a5b4b7830dfd0f1171a6514c5c61c0f6c 100644
--- a/webrtc/base/timeutils.h
+++ b/webrtc/base/timeutils.h
@@ -18,6 +18,19 @@
namespace rtc {
+namespace test {
+
+class FakeTimeInterface {
+ public:
+ virtual uint64_t TimeNanos() = 0;
+ virtual ~FakeTimeInterface() {}
+};
+
+// Allows overriding the system clocks in tests, see faketime.h.
+void SetFakeTime(FakeTimeInterface* f);
+
+} // namespace test
+
static const int64_t kNumMillisecsPerSec = INT64_C(1000);
static const int64_t kNumMicrosecsPerSec = INT64_C(1000000);
static const int64_t kNumNanosecsPerSec = INT64_C(1000000000);
« webrtc/base/faketime.h ('K') | « webrtc/base/faketime.h ('k') | webrtc/base/timeutils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698