Index: base/timer/mock_elapsed_timer.h |
diff --git a/base/timer/mock_elapsed_timer.h b/base/timer/mock_elapsed_timer.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..20a9b768c78a97471bdf723b301f8480a118487c |
--- /dev/null |
+++ b/base/timer/mock_elapsed_timer.h |
@@ -0,0 +1,29 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef BASE_TIMER_MOCK_ELAPSED_TIMER_H_ |
+#define BASE_TIMER_MOCK_ELAPSED_TIMER_H_ |
+ |
+#include "base/base_export.h" |
+#include "base/time/time.h" |
+#include "base/timer/elapsed_timer.h" |
+ |
+namespace base { |
+ |
+class BASE_EXPORT MockElapsedTimer : public base::ElapsedTimer { |
+ public: |
+ MockElapsedTimer() {} |
+ virtual TimeDelta Elapsed() const OVERRIDE; |
+ |
+ void Advance(int64 ms) { delta_ = base::TimeDelta::FromMilliseconds(ms); } |
+ |
+ private: |
+ TimeDelta delta_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(MockElapsedTimer); |
+}; |
+ |
+} // namespace base |
+ |
+#endif // BASE_TIMER_MOCK_ELAPSED_TIMER_H_ |