OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/mus/test/wm_test_base.h" | 5 #include "ash/mus/test/wm_test_base.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/common/session/session_controller.h" | 10 #include "ash/common/session/session_controller.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 } | 182 } |
183 | 183 |
184 void WmTestBase::SimulateUserLogin() { | 184 void WmTestBase::SimulateUserLogin() { |
185 SessionController* session_controller = WmShell::Get()->session_controller(); | 185 SessionController* session_controller = WmShell::Get()->session_controller(); |
186 | 186 |
187 // Simulate the first user logging in. | 187 // Simulate the first user logging in. |
188 mojom::UserSessionPtr session = mojom::UserSession::New(); | 188 mojom::UserSessionPtr session = mojom::UserSession::New(); |
189 session->session_id = 1; | 189 session->session_id = 1; |
190 session->type = user_manager::USER_TYPE_REGULAR; | 190 session->type = user_manager::USER_TYPE_REGULAR; |
191 const std::string email("ash.user@example.com"); | 191 const std::string email("ash.user@example.com"); |
192 session->serialized_account_id = AccountId::FromUserEmail(email).Serialize(); | 192 session->account_id = AccountId::FromUserEmail(email); |
193 session->display_name = "Ash User"; | 193 session->display_name = "Ash User"; |
194 session->display_email = email; | 194 session->display_email = email; |
195 session_controller->UpdateUserSession(std::move(session)); | 195 session_controller->UpdateUserSession(std::move(session)); |
196 | 196 |
197 // Simulate the user session becoming active. | 197 // Simulate the user session becoming active. |
198 mojom::SessionInfoPtr info = mojom::SessionInfo::New(); | 198 mojom::SessionInfoPtr info = mojom::SessionInfo::New(); |
199 info->max_users = 10; | 199 info->max_users = 10; |
200 info->can_lock_screen = true; | 200 info->can_lock_screen = true; |
201 info->should_lock_screen_automatically = false; | 201 info->should_lock_screen_automatically = false; |
202 info->add_user_session_policy = AddUserSessionPolicy::ALLOWED; | 202 info->add_user_session_policy = AddUserSessionPolicy::ALLOWED; |
203 info->state = session_manager::SessionState::ACTIVE; | 203 info->state = session_manager::SessionState::ACTIVE; |
204 session_controller->SetSessionInfo(std::move(info)); | 204 session_controller->SetSessionInfo(std::move(info)); |
205 } | 205 } |
206 | 206 |
207 | 207 |
208 } // namespace mus | 208 } // namespace mus |
209 } // namespace ash | 209 } // namespace ash |
OLD | NEW |