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

Side by Side Diff: chrome/browser/chromeos/login/existing_user_controller_auto_login_unittest.cc

Issue 23494053: Remove NOTIFICATION_SYSTEM_SETTING_CHANGED, switch CrosSettings to base::CallbackRegistry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trailing space Created 7 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <string> 5 #include <string>
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/chromeos/login/existing_user_controller.h" 9 #include "chrome/browser/chromeos/login/existing_user_controller.h"
10 #include "chrome/browser/chromeos/login/mock_login_display.h" 10 #include "chrome/browser/chromeos/login/mock_login_display.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 kAccountsPrefDeviceLocalAccountsKeyId, 80 kAccountsPrefDeviceLocalAccountsKeyId,
81 kAutoLoginAccountId); 81 kAutoLoginAccountId);
82 account->SetIntegerWithoutPathExpansion( 82 account->SetIntegerWithoutPathExpansion(
83 kAccountsPrefDeviceLocalAccountsKeyType, 83 kAccountsPrefDeviceLocalAccountsKeyType,
84 policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION); 84 policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION);
85 base::ListValue accounts; 85 base::ListValue accounts;
86 accounts.Append(account.release()); 86 accounts.Append(account.release());
87 CrosSettings::Get()->Set(kAccountsPrefDeviceLocalAccounts, accounts); 87 CrosSettings::Get()->Set(kAccountsPrefDeviceLocalAccounts, accounts);
88 88
89 // Prevent settings changes from auto-starting the timer. 89 // Prevent settings changes from auto-starting the timer.
90 CrosSettings::Get()->RemoveSettingsObserver( 90 existing_user_controller_->
91 kAccountsPrefDeviceLocalAccountAutoLoginId, 91 local_account_auto_login_id_subscription_.reset();
92 existing_user_controller()); 92 existing_user_controller_->
93 CrosSettings::Get()->RemoveSettingsObserver( 93 local_account_auto_login_delay_subscription_.reset();
94 kAccountsPrefDeviceLocalAccountAutoLoginDelay,
95 existing_user_controller());
96 } 94 }
97 95
98 const ExistingUserController* existing_user_controller() const { 96 const ExistingUserController* existing_user_controller() const {
99 return ExistingUserController::current_controller(); 97 return ExistingUserController::current_controller();
100 } 98 }
101 99
102 ExistingUserController* existing_user_controller() { 100 ExistingUserController* existing_user_controller() {
103 return ExistingUserController::current_controller(); 101 return ExistingUserController::current_controller();
104 } 102 }
105 103
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 ConfigureAutoLogin(); 278 ConfigureAutoLogin();
281 ASSERT_TRUE(auto_login_timer()); 279 ASSERT_TRUE(auto_login_timer());
282 EXPECT_FALSE(auto_login_timer()->IsRunning()); 280 EXPECT_FALSE(auto_login_timer()->IsRunning());
283 EXPECT_EQ(auto_login_timer()->GetCurrentDelay().InMilliseconds(), 281 EXPECT_EQ(auto_login_timer()->GetCurrentDelay().InMilliseconds(),
284 kAutoLoginDelay2); 282 kAutoLoginDelay2);
285 EXPECT_EQ(auto_login_username(), ""); 283 EXPECT_EQ(auto_login_username(), "");
286 EXPECT_EQ(auto_login_delay(), kAutoLoginDelay2); 284 EXPECT_EQ(auto_login_delay(), kAutoLoginDelay2);
287 } 285 }
288 286
289 } // namespace chromeos 287 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698