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

Unified Diff: ash/wm/shelf_layout_manager_unittest.cc

Issue 10969076: Revert of AutoHide Behavior (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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/wm/shelf_layout_manager.cc ('k') | ash/wm/shelf_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/shelf_layout_manager_unittest.cc
diff --git a/ash/wm/shelf_layout_manager_unittest.cc b/ash/wm/shelf_layout_manager_unittest.cc
index e5a8d16b6bfd1d5cbd987cb32fb954fa5cc2c969..da982f8b6ef98ba21c9adbe8045819aeab7c809b 100644
--- a/ash/wm/shelf_layout_manager_unittest.cc
+++ b/ash/wm/shelf_layout_manager_unittest.cc
@@ -303,7 +303,6 @@ TEST_F(ShelfLayoutManagerTest, AutoHide) {
generator.MoveMouseTo(0, 0);
ShelfLayoutManager* shelf = GetShelfLayoutManager();
- shelf->SetAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
views::Widget* widget = new views::Widget;
views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
params.bounds = gfx::Rect(0, 0, 200, 200);
@@ -367,7 +366,6 @@ TEST_F(ShelfLayoutManagerTest, VisibleWhenLockScreenShowing) {
generator.MoveMouseTo(0, 0);
ShelfLayoutManager* shelf = GetShelfLayoutManager();
- shelf->SetAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
views::Widget* widget = new views::Widget;
views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
params.bounds = gfx::Rect(0, 0, 200, 200);
@@ -428,12 +426,20 @@ TEST_F(ShelfLayoutManagerTest, SetAutoHideBehavior) {
aura::Window* window = widget->GetNativeWindow();
gfx::Rect display_bounds(
gfx::Screen::GetDisplayNearestWindow(window).bounds());
+ EXPECT_EQ(display_bounds.bottom() - ShelfLayoutManager::kAutoHideSize,
+ shelf->GetMaximizedWindowBounds(window).bottom());
+ EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state());
shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE, shelf->visibility_state());
EXPECT_EQ(display_bounds.bottom() - ShelfLayoutManager::kAutoHideSize,
shelf->GetMaximizedWindowBounds(window).bottom());
+ shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT);
+ EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state());
+ EXPECT_EQ(display_bounds.bottom() - ShelfLayoutManager::kAutoHideSize,
+ shelf->GetMaximizedWindowBounds(window).bottom());
+
shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state());
EXPECT_GT(display_bounds.bottom() - ShelfLayoutManager::kAutoHideSize,
@@ -497,7 +503,7 @@ TEST_F(ShelfLayoutManagerTest, OpenAppListWithShelfVisibleState) {
Shell* shell = Shell::GetInstance();
ShelfLayoutManager* shelf = Shell::GetInstance()->shelf();
shelf->LayoutShelf();
- shell->SetShelfAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
+ shell->SetShelfAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT);
// Create a normal unmaximized windowm shelf should be visible.
aura::Window* window = CreateTestWindow();
@@ -524,7 +530,7 @@ TEST_F(ShelfLayoutManagerTest, OpenAppListWithShelfAutoHideState) {
Shell* shell = Shell::GetInstance();
ShelfLayoutManager* shelf = Shell::GetInstance()->shelf();
shelf->LayoutShelf();
- shell->SetShelfAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
+ shell->SetShelfAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT);
// Create a window and show it in maximized state.
aura::Window* window = CreateTestWindow();
« no previous file with comments | « ash/wm/shelf_layout_manager.cc ('k') | ash/wm/shelf_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698