Index: ash/shell_unittest.cc |
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc |
index c79a092d893fef3472ce395760902cac01190684..5c78575072b1e8018e0b2082efbb27455aa652bd 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()); |