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

Side by Side Diff: ash/mus/test/wm_test_base.cc

Issue 2617763003: Add a mojo interface for AccountId (Closed)
Patch Set: rebase Created 3 years, 11 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/common/session/session_controller_unittest.cc ('k') | ash/public/interfaces/BUILD.gn » ('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 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
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
OLDNEW
« no previous file with comments | « ash/common/session/session_controller_unittest.cc ('k') | ash/public/interfaces/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698