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

Side by Side Diff: ash/test/test_session_controller_client.cc

Issue 2829813002: cros: Move IsUserSupervised and IsUserChild off SystemTrayDelegate (Closed)
Patch Set: review comments Created 3 years, 8 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 | « ash/test/test_session_controller_client.h ('k') | ash/test/test_system_tray_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "ash/test/test_session_controller_client.h" 5 #include "ash/test/test_session_controller_client.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "ash/login_status.h" 10 #include "ash/login_status.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 ++numbered_user_index) { 90 ++numbered_user_index) {
91 AddUserSession(base::StringPrintf("user%d@tray", numbered_user_index)); 91 AddUserSession(base::StringPrintf("user%d@tray", numbered_user_index));
92 } 92 }
93 93
94 // Updates session state after adding user sessions. 94 // Updates session state after adding user sessions.
95 SetSessionState(session_manager::SessionState::ACTIVE); 95 SetSessionState(session_manager::SessionState::ACTIVE);
96 } 96 }
97 97
98 void TestSessionControllerClient::AddUserSession( 98 void TestSessionControllerClient::AddUserSession(
99 const std::string& display_email, 99 const std::string& display_email,
100 user_manager::UserType user_type,
100 bool enable_settings) { 101 bool enable_settings) {
101 mojom::UserSessionPtr session = mojom::UserSession::New(); 102 mojom::UserSessionPtr session = mojom::UserSession::New();
102 session->session_id = ++fake_session_id_; 103 session->session_id = ++fake_session_id_;
103 session->type = user_manager::USER_TYPE_REGULAR; 104 session->type = user_type;
104 session->account_id = 105 session->account_id =
105 AccountId::FromUserEmail(GetUserIdFromEmail(display_email)); 106 AccountId::FromUserEmail(GetUserIdFromEmail(display_email));
106 session->display_name = "Über tray Über tray Über tray Über tray"; 107 session->display_name = "Über tray Über tray Über tray Über tray";
107 session->display_email = display_email; 108 session->display_email = display_email;
108 session->should_enable_settings = enable_settings; 109 session->should_enable_settings = enable_settings;
109 session->should_show_notification_tray = true; 110 session->should_show_notification_tray = true;
110 controller_->UpdateUserSession(std::move(session)); 111 controller_->UpdateUserSession(std::move(session));
111 } 112 }
112 113
113 void TestSessionControllerClient::UnlockScreen() { 114 void TestSessionControllerClient::UnlockScreen() {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 if (it == sessions.end()) { 171 if (it == sessions.end()) {
171 NOTREACHED(); 172 NOTREACHED();
172 return; 173 return;
173 } 174 }
174 175
175 SwitchActiveUser((*it)->account_id); 176 SwitchActiveUser((*it)->account_id);
176 } 177 }
177 178
178 } // namespace test 179 } // namespace test
179 } // namespace ash 180 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/test_session_controller_client.h ('k') | ash/test/test_system_tray_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698