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

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

Issue 11453012: Fix black background when locking with fullscreen window: (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Mock TimeTicks::Now() 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef BASE_TEST_SCOPED_TIME_CONTROLLER_H_
6 #define BASE_TEST_SCOPED_TIME_CONTROLLER_H_
7
8 #include "base/time.h"
9
10 namespace base {
11 namespace test {
12
13 // Sets itself as a TimeFactory construction, and restores the previous one
14 // on destruction.
15 class BASE_EXPORT ScopedTimeController : public base::TimeFactory {
16 public:
17 ScopedTimeController();
18 ~ScopedTimeController();
Daniel Erat 2012/12/10 23:56:52 nit: need 'virtual' here
Denis Kuznetsov (DE-MUC) 2012/12/11 13:27:57 Done.
19
20 // Advances inner time for |delta|.
21 void Advance(base::TimeDelta delta);
22
23 // TimeFactory overrides
24 virtual base::Time TimeNow();
25 virtual base::TimeTicks TimeTicksNow();
26 virtual base::TimeTicks TimeTicksHighResNow();
27
28 private:
29 base::TimeTicks current_timeticks_;
30 base::Time current_time_;
31
32 base::TimeFactory* replaced_instance_;
33
34 DISALLOW_COPY_AND_ASSIGN(ScopedTimeController);
35 };
36
37 } // namespace test
38 } // namespace base
39
40 #endif // BASE_TEST_SCOPED_TIME_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698