| OLD | NEW |
| 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 "chrome/browser/ui/ash/session_controller_client.h" | 5 #include "chrome/browser/ui/ash/session_controller_client.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 // The hash must match the one used by FakeChromeUserManager. | 439 // The hash must match the one used by FakeChromeUserManager. |
| 440 session_manager_.CreateSession( | 440 session_manager_.CreateSession( |
| 441 account_id, chromeos::ProfileHelper::GetUserIdHashByUserIdForTesting( | 441 account_id, chromeos::ProfileHelper::GetUserIdHashByUserIdForTesting( |
| 442 "child@test.com")); | 442 "child@test.com")); |
| 443 session_manager_.SetSessionState(SessionState::ACTIVE); | 443 session_manager_.SetSessionState(SessionState::ACTIVE); |
| 444 SessionControllerClient::FlushForTesting(); | 444 SessionControllerClient::FlushForTesting(); |
| 445 | 445 |
| 446 // The session controller received session info and user session. | 446 // The session controller received session info and user session. |
| 447 EXPECT_LT(0u, session_controller.last_user_session()->session_id); | 447 EXPECT_LT(0u, session_controller.last_user_session()->session_id); |
| 448 EXPECT_EQ(user_manager::USER_TYPE_SUPERVISED, | 448 EXPECT_EQ(user_manager::USER_TYPE_SUPERVISED, |
| 449 session_controller.last_user_session()->type); | 449 session_controller.last_user_session()->user_info->type); |
| 450 | 450 |
| 451 // Simulate profile creation after login. | 451 // Simulate profile creation after login. |
| 452 TestingProfile* user_profile = CreateTestingProfile(user); | 452 TestingProfile* user_profile = CreateTestingProfile(user); |
| 453 user_profile->SetSupervisedUserId("child-id"); | 453 user_profile->SetSupervisedUserId("child-id"); |
| 454 | 454 |
| 455 // Simulate supervised user custodians. | 455 // Simulate supervised user custodians. |
| 456 PrefService* prefs = user_profile->GetPrefs(); | 456 PrefService* prefs = user_profile->GetPrefs(); |
| 457 prefs->SetString(prefs::kSupervisedUserCustodianEmail, "parent1@test.com"); | 457 prefs->SetString(prefs::kSupervisedUserCustodianEmail, "parent1@test.com"); |
| 458 prefs->SetString(prefs::kSupervisedUserSecondCustodianEmail, | 458 prefs->SetString(prefs::kSupervisedUserSecondCustodianEmail, |
| 459 "parent2@test.com"); | 459 "parent2@test.com"); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 | 511 |
| 512 user_prefs->SetBoolean(prefs::kEnableAutoScreenLock, true); | 512 user_prefs->SetBoolean(prefs::kEnableAutoScreenLock, true); |
| 513 SessionControllerClient::FlushForTesting(); | 513 SessionControllerClient::FlushForTesting(); |
| 514 EXPECT_TRUE( | 514 EXPECT_TRUE( |
| 515 session_controller.last_session_info()->should_lock_screen_automatically); | 515 session_controller.last_session_info()->should_lock_screen_automatically); |
| 516 user_prefs->SetBoolean(prefs::kEnableAutoScreenLock, false); | 516 user_prefs->SetBoolean(prefs::kEnableAutoScreenLock, false); |
| 517 SessionControllerClient::FlushForTesting(); | 517 SessionControllerClient::FlushForTesting(); |
| 518 EXPECT_FALSE( | 518 EXPECT_FALSE( |
| 519 session_controller.last_session_info()->should_lock_screen_automatically); | 519 session_controller.last_session_info()->should_lock_screen_automatically); |
| 520 } | 520 } |
| OLD | NEW |