| 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 0f67f728e08f88ee6553968b3090ea88b9bea88a..3976cb6a7a60cfeade5a49f8de110118b5632142 100644
|
| --- a/ash/shelf/shelf_layout_manager_unittest.cc
|
| +++ b/ash/shelf/shelf_layout_manager_unittest.cc
|
| @@ -1485,6 +1485,36 @@ TEST_F(ShelfLayoutManagerTest, ShelfAnimatesWhenGestureComplete) {
|
| }
|
| }
|
|
|
| +TEST_F(ShelfLayoutManagerTest, AutohideShelfForAutohideWhenActiveWindow) {
|
| + WmShelf* shelf = GetPrimaryShelf();
|
| +
|
| + views::Widget* widget_one = CreateTestWidget();
|
| + views::Widget* widget_two = CreateTestWidget();
|
| + aura::Window* window_two = widget_two->GetNativeWindow();
|
| +
|
| + // Turn on hide_shelf_when_active behavior for window two - shelf should
|
| + // auto-hide when window two is made active.
|
| + widget_one->Activate();
|
| + EXPECT_EQ(SHELF_VISIBLE, shelf->GetVisibilityState());
|
| + wm::GetWindowState(window_two)->set_hide_shelf_when_active(true);
|
| + widget_two->Activate();
|
| + EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState());
|
| +
|
| + // The hide_shelf_when_active flag should override the behavior of the
|
| + // hide_shelf_when_fullscreen flag even if the window is currently fullscreen.
|
| + wm::GetWindowState(window_two)->set_hide_shelf_when_fullscreen(false);
|
| + widget_two->SetFullscreen(true);
|
| + EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState());
|
| + wm::GetWindowState(window_two)->Restore();
|
| +
|
| + // With the flag off, shelf no longer auto-hides.
|
| + widget_one->Activate();
|
| + EXPECT_EQ(SHELF_VISIBLE, shelf->GetVisibilityState());
|
| + wm::GetWindowState(window_two)->set_hide_shelf_when_active(false);
|
| + widget_two->Activate();
|
| + EXPECT_EQ(SHELF_VISIBLE, shelf->GetVisibilityState());
|
| +}
|
| +
|
| TEST_F(ShelfLayoutManagerTest, ShelfFlickerOnTrayActivation) {
|
| // TODO: investigate failure in mash, http://crbug.com/695686.
|
| if (WmShell::Get()->IsRunningInMash())
|
|
|