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

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

Issue 11741003: Remove PrefServiceSimple, replacing it with PrefService and PrefRegistrySimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix double registration in Chrome Frame test. Created 7 years, 10 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 } // namespace 93 } // namespace
94 94
95 class SessionLengthLimiterTest : public testing::Test { 95 class SessionLengthLimiterTest : public testing::Test {
96 protected: 96 protected:
97 SessionLengthLimiterTest() : delegate_(NULL) { 97 SessionLengthLimiterTest() : delegate_(NULL) {
98 } 98 }
99 99
100 virtual void SetUp() { 100 virtual void SetUp() {
101 TestingBrowserProcess::GetGlobal()->SetLocalState(&local_state_); 101 TestingBrowserProcess::GetGlobal()->SetLocalState(&local_state_);
102 SessionLengthLimiter::RegisterPrefs(&local_state_); 102 SessionLengthLimiter::RegisterPrefs(local_state_.registry());
103 103
104 delegate_ = new NiceMock<MockSessionLengthLimiterDelegate>; 104 delegate_ = new NiceMock<MockSessionLengthLimiterDelegate>;
105 ON_CALL(*delegate_, GetCurrentTime()) 105 ON_CALL(*delegate_, GetCurrentTime())
106 .WillByDefault(Invoke(this, &SessionLengthLimiterTest::GetCurrentTime)); 106 .WillByDefault(Invoke(this, &SessionLengthLimiterTest::GetCurrentTime));
107 EXPECT_CALL(*delegate_, StopSession()).Times(0); 107 EXPECT_CALL(*delegate_, StopSession()).Times(0);
108 runner_ = new ImmediateSingleThreadTaskRunner; 108 runner_ = new ImmediateSingleThreadTaskRunner;
109 109
110 // Initialize the mock clock to a fixed value, ensuring that timezone 110 // Initialize the mock clock to a fixed value, ensuring that timezone
111 // differences or DST changes do not affect the test. 111 // differences or DST changes do not affect the test.
112 now_ = base::Time::UnixEpoch() + base::TimeDelta::FromDays(40 * 365); 112 now_ = base::Time::UnixEpoch() + base::TimeDelta::FromDays(40 * 365);
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 remaining_.reset(new base::TimeDelta(kZeroTimeDelta)); 374 remaining_.reset(new base::TimeDelta(kZeroTimeDelta));
375 } 375 }
376 376
377 // Check that the next timer tick does not lead to the session being 377 // Check that the next timer tick does not lead to the session being
378 // terminated. 378 // terminated.
379 now_ += kSessionLengthLimitTimerInterval; 379 now_ += kSessionLengthLimitTimerInterval;
380 runner_->RunTasks(); 380 runner_->RunTasks();
381 } 381 }
382 382
383 } // namespace chromeos 383 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/power/session_length_limiter.cc ('k') | chrome/browser/chromeos/proxy_config_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698