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

Unified Diff: ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc

Issue 2093283002: mash: Convert all of //ash/system to use WmShelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
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 d86ed4d2a45470e09728cb205bb065b650d64608..72356a59c69e757190b6f98259afc3ad8ffb0989 100644
--- a/ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc
+++ b/ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc
@@ -16,8 +16,6 @@
#include "ash/common/wm_window.h"
#include "ash/display/display_manager.h"
#include "ash/screen_util.h"
-#include "ash/shelf/shelf.h"
-#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
#include "base/command_line.h"
@@ -48,12 +46,6 @@ class AshPopupAlignmentDelegateTest : public test::AshTestBase {
test::AshTestBase::TearDown();
}
- void SetKeyboardBounds(const gfx::Rect& new_bounds) {
- Shelf::ForPrimaryDisplay()
- ->shelf_layout_manager()
- ->OnKeyboardBoundsChanging(new_bounds);
- }
-
protected:
enum Position { TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT, OUTSIDE };
@@ -179,9 +171,8 @@ TEST_F(AshPopupAlignmentDelegateTest, AutoHide) {
// Create a window, otherwise autohide doesn't work.
std::unique_ptr<views::Widget> widget =
CreateTestWidget(kShellWindowId_DefaultContainer);
- Shelf* shelf = Shelf::ForPrimaryDisplay();
+ WmShelf* shelf = GetPrimaryShelf();
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());
}
@@ -203,8 +194,9 @@ TEST_F(AshPopupAlignmentDelegateTest, DockedWindow) {
EXPECT_FALSE(alignment_delegate()->IsFromLeft());
// Force dock to right-side
- GetPrimaryShelf()->SetAlignment(SHELF_ALIGNMENT_LEFT);
- GetPrimaryShelf()->SetAlignment(SHELF_ALIGNMENT_BOTTOM);
+ WmShelf* shelf = GetPrimaryShelf();
+ shelf->SetAlignment(SHELF_ALIGNMENT_LEFT);
+ shelf->SetAlignment(SHELF_ALIGNMENT_BOTTOM);
// Right-side dock should not affect popup alignment
EXPECT_EQ(origin_x, alignment_delegate()->GetToastOriginX(toast_size));
@@ -324,13 +316,14 @@ TEST_F(AshPopupAlignmentDelegateTest, MAYBE_KeyboardShowing) {
UpdateDisplay("600x600");
int baseline = alignment_delegate()->GetBaseLine();
+ WmShelf* shelf = GetPrimaryShelf();
gfx::Rect keyboard_bounds(0, 300, 600, 300);
- SetKeyboardBounds(keyboard_bounds);
+ shelf->SetKeyboardBoundsForTesting(keyboard_bounds);
int keyboard_baseline = alignment_delegate()->GetBaseLine();
EXPECT_NE(baseline, keyboard_baseline);
EXPECT_GT(keyboard_bounds.y(), keyboard_baseline);
- SetKeyboardBounds(gfx::Rect());
+ shelf->SetKeyboardBoundsForTesting(gfx::Rect());
EXPECT_EQ(baseline, alignment_delegate()->GetBaseLine());
}
« no previous file with comments | « ash/system/user/tray_user_unittest.cc ('k') | ash/system/web_notification/web_notification_tray_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698