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

Side by Side Diff: chrome/browser/ui/ash/session_controller_client_unittest.cc

Issue 2911493002: cros: Pull user info from session_controller_client.mojom into separate mojom. (Closed)
Patch Set: Fix ordering in typemaps Created 3 years, 7 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
« no previous file with comments | « chrome/browser/ui/ash/session_controller_client.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/session_controller_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698