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

Unified Diff: ash/shelf/shelf_widget_unittest.cc

Issue 2017413002: ash: Fix variable names and setters in ShelfLayoutManager and tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shellshelf
Patch Set: review comments 3 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_view_unittest.cc ('k') | ash/system/toast/toast_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_widget_unittest.cc
diff --git a/ash/shelf/shelf_widget_unittest.cc b/ash/shelf/shelf_widget_unittest.cc
index 403cc204a5b1d26c03429f781032ba1593f549f2..bb92a772674aad4e484a82459dc20b134849e754 100644
--- a/ash/shelf/shelf_widget_unittest.cc
+++ b/ash/shelf/shelf_widget_unittest.cc
@@ -228,7 +228,8 @@ TEST_F(ShelfWidgetTest, ShelfEdgeOverlappingWindowHitTestMouse) {
}
// Change shelf alignment to verify that the targeter insets are updated.
- shelf_layout_manager->SetAlignment(wm::SHELF_ALIGNMENT_LEFT);
+ Shelf* shelf = Shelf::ForPrimaryDisplay();
+ shelf->SetAlignment(wm::SHELF_ALIGNMENT_LEFT);
shelf_layout_manager->LayoutShelf();
shelf_bounds = shelf_widget->GetWindowBoundsInScreen();
{
@@ -243,8 +244,8 @@ TEST_F(ShelfWidgetTest, ShelfEdgeOverlappingWindowHitTestMouse) {
}
// Now restore shelf alignment (bottom) and auto-hide (hidden) the shelf.
- shelf_layout_manager->SetAlignment(wm::SHELF_ALIGNMENT_BOTTOM);
- shelf_layout_manager->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
+ shelf->SetAlignment(wm::SHELF_ALIGNMENT_BOTTOM);
+ shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
shelf_layout_manager->LayoutShelf();
EXPECT_EQ(SHELF_AUTO_HIDE, shelf_layout_manager->visibility_state());
EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_layout_manager->auto_hide_state());
@@ -271,6 +272,7 @@ TEST_F(ShelfWidgetTest, ShelfEdgeOverlappingWindowHitTestMouse) {
// Tests that the shelf has a slightly larger hit-region for touch-events when
// it's in the auto-hidden state.
TEST_F(ShelfWidgetTest, HiddenShelfHitTestTouch) {
+ Shelf* shelf = Shelf::ForPrimaryDisplay();
ShelfWidget* shelf_widget = GetShelfWidget();
gfx::Rect shelf_bounds = shelf_widget->GetWindowBoundsInScreen();
EXPECT_TRUE(!shelf_bounds.IsEmpty());
@@ -301,7 +303,7 @@ TEST_F(ShelfWidgetTest, HiddenShelfHitTestTouch) {
}
// Now auto-hide (hidden) the shelf.
- shelf_layout_manager->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
+ shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
shelf_layout_manager->LayoutShelf();
EXPECT_EQ(SHELF_AUTO_HIDE, shelf_layout_manager->visibility_state());
EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_layout_manager->auto_hide_state());
@@ -416,9 +418,8 @@ class ShelfWidgetTestWithDelegate : public ShelfWidgetTest {
shelf_widget->shelf_layout_manager();
ASSERT_NE(nullptr, shelf_layout_manager);
- EXPECT_EQ(initial_alignment, shelf_layout_manager->GetAlignment());
- EXPECT_EQ(initial_auto_hide_behavior,
- shelf_layout_manager->auto_hide_behavior());
+ EXPECT_EQ(initial_alignment, shelf->alignment());
+ EXPECT_EQ(initial_auto_hide_behavior, shelf->auto_hide_behavior());
EXPECT_EQ(expected_shelf_visibility_state,
shelf_layout_manager->visibility_state());
EXPECT_EQ(expected_shelf_auto_hide_state,
« no previous file with comments | « ash/shelf/shelf_view_unittest.cc ('k') | ash/system/toast/toast_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698