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

Unified Diff: ash/root_window_controller_unittest.cc

Issue 18850003: Focus kept on login screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test fixed. Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/wm/event_client_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/root_window_controller_unittest.cc
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc
index 9896f95f74f071f8d21f7384855dcc79c7045c66..d1ced436f3bc89794370120861e25bd084d20d0f 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -387,5 +387,38 @@ TEST_F(RootWindowControllerTest, GetFullscreenWindow) {
EXPECT_EQ(w2->GetNativeWindow(), controller->GetFullscreenWindow());
}
+// Test that user session window can't be focused if user session blocked by
+// some overlapping UI.
+TEST_F(RootWindowControllerTest, FocusBlockedWindow) {
+ UpdateDisplay("600x600");
+ internal::RootWindowController* controller =
+ Shell::GetInstance()->GetPrimaryRootWindowController();
+ aura::Window* lock_container =
+ Shell::GetContainer(controller->root_window(),
+ internal::kShellWindowId_LockScreenContainer);
+ aura::Window* lock_window = Widget::CreateWindowWithParentAndBounds(NULL,
+ lock_container, gfx::Rect(0, 0, 100, 100))->GetNativeView();
+ lock_window->Show();
+ aura::Window* session_window =
+ CreateTestWidget(gfx::Rect(0, 0, 100, 100))->GetNativeView();
+ session_window->Show();
+
+ // Lock screen.
+ Shell::GetInstance()->session_state_delegate()->LockScreen();
+ lock_window->Focus();
+ EXPECT_TRUE(lock_window->HasFocus());
+ session_window->Focus();
+ EXPECT_FALSE(session_window->HasFocus());
+ Shell::GetInstance()->session_state_delegate()->UnlockScreen();
+
+ // Session not started yet.
+ SetSessionStarted(false);
+ lock_window->Focus();
+ EXPECT_TRUE(lock_window->HasFocus());
+ session_window->Focus();
+ EXPECT_FALSE(session_window->HasFocus());
+ SetSessionStarted(true);
+}
+
} // namespace test
} // namespace ash
« no previous file with comments | « no previous file | ash/wm/event_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698