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

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: 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 #include "base/test/scoped_time_controller.h"
6
7 namespace base {
8 namespace test {
9
10 ScopedTimeController::ScopedTimeController() {
11 replaced_instance_ = TimeFactory::instance_;
12 TimeFactory::instance_ = this;
13 }
14
15 ScopedTimeController::~ScopedTimeController() {
16 TimeFactory::instance_ = replaced_instance_;
17 }
18
19 void ScopedTimeController::Advance(base::TimeDelta delta) {
20 current_time_ += delta;
21 current_timeticks_ += delta;
22 }
23
24 Time ScopedTimeController::TimeNow() {
25 return current_time_;
26 }
27
28 TimeTicks ScopedTimeController::TimeTicksNow() {
29 return current_timeticks_;
30 }
31
32 TimeTicks ScopedTimeController::TimeTicksHighResNow() {
33 return current_timeticks_;
34 }
35
36 } // namespace base
37 } // namespace test
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698