| OLD | NEW |
| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 void TestSessionControllerClient::AddUserSession( | 98 void TestSessionControllerClient::AddUserSession( |
| 99 const std::string& display_email) { | 99 const std::string& display_email) { |
| 100 mojom::UserSessionPtr session = mojom::UserSession::New(); | 100 mojom::UserSessionPtr session = mojom::UserSession::New(); |
| 101 session->session_id = ++fake_session_id_; | 101 session->session_id = ++fake_session_id_; |
| 102 session->type = user_manager::USER_TYPE_REGULAR; | 102 session->type = user_manager::USER_TYPE_REGULAR; |
| 103 session->account_id = | 103 session->account_id = |
| 104 AccountId::FromUserEmail(GetUserIdFromEmail(display_email)); | 104 AccountId::FromUserEmail(GetUserIdFromEmail(display_email)); |
| 105 session->display_name = "Über tray Über tray Über tray Über tray"; | 105 session->display_name = "Über tray Über tray Über tray Über tray"; |
| 106 session->display_email = display_email; | 106 session->display_email = display_email; |
| 107 session->should_enable_settings = true; |
| 108 session->should_show_notification_tray = true; |
| 107 controller_->UpdateUserSession(std::move(session)); | 109 controller_->UpdateUserSession(std::move(session)); |
| 108 } | 110 } |
| 109 | 111 |
| 110 void TestSessionControllerClient::UnlockScreen() { | 112 void TestSessionControllerClient::UnlockScreen() { |
| 111 SetSessionState(session_manager::SessionState::ACTIVE); | 113 SetSessionState(session_manager::SessionState::ACTIVE); |
| 112 } | 114 } |
| 113 | 115 |
| 114 void TestSessionControllerClient::RequestLockScreen() { | 116 void TestSessionControllerClient::RequestLockScreen() { |
| 115 SetSessionState(session_manager::SessionState::LOCKED); | 117 SetSessionState(session_manager::SessionState::LOCKED); |
| 116 } | 118 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 if (it == sessions.end()) { | 169 if (it == sessions.end()) { |
| 168 NOTREACHED(); | 170 NOTREACHED(); |
| 169 return; | 171 return; |
| 170 } | 172 } |
| 171 | 173 |
| 172 SwitchActiveUser((*it)->account_id); | 174 SwitchActiveUser((*it)->account_id); |
| 173 } | 175 } |
| 174 | 176 |
| 175 } // namespace test | 177 } // namespace test |
| 176 } // namespace ash | 178 } // namespace ash |
| OLD | NEW |