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

Unified Diff: ash/system/web_notification/ash_popup_alignment_delegate_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/shell_unittest.cc ('k') | ash/sysui/context_menu_mus.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc
diff --git a/ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc b/ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc
index ef0d7af7c8953f2b6fd409c148787b1305b82009..e054ea971d248e338edebb8c3809edd76c240000 100644
--- a/ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc
+++ b/ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc
@@ -120,16 +120,14 @@ TEST_F(AshPopupAlignmentDelegateTest, MAYBE_ShelfAlignment) {
EXPECT_FALSE(alignment_delegate()->IsTopDown());
EXPECT_FALSE(alignment_delegate()->IsFromLeft());
- Shell::GetInstance()->SetShelfAlignment(wm::SHELF_ALIGNMENT_RIGHT,
- Shell::GetPrimaryRootWindow());
+ Shelf::ForPrimaryDisplay()->SetAlignment(wm::SHELF_ALIGNMENT_RIGHT);
toast_point.set_x(alignment_delegate()->GetToastOriginX(toast_size));
toast_point.set_y(alignment_delegate()->GetBaseLine());
EXPECT_EQ(BOTTOM_RIGHT, GetPositionInDisplay(toast_point));
EXPECT_FALSE(alignment_delegate()->IsTopDown());
EXPECT_FALSE(alignment_delegate()->IsFromLeft());
- Shell::GetInstance()->SetShelfAlignment(wm::SHELF_ALIGNMENT_LEFT,
- Shell::GetPrimaryRootWindow());
+ Shelf::ForPrimaryDisplay()->SetAlignment(wm::SHELF_ALIGNMENT_LEFT);
toast_point.set_x(alignment_delegate()->GetToastOriginX(toast_size));
toast_point.set_y(alignment_delegate()->GetBaseLine());
EXPECT_EQ(BOTTOM_LEFT, GetPositionInDisplay(toast_point));
@@ -143,8 +141,7 @@ TEST_F(AshPopupAlignmentDelegateTest, LockScreen) {
const gfx::Rect toast_size(0, 0, 10, 10);
- Shell::GetInstance()->SetShelfAlignment(wm::SHELF_ALIGNMENT_LEFT,
- Shell::GetPrimaryRootWindow());
+ Shelf::ForPrimaryDisplay()->SetAlignment(wm::SHELF_ALIGNMENT_LEFT);
gfx::Point toast_point;
toast_point.set_x(alignment_delegate()->GetToastOriginX(toast_size));
toast_point.set_y(alignment_delegate()->GetBaseLine());
@@ -168,10 +165,9 @@ TEST_F(AshPopupAlignmentDelegateTest, AutoHide) {
// Create a window, otherwise autohide doesn't work.
std::unique_ptr<aura::Window> window(CreateTestWindowInShellWithId(0));
- Shell::GetInstance()->SetShelfAutoHideBehavior(
- SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
- Shell::GetPrimaryRootWindow());
- Shelf::ForPrimaryDisplay()->shelf_layout_manager()->UpdateAutoHideStateNow();
+ Shelf* shelf = Shelf::ForPrimaryDisplay();
+ shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
+ shelf->shelf_layout_manager()->UpdateAutoHideStateNow();
EXPECT_EQ(origin_x, alignment_delegate()->GetToastOriginX(toast_size));
EXPECT_LT(baseline, alignment_delegate()->GetBaseLine());
}
@@ -197,10 +193,8 @@ TEST_F(AshPopupAlignmentDelegateTest, DockedWindow) {
EXPECT_FALSE(alignment_delegate()->IsFromLeft());
// Force dock to right-side
- Shell::GetInstance()->SetShelfAlignment(wm::SHELF_ALIGNMENT_LEFT,
- Shell::GetPrimaryRootWindow());
- Shell::GetInstance()->SetShelfAlignment(wm::SHELF_ALIGNMENT_BOTTOM,
- Shell::GetPrimaryRootWindow());
+ Shelf::ForPrimaryDisplay()->SetAlignment(wm::SHELF_ALIGNMENT_LEFT);
+ Shelf::ForPrimaryDisplay()->SetAlignment(wm::SHELF_ALIGNMENT_BOTTOM);
// Right-side dock should not affect popup alignment
EXPECT_EQ(origin_x, alignment_delegate()->GetToastOriginX(toast_size));
« no previous file with comments | « ash/shell_unittest.cc ('k') | ash/sysui/context_menu_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698