Index: ash/shell_unittest.cc |
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc |
index d15aee8f09e4566a679d2df4e0a07b1c552ee878..ad202de8b918a5532449b1c705abb2c387b74305 100644 |
--- a/ash/shell_unittest.cc |
+++ b/ash/shell_unittest.cc |
@@ -164,13 +164,17 @@ class ShellTest : public test::AshTestBase { |
// Create a LockScreen window. |
views::Widget::InitParams widget_params( |
views::Widget::InitParams::TYPE_WINDOW); |
- SessionController* controller = Shell::Get()->session_controller(); |
- controller->LockScreenAndFlushForTest(); |
views::Widget* lock_widget = CreateTestWindow(widget_params); |
Shell::GetContainer(Shell::GetPrimaryRootWindow(), |
kShellWindowId_LockScreenContainer) |
->AddChild(lock_widget->GetNativeView()); |
lock_widget->Show(); |
+ |
+ // Simulate real screen locker to change session state to LOCKED |
+ // when it is shown. |
+ SessionController* controller = Shell::Get()->session_controller(); |
+ controller->LockScreenAndFlushForTest(); |
+ |
EXPECT_TRUE(controller->IsScreenLocked()); |
EXPECT_TRUE(lock_widget->GetNativeView()->HasFocus()); |