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

Unified Diff: ash/wm/base_layout_manager_unittest.cc

Issue 9764008: Makes the launcher auto-hide for maximized windows. This turned out to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add null checks and cleanup Created 8 years, 9 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/base_layout_manager_unittest.cc
diff --git a/ash/wm/base_layout_manager_unittest.cc b/ash/wm/base_layout_manager_unittest.cc
index fdb764957924f313d72e1005a53299b85c79b3c3..3faca21eab54ed17b5e884b273b4d0bfb2823809 100644
--- a/ash/wm/base_layout_manager_unittest.cc
+++ b/ash/wm/base_layout_manager_unittest.cc
@@ -52,10 +52,10 @@ TEST_F(BaseLayoutManagerTest, Maximize) {
scoped_ptr<aura::Window> window(CreateTestWindow(bounds));
window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
// Maximized window fills the work area, not the whole monitor.
- EXPECT_EQ(gfx::Screen::GetMonitorWorkAreaNearestWindow(window.get()),
- window->bounds());
+ EXPECT_EQ(ScreenAsh::GetMaximizedWindowBounds(window.get()).ToString(),
+ window->bounds().ToString());
window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
- EXPECT_EQ(bounds, window->bounds());
+ EXPECT_EQ(bounds.ToString(), window->bounds().ToString());
}
// Tests normal->minimize->normal.
@@ -65,9 +65,9 @@ TEST_F(BaseLayoutManagerTest, Minimize) {
window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
// Note: Currently minimize doesn't do anything except set the state.
// See crbug.com/104571.
- EXPECT_EQ(bounds, window->bounds());
+ EXPECT_EQ(bounds.ToString(), window->bounds().ToString());
window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
- EXPECT_EQ(bounds, window->bounds());
+ EXPECT_EQ(bounds.ToString(), window->bounds().ToString());
}
// Tests maximized window size during root window resize.
@@ -75,12 +75,15 @@ TEST_F(BaseLayoutManagerTest, MaximizeRootWindowResize) {
gfx::Rect bounds(100, 100, 200, 200);
scoped_ptr<aura::Window> window(CreateTestWindow(bounds));
window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
- EXPECT_EQ(gfx::Screen::GetMonitorWorkAreaNearestWindow(window.get()),
- window->bounds());
+ gfx::Rect initial_work_area_bounds =
+ ScreenAsh::GetMaximizedWindowBounds(window.get());
+ EXPECT_EQ(initial_work_area_bounds.ToString(), window->bounds().ToString());
// Enlarge the root window. We should still match the work area size.
- Shell::GetRootWindow()->SetHostSize(gfx::Size(800, 600));
- EXPECT_EQ(gfx::Screen::GetMonitorWorkAreaNearestWindow(window.get()),
- window->bounds());
+ Shell::GetRootWindow()->SetHostSize(gfx::Size(900, 700));
+ EXPECT_EQ(ScreenAsh::GetMaximizedWindowBounds(window.get()).ToString(),
+ window->bounds().ToString());
+ EXPECT_NE(initial_work_area_bounds.ToString(),
+ ScreenAsh::GetMaximizedWindowBounds(window.get()).ToString());
}
// Tests normal->fullscreen->normal.
@@ -89,10 +92,10 @@ TEST_F(BaseLayoutManagerTest, Fullscreen) {
scoped_ptr<aura::Window> window(CreateTestWindow(bounds));
window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
// Fullscreen window fills the whole monitor.
- EXPECT_EQ(gfx::Screen::GetMonitorAreaNearestWindow(window.get()),
- window->bounds());
+ EXPECT_EQ(gfx::Screen::GetMonitorAreaNearestWindow(window.get()).ToString(),
+ window->bounds().ToString());
window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
- EXPECT_EQ(bounds, window->bounds());
+ EXPECT_EQ(bounds.ToString(), window->bounds().ToString());
}
// Tests fullscreen window size during root window resize.
@@ -101,12 +104,12 @@ TEST_F(BaseLayoutManagerTest, FullscreenRootWindowResize) {
scoped_ptr<aura::Window> window(CreateTestWindow(bounds));
// Fullscreen window fills the whole monitor.
window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
- EXPECT_EQ(gfx::Screen::GetMonitorAreaNearestWindow(window.get()),
- window->bounds());
+ EXPECT_EQ(gfx::Screen::GetMonitorAreaNearestWindow(window.get()).ToString(),
+ window->bounds().ToString());
// Enlarge the root window. We should still match the monitor size.
Shell::GetRootWindow()->SetHostSize(gfx::Size(800, 600));
- EXPECT_EQ(gfx::Screen::GetMonitorAreaNearestWindow(window.get()),
- window->bounds());
+ EXPECT_EQ(gfx::Screen::GetMonitorAreaNearestWindow(window.get()).ToString(),
+ window->bounds().ToString());
}
// Fails on Mac only. Need to be implemented. http://crbug.com/111279.

Powered by Google App Engine
This is Rietveld 408576698