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

Unified Diff: ash/shelf/shelf_layout_manager_unittest.cc

Issue 16093036: Do not create a workspace for a maximized window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test failure Created 7 years, 6 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 | « no previous file | ash/wm/frame_painter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_layout_manager_unittest.cc
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc
index 15bab6409c158c53fc93266915d8ca2331141432..fd308bafaf360c80a44665815feaf4edbb41693a 100644
--- a/ash/shelf/shelf_layout_manager_unittest.cc
+++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -1363,34 +1363,27 @@ TEST_F(ShelfLayoutManagerTest, WorkAreaChangeWorkspace) {
// Both windows are maximized. They should be of the same size.
EXPECT_EQ(widget_one->GetNativeWindow()->bounds().ToString(),
widget_two->GetNativeWindow()->bounds().ToString());
+ int area_when_shelf_shown =
+ widget_one->GetNativeWindow()->bounds().size().GetArea();
// Now hide the shelf.
shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
- // The active maximized window will get resized to the new work area. However,
- // the inactive window should not get resized.
- EXPECT_NE(widget_one->GetNativeWindow()->bounds().ToString(),
- widget_two->GetNativeWindow()->bounds().ToString());
-
- // Activate the first window. Now, both windows should be of the same size
- // again.
- widget_one->Activate();
+ // Both windows should be resized according to the shelf status.
EXPECT_EQ(widget_one->GetNativeWindow()->bounds().ToString(),
widget_two->GetNativeWindow()->bounds().ToString());
+ // Resized to small.
+ EXPECT_LT(area_when_shelf_shown,
+ widget_one->GetNativeWindow()->bounds().size().GetArea());
// Now show the shelf.
shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
- // The active maximized window will get resized to the new work area. However,
- // the inactive window should not get resized.
- EXPECT_NE(widget_one->GetNativeWindow()->bounds().ToString(),
- widget_two->GetNativeWindow()->bounds().ToString());
-
- // Activate the first window. Now, both windows should be of the same size
- // again.
- widget_two->Activate();
+ // Again both windows should be of the same size.
EXPECT_EQ(widget_one->GetNativeWindow()->bounds().ToString(),
widget_two->GetNativeWindow()->bounds().ToString());
+ EXPECT_EQ(area_when_shelf_shown,
+ widget_one->GetNativeWindow()->bounds().size().GetArea());
}
// Confirm that the shelf is dimmed only when content is maximized and
« no previous file with comments | « no previous file | ash/wm/frame_painter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698