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

Unified Diff: ash/shelf/shelf_view_unittest.cc

Issue 2886253002: mash: remove more shell/shelf WmWindow usage. (Closed)
Patch Set: Fix WmShelf::ForWindow. Created 3 years, 7 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/shelf/shelf_view.cc ('k') | ash/shelf/shelf_widget_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_view_unittest.cc
diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc
index 016dded06ca146b75dc1952097035eeff2e94fdf..7d579c9d5078ad868b92f83c5a6115831dd5fed7 100644
--- a/ash/shelf/shelf_view_unittest.cc
+++ b/ash/shelf/shelf_view_unittest.cc
@@ -195,8 +195,7 @@ TEST_F(WmShelfObserverIconTest, AddRemoveWithMultipleDisplays) {
UpdateDisplay("400x400,400x400");
observer()->Reset();
- WmWindow* second_root = ShellPort::Get()->GetAllRootWindows()[1];
- WmShelf* second_shelf = second_root->GetRootWindowController()->GetShelf();
+ WmShelf* second_shelf = WmShelf::ForWindow(Shell::GetAllRootWindows()[1]);
TestWmShelfObserver second_observer(second_shelf);
ShelfItem item;
@@ -1642,8 +1641,7 @@ TEST_F(ShelfViewTest, CheckDragInsertBoundsOfScrolledOverflowBubble) {
// Check the drag insertion bounds of shelf view in multi monitor environment.
TEST_F(ShelfViewTest, CheckDragInsertBoundsWithMultiMonitor) {
UpdateDisplay("800x600,800x600");
- WmShelf* secondary_shelf =
- WmShelf::ForWindow(ShellPort::Get()->GetAllRootWindows()[1]);
+ WmShelf* secondary_shelf = WmShelf::ForWindow(Shell::GetAllRootWindows()[1]);
ShelfView* shelf_view_for_secondary =
secondary_shelf->GetShelfViewForTesting();
@@ -1708,8 +1706,7 @@ TEST_F(ShelfViewTest, CheckRipOffFromLeftShelfAlignmentWithMultiMonitor) {
UpdateDisplay("800x600,800x600");
ASSERT_EQ(2U, ShellPort::Get()->GetAllRootWindows().size());
- WmWindow* second_root = ShellPort::Get()->GetAllRootWindows()[1];
- WmShelf* secondary_shelf = second_root->GetRootWindowController()->GetShelf();
+ WmShelf* secondary_shelf = WmShelf::ForWindow(Shell::GetAllRootWindows()[1]);
secondary_shelf->SetAlignment(SHELF_ALIGNMENT_LEFT);
ASSERT_EQ(SHELF_ALIGNMENT_LEFT, secondary_shelf->alignment());
@@ -1728,7 +1725,8 @@ TEST_F(ShelfViewTest, CheckRipOffFromLeftShelfAlignmentWithMultiMonitor) {
// Fetch the start point of dragging.
gfx::Point start_point = button->GetBoundsInScreen().CenterPoint();
- start_point = second_root->ConvertPointFromScreen(start_point);
+ start_point =
+ secondary_shelf->GetWindow()->ConvertPointFromScreen(start_point);
ui::test::EventGenerator generator(Shell::GetAllRootWindows()[1],
start_point);
« no previous file with comments | « ash/shelf/shelf_view.cc ('k') | ash/shelf/shelf_widget_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698