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

Side by Side Diff: ash/test/ash_test_helper.cc

Issue 2734933004: ash: Use SessionController instead of SessionStateDelegate (Closed)
Patch Set: rebase 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ash_test_helper.h" 5 #include "ash/test/ash_test_helper.h"
6 6
7 #include "ash/accelerators/accelerator_controller_delegate_aura.h" 7 #include "ash/accelerators/accelerator_controller_delegate_aura.h"
8 #include "ash/common/test/test_session_state_delegate.h" 8 #include "ash/common/test/test_session_state_delegate.h"
9 #include "ash/common/test/test_system_tray_delegate.h" 9 #include "ash/common/test/test_system_tray_delegate.h"
10 #include "ash/common/test/wm_shell_test_api.h" 10 #include "ash/common/test/wm_shell_test_api.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 ui::MaterialDesignController::Initialize(); 134 ui::MaterialDesignController::Initialize();
135 135
136 if (is_mash) 136 if (is_mash)
137 CreateMashWindowManager(); 137 CreateMashWindowManager();
138 else 138 else
139 CreateShell(); 139 CreateShell();
140 140
141 aura::test::EnvTestHelper().SetInputStateLookup( 141 aura::test::EnvTestHelper().SetInputStateLookup(
142 std::unique_ptr<aura::InputStateLookup>()); 142 std::unique_ptr<aura::InputStateLookup>());
143 143
144 session_controller_client_.reset(
145 new TestSessionControllerClient(WmShell::Get()->session_controller()));
146 session_controller_client_->InitializeAndBind();
147
144 Shell* shell = Shell::GetInstance(); 148 Shell* shell = Shell::GetInstance();
145 if (start_session) { 149 if (start_session)
146 GetTestSessionStateDelegate()->SetActiveUserSessionStarted(true); 150 session_controller_client_->SetPredefinedUserSessions(1);
147 GetTestSessionStateDelegate()->SetHasActiveUser(true);
148 }
149 151
150 if (!is_mash) { 152 if (!is_mash) {
151 // ScreenLayoutObserver is specific to classic-ash. 153 // ScreenLayoutObserver is specific to classic-ash.
152 // Tests that change the display configuration generally don't care about 154 // Tests that change the display configuration generally don't care about
153 // the notifications and the popup UI can interfere with things like 155 // the notifications and the popup UI can interfere with things like
154 // cursors. 156 // cursors.
155 shell->screen_layout_observer()->set_show_notifications_for_testing(false); 157 shell->screen_layout_observer()->set_show_notifications_for_testing(false);
156 158
157 // DisplayManager is specific to classic-ash. 159 // DisplayManager is specific to classic-ash.
158 display::test::DisplayManagerTestApi( 160 display::test::DisplayManagerTestApi(
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 std::set<RootWindowController*> roots = 366 std::set<RootWindowController*> roots =
365 window_manager_app_->window_manager()->GetRootWindowControllers(); 367 window_manager_app_->window_manager()->GetRootWindowControllers();
366 std::vector<RootWindowController*> ordered_roots; 368 std::vector<RootWindowController*> ordered_roots;
367 ordered_roots.insert(ordered_roots.begin(), roots.begin(), roots.end()); 369 ordered_roots.insert(ordered_roots.begin(), roots.begin(), roots.end());
368 std::sort(ordered_roots.begin(), ordered_roots.end(), &CompareByDisplayId); 370 std::sort(ordered_roots.begin(), ordered_roots.end(), &CompareByDisplayId);
369 return ordered_roots; 371 return ordered_roots;
370 } 372 }
371 373
372 } // namespace test 374 } // namespace test
373 } // namespace ash 375 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698