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

Unified Diff: ash/wm/mru_window_tracker_unittest.cc

Issue 2258703002: Don't treat minimized windows as lower priority in MRU list (for Alt+Tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix mash Created 4 years, 4 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 | « ash/mus/wm/mru_window_tracker_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/mru_window_tracker_unittest.cc
diff --git a/ash/wm/mru_window_tracker_unittest.cc b/ash/wm/mru_window_tracker_unittest.cc
index afebbd767a077d899a997835aba11c8c45c2ca38..f5bf4348bb50c4573ed8aa362f56683960617a0b 100644
--- a/ash/wm/mru_window_tracker_unittest.cc
+++ b/ash/wm/mru_window_tracker_unittest.cc
@@ -51,8 +51,7 @@ TEST_F(MruWindowTrackerTest, Basic) {
EXPECT_EQ(w3.get(), window_list[2]);
}
-// Test that minimized windows are considered least recently used (but kept in
-// correct relative order).
+// Test that minimized windows are not treated specially.
TEST_F(MruWindowTrackerTest, MinimizedWindowsAreLru) {
std::unique_ptr<aura::Window> w1(CreateWindow());
std::unique_ptr<aura::Window> w2(CreateWindow());
@@ -71,16 +70,18 @@ TEST_F(MruWindowTrackerTest, MinimizedWindowsAreLru) {
wm::GetWindowState(w4.get())->Minimize();
wm::GetWindowState(w5.get())->Minimize();
- // Expect the relative order of minimized windows to remain the same, but all
- // minimized windows to be at the end of the list.
+ // By minimizing the first window, we activate w2 which will move it to the
+ // front of the MRU queue.
+ EXPECT_TRUE(wm::GetWindowState(w2.get())->IsActive());
+
aura::Window::Windows window_list =
WmWindowAura::ToAuraWindows(mru_window_tracker()->BuildMruWindowList());
EXPECT_EQ(w2.get(), window_list[0]);
- EXPECT_EQ(w3.get(), window_list[1]);
- EXPECT_EQ(w6.get(), window_list[2]);
- EXPECT_EQ(w1.get(), window_list[3]);
- EXPECT_EQ(w4.get(), window_list[4]);
- EXPECT_EQ(w5.get(), window_list[5]);
+ EXPECT_EQ(w1.get(), window_list[1]);
+ EXPECT_EQ(w3.get(), window_list[2]);
+ EXPECT_EQ(w4.get(), window_list[3]);
+ EXPECT_EQ(w5.get(), window_list[4]);
+ EXPECT_EQ(w6.get(), window_list[5]);
}
// Tests that windows being dragged are only in the WindowList once.
« no previous file with comments | « ash/mus/wm/mru_window_tracker_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698