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/ash_test_impl_mus.h" | 5 #include "ash/mus/test/ash_test_impl_mus.h" |
6 | 6 |
7 #include "ash/common/session/session_controller.h" | 7 #include "ash/common/session/session_controller.h" |
8 #include "ash/common/test/ash_test.h" | 8 #include "ash/common/test/ash_test.h" |
9 #include "ash/common/wm_shell.h" | 9 #include "ash/common/wm_shell.h" |
10 #include "ash/mus/bridge/wm_window_mus.h" | 10 #include "ash/mus/bridge/wm_window_mus.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 } | 108 } |
109 | 109 |
110 void AshTestImplMus::SimulateUserLogin() { | 110 void AshTestImplMus::SimulateUserLogin() { |
111 SessionController* session_controller = WmShell::Get()->session_controller(); | 111 SessionController* session_controller = WmShell::Get()->session_controller(); |
112 | 112 |
113 // Simulate the first user logging in. | 113 // Simulate the first user logging in. |
114 mojom::UserSessionPtr session = mojom::UserSession::New(); | 114 mojom::UserSessionPtr session = mojom::UserSession::New(); |
115 session->session_id = 1; | 115 session->session_id = 1; |
116 session->type = user_manager::USER_TYPE_REGULAR; | 116 session->type = user_manager::USER_TYPE_REGULAR; |
117 const std::string email("ash.user@example.com"); | 117 const std::string email("ash.user@example.com"); |
118 session->serialized_account_id = AccountId::FromUserEmail(email).Serialize(); | 118 session->account_id = AccountId::FromUserEmail(email); |
119 session->display_name = "Ash User"; | 119 session->display_name = "Ash User"; |
120 session->display_email = email; | 120 session->display_email = email; |
121 session_controller->UpdateUserSession(std::move(session)); | 121 session_controller->UpdateUserSession(std::move(session)); |
122 | 122 |
123 // Simulate the user session becoming active. | 123 // Simulate the user session becoming active. |
124 mojom::SessionInfoPtr info = mojom::SessionInfo::New(); | 124 mojom::SessionInfoPtr info = mojom::SessionInfo::New(); |
125 info->max_users = 10; | 125 info->max_users = 10; |
126 info->can_lock_screen = true; | 126 info->can_lock_screen = true; |
127 info->should_lock_screen_automatically = false; | 127 info->should_lock_screen_automatically = false; |
128 info->add_user_session_policy = AddUserSessionPolicy::ALLOWED; | 128 info->add_user_session_policy = AddUserSessionPolicy::ALLOWED; |
129 info->state = session_manager::SessionState::ACTIVE; | 129 info->state = session_manager::SessionState::ACTIVE; |
130 session_controller->SetSessionInfo(std::move(info)); | 130 session_controller->SetSessionInfo(std::move(info)); |
131 } | 131 } |
132 | 132 |
133 } // namespace mus | 133 } // namespace mus |
134 | 134 |
135 // static | 135 // static |
136 std::unique_ptr<AshTestImpl> AshTestImpl::Create() { | 136 std::unique_ptr<AshTestImpl> AshTestImpl::Create() { |
137 return base::MakeUnique<mus::AshTestImplMus>(); | 137 return base::MakeUnique<mus::AshTestImplMus>(); |
138 } | 138 } |
139 | 139 |
140 } // namespace ash | 140 } // namespace ash |
OLD | NEW |