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

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

Issue 11453012: Fix black background when locking with fullscreen window: (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rename undo/stop to cancel 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 #include "base/logging.h"
6 #include "base/test/scoped_time_controller.h"
7
8 namespace base {
9 namespace test {
10
11 ScopedTimeController::ScopedTimeController()
12 : current_time_(Time::Now()),
13 current_timeticks_(TimeTicks::Now()) {
14 replaced_instance_ = TimeFactory::instance_;
15 TimeFactory::instance_ = this;
16 }
17
18 ScopedTimeController::~ScopedTimeController() {
19 TimeFactory::instance_ = replaced_instance_;
20 }
21
22 void ScopedTimeController::Advance(base::TimeDelta delta) {
23 DCHECK(delta >= base::TimeDelta());
24 current_time_ += delta;
25 current_timeticks_ += delta;
26 }
27
28 Time ScopedTimeController::TimeNow() {
29 return current_time_;
30 }
31
32 TimeTicks ScopedTimeController::TimeTicksNow() {
33 return current_timeticks_;
34 }
35
36 } // namespace base
brettw 2012/12/13 21:39:16 Flip the order of these two lines :)
37 } // namespace test
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698