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

Side by Side Diff: chrome/browser/chromeos/power/session_length_limiter_unittest.cc

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again, previous had unrelated broken win_rel test. Created 7 years, 12 months 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/chromeos/power/session_length_limiter.h" 5 #include "chrome/browser/chromeos/power/session_length_limiter.h"
6 6
7 #include <deque> 7 #include <deque>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 now_ += kSessionLengthLimitTimerInterval; 169 now_ += kSessionLengthLimitTimerInterval;
170 *remaining_ -= kSessionLengthLimitTimerInterval; 170 *remaining_ -= kSessionLengthLimitTimerInterval;
171 if (*remaining_ < kZeroTimeDelta) 171 if (*remaining_ < kZeroTimeDelta)
172 remaining_.reset(new base::TimeDelta(kZeroTimeDelta)); 172 remaining_.reset(new base::TimeDelta(kZeroTimeDelta));
173 } 173 }
174 174
175 base::Time GetCurrentTime() const { 175 base::Time GetCurrentTime() const {
176 return now_; 176 return now_;
177 } 177 }
178 178
179 TestingPrefService local_state_; 179 TestingPrefServiceSimple local_state_;
180 MockSessionLengthLimiterDelegate* delegate_; // Owned by 180 MockSessionLengthLimiterDelegate* delegate_; // Owned by
181 // session_length_limiter_. 181 // session_length_limiter_.
182 scoped_refptr<ImmediateSingleThreadTaskRunner> runner_; 182 scoped_refptr<ImmediateSingleThreadTaskRunner> runner_;
183 183
184 base::Time session_start_time_; 184 base::Time session_start_time_;
185 base::Time now_; 185 base::Time now_;
186 scoped_ptr<base::TimeDelta> remaining_; 186 scoped_ptr<base::TimeDelta> remaining_;
187 187
188 scoped_ptr<SessionLengthLimiter> session_length_limiter_; 188 scoped_ptr<SessionLengthLimiter> session_length_limiter_;
189 }; 189 };
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 remaining_.reset(new base::TimeDelta(kZeroTimeDelta)); 375 remaining_.reset(new base::TimeDelta(kZeroTimeDelta));
376 } 376 }
377 377
378 // Check that the next timer tick does not lead to the session being 378 // Check that the next timer tick does not lead to the session being
379 // terminated. 379 // terminated.
380 now_ += kSessionLengthLimitTimerInterval; 380 now_ += kSessionLengthLimitTimerInterval;
381 runner_->RunTasks(); 381 runner_->RunTasks();
382 } 382 }
383 383
384 } // namespace chromeos 384 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/power/session_length_limiter.cc ('k') | chrome/browser/chromeos/preferences.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698