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

Unified Diff: ash/shelf/shelf_view_unittest.cc

Issue 2020623004: ash: Move shelf alignment and auto-hide calls from Shell to Shelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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_layout_manager.h ('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 bf8d27d90d522dc7562922edc099e89c8c967045..e83387b7f3a7ed603628bc9bf2862affd962aa35 100644
--- a/ash/shelf/shelf_view_unittest.cc
+++ b/ash/shelf/shelf_view_unittest.cc
@@ -1433,8 +1433,7 @@ TEST_F(ShelfViewTest, RemovingItemClosesTooltip) {
EXPECT_FALSE(tooltip_manager->IsVisible());
// Change the shelf layout. This should not crash.
- Shell::GetInstance()->SetShelfAlignment(wm::SHELF_ALIGNMENT_LEFT,
- Shell::GetPrimaryRootWindow());
+ Shelf::ForPrimaryDisplay()->SetAlignment(wm::SHELF_ALIGNMENT_LEFT);
}
// Changing the shelf alignment closes any open tooltip.
@@ -1450,8 +1449,7 @@ TEST_F(ShelfViewTest, ShelfAlignmentClosesTooltip) {
EXPECT_TRUE(tooltip_manager->IsVisible());
// Changing shelf alignment hides the tooltip.
- Shell::GetInstance()->SetShelfAlignment(wm::SHELF_ALIGNMENT_LEFT,
- Shell::GetPrimaryRootWindow());
+ Shelf::ForPrimaryDisplay()->SetAlignment(wm::SHELF_ALIGNMENT_LEFT);
EXPECT_FALSE(tooltip_manager->IsVisible());
}
@@ -1790,18 +1788,16 @@ TEST_F(ShelfViewTest, CheckRipOffFromLeftShelfAlignmentWithMultiMonitor) {
ASSERT_EQ(2U, Shell::GetAllRootWindows().size());
aura::Window* second_root = Shell::GetAllRootWindows()[1];
+ Shelf* secondary_shelf = Shelf::ForWindow(second_root);
- Shell::GetInstance()->SetShelfAlignment(wm::SHELF_ALIGNMENT_LEFT,
- second_root);
- ASSERT_EQ(wm::SHELF_ALIGNMENT_LEFT,
- Shell::GetInstance()->GetShelfAlignment(second_root));
+ secondary_shelf->SetAlignment(wm::SHELF_ALIGNMENT_LEFT);
+ ASSERT_EQ(wm::SHELF_ALIGNMENT_LEFT, secondary_shelf->alignment());
// Initially, app list and browser shortcut are added.
EXPECT_EQ(2, model_->item_count());
int browser_index = model_->GetItemIndexForType(TYPE_BROWSER_SHORTCUT);
EXPECT_GT(browser_index, 0);
- Shelf* secondary_shelf = Shelf::ForWindow(second_root);
ShelfView* shelf_view_for_secondary =
ShelfTestAPI(secondary_shelf).shelf_view();
« no previous file with comments | « ash/shelf/shelf_layout_manager.h ('k') | ash/shelf/shelf_widget_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698