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

Unified Diff: ash/wm/window_cycle_controller_unittest.cc

Issue 2389323002: Start Alt+Tab on MRU instead of MRU+1 if all windows are minimized. (Closed)
Patch Set: Created 4 years, 2 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
« ash/common/wm/window_cycle_list.cc ('K') | « ash/common/wm/window_cycle_list.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c8130f31b5d62f315f8d490938188da69ada3762..c8606a68ed589c985fb93c9b4a7f334702cf4826 100644
--- a/ash/wm/window_cycle_controller_unittest.cc
+++ b/ash/wm/window_cycle_controller_unittest.cc
@@ -295,6 +295,35 @@ TEST_F(WindowCycleControllerTest, Minimized) {
EXPECT_TRUE(window0_state->IsActive());
}
+// If all windows are minimized, start on the first one rather than the second
varkha 2016/10/06 03:31:08 Nit: "Tests that when all windows are minimized, c
Evan Stade 2016/10/06 15:40:33 Done.
+// one.
+TEST_F(WindowCycleControllerTest, AllAreMinimized) {
+ // Create a couple of test windows.
+ std::unique_ptr<Window> window0(CreateTestWindowInShellWithId(0));
+ std::unique_ptr<Window> window1(CreateTestWindowInShellWithId(1));
+ wm::WindowState* window0_state = wm::GetWindowState(window0.get());
+ wm::WindowState* window1_state = wm::GetWindowState(window1.get());
+
+ window0_state->Minimize();
+ window1_state->Minimize();
+
+ WindowCycleController* controller = WmShell::Get()->window_cycle_controller();
+ controller->HandleCycleWindow(WindowCycleController::FORWARD);
+ controller->StopCycling();
+ EXPECT_TRUE(window0_state->IsActive());
+ EXPECT_FALSE(window0_state->IsMinimized());
+ EXPECT_TRUE(window1_state->IsMinimized());
+
+ // But it's business as usual when cycling backwards.
+ window0_state->Minimize();
+ window1_state->Minimize();
varkha 2016/10/06 03:31:08 Redundant?
Evan Stade 2016/10/06 15:40:33 seems harmless but improves legibility
+ controller->HandleCycleWindow(WindowCycleController::BACKWARD);
+ controller->StopCycling();
+ EXPECT_TRUE(window0_state->IsMinimized());
+ EXPECT_TRUE(window1_state->IsActive());
+ EXPECT_FALSE(window1_state->IsMinimized());
+}
+
TEST_F(WindowCycleControllerTest, AlwaysOnTopWindow) {
WindowCycleController* controller = WmShell::Get()->window_cycle_controller();
« ash/common/wm/window_cycle_list.cc ('K') | « ash/common/wm/window_cycle_list.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698