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

Unified Diff: ash/wm/shelf_layout_manager_unittest.cc

Issue 10987005: Autohide behavior simplified to always/never (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 dacc7617a2ee5d829044501eae67236d901d7b2c..68b85d0e136b7d103e12944fa0fde8e89cb4b220 100644
--- a/ash/wm/shelf_layout_manager_unittest.cc
+++ b/ash/wm/shelf_layout_manager_unittest.cc
@@ -303,6 +303,7 @@ 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);
@@ -366,6 +367,7 @@ 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);
@@ -426,20 +428,12 @@ 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,
@@ -503,7 +497,7 @@ TEST_F(ShelfLayoutManagerTest, OpenAppListWithShelfVisibleState) {
Shell* shell = Shell::GetInstance();
ShelfLayoutManager* shelf = Shell::GetInstance()->shelf();
shelf->LayoutShelf();
- shell->SetShelfAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT);
+ shell->SetShelfAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
// Create a normal unmaximized windowm shelf should be visible.
aura::Window* window = CreateTestWindow();
@@ -530,7 +524,7 @@ TEST_F(ShelfLayoutManagerTest, OpenAppListWithShelfAutoHideState) {
Shell* shell = Shell::GetInstance();
ShelfLayoutManager* shelf = Shell::GetInstance()->shelf();
shelf->LayoutShelf();
- shell->SetShelfAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT);
+ shell->SetShelfAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
// 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