Index: ash/common/wm/workspace/workspace_layout_manager_unittest.cc |
diff --git a/ash/common/wm/workspace/workspace_layout_manager_unittest.cc b/ash/common/wm/workspace/workspace_layout_manager_unittest.cc |
index 167fb314117bf059818a12910e27abb3088828e7..c2debf2ac38c79bf6eb4b1976ca5ffcba7e6a0c2 100644 |
--- a/ash/common/wm/workspace/workspace_layout_manager_unittest.cc |
+++ b/ash/common/wm/workspace/workspace_layout_manager_unittest.cc |
@@ -4,16 +4,17 @@ |
#include "ash/common/wm/workspace/workspace_layout_manager.h" |
+#include <memory> |
#include <string> |
#include <utility> |
-#include "ash/common/session/session_state_delegate.h" |
+#include "ash/common/session/session_controller.h" |
#include "ash/common/shelf/shelf_constants.h" |
#include "ash/common/shelf/shelf_layout_manager.h" |
#include "ash/common/shelf/wm_shelf.h" |
#include "ash/common/shell_observer.h" |
#include "ash/common/test/ash_test.h" |
-#include "ash/common/test/test_session_state_delegate.h" |
+#include "ash/common/test/test_session_controller_client.h" |
#include "ash/common/wm/fullscreen_window_finder.h" |
#include "ash/common/wm/maximize_mode/workspace_backdrop_delegate.h" |
#include "ash/common/wm/window_state.h" |
@@ -27,6 +28,7 @@ |
#include "ash/shell.h" |
#include "ash/wm/window_state_aura.h" |
#include "base/command_line.h" |
+#include "base/memory/ptr_util.h" |
#include "base/run_loop.h" |
#include "ui/aura/env.h" |
#include "ui/aura/window.h" |
@@ -896,7 +898,12 @@ TEST_F(WorkspaceLayoutManagerSoloTest, |
// Verify if the window is not resized during screen lock. See: crbug.com/173127 |
TEST_F(WorkspaceLayoutManagerSoloTest, NotResizeWhenScreenIsLocked) { |
- test::TestSessionStateDelegate::SetCanLockScreen(true); |
+ std::unique_ptr<test::TestSessionControllerClient> session_controller_client = |
+ base::MakeUnique<test::TestSessionControllerClient>( |
+ WmShell::Get()->session_controller()); |
+ session_controller_client->InitializeAndBind(); |
+ session_controller_client->CreatePredefinedUserSessions(1); |
+ session_controller_client->SetCanLockScreen(true); |
std::unique_ptr<WindowOwner> window_owner( |
CreateTestWindow(gfx::Rect(1, 2, 3, 4))); |
WmWindow* window = window_owner->window(); |
@@ -913,13 +920,13 @@ TEST_F(WorkspaceLayoutManagerSoloTest, NotResizeWhenScreenIsLocked) { |
window_bounds.ToString()); |
// The window size should not get touched while we are in lock screen. |
- WmShell::Get()->GetSessionStateDelegate()->LockScreen(); |
+ WmShell::Get()->session_controller()->LockScreenAndFlushForTest(); |
ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager(); |
shelf_layout_manager->UpdateVisibilityState(); |
EXPECT_EQ(window_bounds.ToString(), window->GetBounds().ToString()); |
// Coming out of the lock screen the window size should still remain. |
- WmShell::Get()->GetSessionStateDelegate()->UnlockScreen(); |
+ session_controller_client->UnlockScreen(); |
shelf_layout_manager->UpdateVisibilityState(); |
EXPECT_EQ(wm::GetMaximizedWindowBoundsInParent(window).ToString(), |
window_bounds.ToString()); |