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

Unified Diff: ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc

Issue 249723002: Fixing problem where applications are not getting centered when created after maximize mode starts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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/maximize_mode/maximize_mode_window_manager_unittest.cc
diff --git a/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc b/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc
index 2023b3c80193e5d06b75b9da589dc2107348ada3..d8c10f25ad17a08210e046955213c6dc04c7d110 100644
--- a/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc
+++ b/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc
@@ -271,7 +271,16 @@ TEST_F(MaximizeModeWindowManagerTest, CreateWindows) {
EXPECT_TRUE(wm::GetWindowState(w2.get())->IsMaximized());
EXPECT_EQ(3, manager->GetNumberOfManagedWindows());
EXPECT_FALSE(wm::GetWindowState(w3.get())->IsMaximized());
- EXPECT_NE(rect3.ToString(), w3->bounds().ToString());
+
+ // Make sure that the position of the unresizable window is in the middle of
+ // the screen.
+ gfx::Size work_area_size =
+ ScreenUtil::GetDisplayWorkAreaBoundsInParent(w3.get()).size();
+ gfx::Point center =
+ gfx::Point((work_area_size.width() - rect3.size().width()) / 2,
+ (work_area_size.height() - rect3.size().height()) / 2);
+ gfx::Rect centered_window_bounds = gfx::Rect(center, rect3.size());
+ EXPECT_EQ(centered_window_bounds.ToString(), w3->bounds().ToString());
// All other windows should not have been touched.
EXPECT_FALSE(wm::GetWindowState(w4.get())->IsMaximized());
« no previous file with comments | « no previous file | ash/wm/maximize_mode/maximize_mode_window_state.cc » ('j') | ash/wm/maximize_mode/maximize_mode_window_state.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698