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

Unified Diff: chrome/browser/ui/ash/shelf_browsertest.cc

Issue 1743493002: Cleanup ash shelf accessor functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert ash/shelf/shelf_widget.cc for browser_tests crash... Created 4 years, 10 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 | « chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698