OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
| 5 // TODO(akalin): Change all users of this class to use SimpleTestClock |
| 6 // or SimpleTestTickClock and remove this class. |
| 7 |
5 // A helper class used to mock out calls to the static method base::Time::Now. | 8 // A helper class used to mock out calls to the static method base::Time::Now. |
6 // | 9 // |
7 // Example usage: | 10 // Example usage: |
8 // | 11 // |
9 // typedef base::Time(TimeProvider)(); | 12 // typedef base::Time(TimeProvider)(); |
10 // class StopWatch { | 13 // class StopWatch { |
11 // public: | 14 // public: |
12 // StopWatch(TimeProvider* time_provider); | 15 // StopWatch(TimeProvider* time_provider); |
13 // void Start(); | 16 // void Start(); |
14 // base::TimeDelta Stop(); | 17 // base::TimeDelta Stop(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 static Time StaticNow(); | 60 static Time StaticNow(); |
58 | 61 |
59 private: | 62 private: |
60 static MockTimeProvider* instance_; | 63 static MockTimeProvider* instance_; |
61 DISALLOW_COPY_AND_ASSIGN(MockTimeProvider); | 64 DISALLOW_COPY_AND_ASSIGN(MockTimeProvider); |
62 }; | 65 }; |
63 | 66 |
64 } // namespace base | 67 } // namespace base |
65 | 68 |
66 #endif // BASE_TEST_MOCK_TIME_PROVIDER_H_ | 69 #endif // BASE_TEST_MOCK_TIME_PROVIDER_H_ |
OLD | NEW |