| Index: chrome/browser/ui/ash/shelf_browsertest.cc
|
| diff --git a/chrome/browser/ui/ash/shelf_browsertest.cc b/chrome/browser/ui/ash/shelf_browsertest.cc
|
| index 313fdef64b7b8022f8d05ac5c3b93a9e5be9ca83..7a3112ed7f0676091684ebb7432ee85a35cd7857 100644
|
| --- a/chrome/browser/ui/ash/shelf_browsertest.cc
|
| +++ b/chrome/browser/ui/ash/shelf_browsertest.cc
|
| @@ -2,10 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "ash/root_window_controller.h"
|
| +#include "ash/shelf/shelf.h"
|
| #include "ash/shelf/shelf_layout_manager.h"
|
| -#include "ash/shell.h"
|
| -#include "ash/wm/workspace_controller.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "chrome/browser/ui/browser.h"
|
| #include "chrome/browser/ui/browser_window.h"
|
| @@ -16,26 +14,27 @@ typedef InProcessBrowserTest ShelfBrowserTest;
|
|
|
| // Confirm that a status bubble doesn't cause the shelf to darken.
|
| IN_PROC_BROWSER_TEST_F(ShelfBrowserTest, StatusBubble) {
|
| - ash::ShelfLayoutManager* shelf =
|
| - ash::RootWindowController::ForShelf(
|
| - browser()->window()->GetNativeWindow())->GetShelfLayoutManager();
|
| - EXPECT_TRUE(shelf->IsVisible());
|
| + ash::ShelfLayoutManager* shelf_layout_manager =
|
| + ash::Shelf::ForWindow(browser()->window()->GetNativeWindow())
|
| + ->shelf_layout_manager();
|
| + EXPECT_TRUE(shelf_layout_manager->IsVisible());
|
|
|
| // Ensure that the browser abuts the shelf.
|
| - const gfx::Rect old_bounds = browser()->window()->GetBounds();
|
| - const gfx::Rect new_bounds(
|
| - old_bounds.x(),
|
| - old_bounds.y(),
|
| - old_bounds.width(),
|
| - shelf->GetIdealBounds().y() - old_bounds.y());
|
| - browser()->window()->SetBounds(new_bounds);
|
| - EXPECT_FALSE(shelf->window_overlaps_shelf());
|
| + gfx::Rect bounds = browser()->window()->GetBounds();
|
| + bounds.set_height(shelf_layout_manager->GetIdealBounds().y() - bounds.y());
|
| + browser()->window()->SetBounds(bounds);
|
| + EXPECT_FALSE(shelf_layout_manager->window_overlaps_shelf());
|
|
|
| - // Show status, which will overlap the shelf by a pixel.
|
| + // Show status, which may overlap the shelf by a pixel.
|
| browser()->window()->GetStatusBubble()->SetStatus(
|
| base::UTF8ToUTF16("Dummy Status Text"));
|
| - shelf->UpdateVisibilityState();
|
| + shelf_layout_manager->UpdateVisibilityState();
|
|
|
| // Ensure that status doesn't cause overlap.
|
| - EXPECT_FALSE(shelf->window_overlaps_shelf());
|
| + EXPECT_FALSE(shelf_layout_manager->window_overlaps_shelf());
|
| +
|
| + // Ensure that moving the browser slightly down does cause overlap.
|
| + bounds.Offset(0, 1);
|
| + browser()->window()->SetBounds(bounds);
|
| + EXPECT_TRUE(shelf_layout_manager->window_overlaps_shelf());
|
| }
|
|
|