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

Side by Side Diff: base/test/mock_time_provider.h

Issue 11607003: Add a Clock and TickClock interface for mocking out time (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698