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

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

Issue 2761373002: Move yet more from WmShell to Shell (Closed)
Patch Set: merge Created 3 years, 9 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/mus/system_tray_delegate_mus.cc ('k') | ash/root_window_controller.cc » ('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"
11 #include "ash/common/wm_shell.h"
12 #include "ash/mus/test/wm_test_helper.h" 11 #include "ash/mus/test/wm_test_helper.h"
13 #include "ash/mus/top_level_window_factory.h" 12 #include "ash/mus/top_level_window_factory.h"
14 #include "ash/mus/window_manager.h" 13 #include "ash/mus/window_manager.h"
15 #include "ash/mus/window_manager_application.h" 14 #include "ash/mus/window_manager_application.h"
16 #include "ash/public/cpp/session_types.h" 15 #include "ash/public/cpp/session_types.h"
17 #include "ash/public/interfaces/session_controller.mojom.h" 16 #include "ash/public/interfaces/session_controller.mojom.h"
17 #include "ash/shell.h"
18 #include "ash/test/wm_window_test_api.h" 18 #include "ash/test/wm_window_test_api.h"
19 #include "base/memory/ptr_util.h" 19 #include "base/memory/ptr_util.h"
20 #include "services/ui/public/cpp/property_type_converters.h" 20 #include "services/ui/public/cpp/property_type_converters.h"
21 #include "ui/aura/mus/property_converter.h" 21 #include "ui/aura/mus/property_converter.h"
22 #include "ui/aura/mus/window_tree_client.h" 22 #include "ui/aura/mus/window_tree_client.h"
23 #include "ui/aura/window.h" 23 #include "ui/aura/window.h"
24 #include "ui/compositor/scoped_animation_duration_scale_mode.h" 24 #include "ui/compositor/scoped_animation_duration_scale_mode.h"
25 #include "ui/display/display.h" 25 #include "ui/display/display.h"
26 26
27 namespace ash { 27 namespace ash {
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 173 }
174 174
175 void WmTestBase::TearDown() { 175 void WmTestBase::TearDown() {
176 teardown_called_ = true; 176 teardown_called_ = true;
177 test_helper_.reset(); 177 test_helper_.reset();
178 minimum_size_lock_.reset(); 178 minimum_size_lock_.reset();
179 zero_duration_mode_.reset(); 179 zero_duration_mode_.reset();
180 } 180 }
181 181
182 void WmTestBase::SimulateUserLogin() { 182 void WmTestBase::SimulateUserLogin() {
183 SessionController* session_controller = WmShell::Get()->session_controller(); 183 SessionController* session_controller = Shell::Get()->session_controller();
184 184
185 // Simulate the first user logging in. 185 // Simulate the first user logging in.
186 mojom::UserSessionPtr session = mojom::UserSession::New(); 186 mojom::UserSessionPtr session = mojom::UserSession::New();
187 session->session_id = 1; 187 session->session_id = 1;
188 session->type = user_manager::USER_TYPE_REGULAR; 188 session->type = user_manager::USER_TYPE_REGULAR;
189 const std::string email("ash.user@example.com"); 189 const std::string email("ash.user@example.com");
190 session->account_id = AccountId::FromUserEmail(email); 190 session->account_id = AccountId::FromUserEmail(email);
191 session->display_name = "Ash User"; 191 session->display_name = "Ash User";
192 session->display_email = email; 192 session->display_email = email;
193 session_controller->UpdateUserSession(std::move(session)); 193 session_controller->UpdateUserSession(std::move(session));
194 194
195 // Simulate the user session becoming active. 195 // Simulate the user session becoming active.
196 mojom::SessionInfoPtr info = mojom::SessionInfo::New(); 196 mojom::SessionInfoPtr info = mojom::SessionInfo::New();
197 info->can_lock_screen = true; 197 info->can_lock_screen = true;
198 info->should_lock_screen_automatically = false; 198 info->should_lock_screen_automatically = false;
199 info->add_user_session_policy = AddUserSessionPolicy::ALLOWED; 199 info->add_user_session_policy = AddUserSessionPolicy::ALLOWED;
200 info->state = session_manager::SessionState::ACTIVE; 200 info->state = session_manager::SessionState::ACTIVE;
201 session_controller->SetSessionInfo(std::move(info)); 201 session_controller->SetSessionInfo(std::move(info));
202 } 202 }
203 203
204 204
205 } // namespace mus 205 } // namespace mus
206 } // namespace ash 206 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/system_tray_delegate_mus.cc ('k') | ash/root_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698