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

Unified Diff: ash/wm/window_cycle_controller_unittest.cc

Issue 9181012: Don't activate a window if screen is locked. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 11 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
Index: ash/wm/window_cycle_controller_unittest.cc
diff --git a/ash/wm/window_cycle_controller_unittest.cc b/ash/wm/window_cycle_controller_unittest.cc
index a747884e1193fb2479af20b15a946c172f75a070..eecdfbc7353e7928b2e5837a1984c5c35db2dead 100644
--- a/ash/wm/window_cycle_controller_unittest.cc
+++ b/ash/wm/window_cycle_controller_unittest.cc
@@ -44,6 +44,7 @@ TEST_F(WindowCycleControllerTest, HandleCycleWindowBaseCases) {
ash::Shell::GetInstance()->GetContainer(
internal::kShellWindowId_DefaultContainer);
scoped_ptr<Window> window0(CreateTestWindowWithId(0, default_container));
+ window0->Show();
ActivateWindow(window0.get());
EXPECT_TRUE(IsActiveWindow(window0.get()));
@@ -64,6 +65,9 @@ TEST_F(WindowCycleControllerTest, HandleCycleWindow) {
scoped_ptr<Window> window2(CreateTestWindowWithId(2, default_container));
scoped_ptr<Window> window1(CreateTestWindowWithId(1, default_container));
scoped_ptr<Window> window0(CreateTestWindowWithId(0, default_container));
+ window0->Show();
+ window1->Show();
+ window2->Show();
ActivateWindow(window0.get());
// Window lists should return the topmost window in front.
@@ -129,11 +133,10 @@ TEST_F(WindowCycleControllerTest, HandleCycleWindow) {
EXPECT_TRUE(IsActiveWindow(window0.get()));
// When a screen lock window is visible, cycling window does not take effect.
- aura::Window* lock_screen_container =
- Shell::GetInstance()->GetContainer(
- internal::kShellWindowId_LockScreenContainer);
scoped_ptr<Window> lock_screen_window(
- CreateTestWindowWithId(-1, lock_screen_container));
+ CreateTestWindowWithId(-1, default_container));
+ lock_screen_window->set_stops_event_propagation(true);
+ lock_screen_window->SetParent(NULL);
lock_screen_window->Show();
EXPECT_TRUE(IsActiveWindow(window0.get()));
controller->HandleCycleWindow(WindowCycleController::FORWARD, false);
@@ -155,6 +158,7 @@ TEST_F(WindowCycleControllerTest, HandleCycleWindow) {
internal::kShellWindowId_AlwaysOnTopContainer);
scoped_ptr<Window> modal_window(
CreateTestWindowWithId(-2, modal_container));
+ modal_window->Show();
ActivateWindow(modal_window.get());
EXPECT_TRUE(IsActiveWindow(modal_window.get()));
controller->HandleCycleWindow(WindowCycleController::FORWARD, false);

Powered by Google App Engine
This is Rietveld 408576698