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

Unified Diff: ash/shelf/shelf_layout_manager_unittest.cc

Issue 23928004: ash:Shelf - Update position and hit box of status area. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 3 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/shelf/shelf_layout_manager_unittest.cc
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc
index 8cd40d9737268249a3c895a456db08e4f50feb17..cca24308569fc3c44acdf34d7e3a71db28b0af36 100644
--- a/ash/shelf/shelf_layout_manager_unittest.cc
+++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -1836,5 +1836,39 @@ TEST_F(ShelfLayoutManagerTest, ShelfBackgroundColorAutoHide) {
EXPECT_EQ(SHELF_BACKGROUND_OVERLAP, GetShelfWidget()->GetBackgroundType());
}
+// Verify the hit bounds of the status area extend to the edge of the shelf.
+TEST_F(ShelfLayoutManagerTest, StatusAreaHitBoxCoversEdge) {
+ UpdateDisplay("400x400");
+ ShelfLayoutManager* shelf = GetShelfLayoutManager();
+ StatusAreaWidget* status_area_widget =
+ Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget();
+ aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow());
+ generator.MoveMouseTo(399,399);
+
+ // Test bottom right pixel for bottom alignment.
+ EXPECT_FALSE(status_area_widget->IsMessageBubbleShown());
+ generator.ClickLeftButton();
+ EXPECT_TRUE(status_area_widget->IsMessageBubbleShown());
+ generator.ClickLeftButton();
+ EXPECT_FALSE(status_area_widget->IsMessageBubbleShown());
+
+ // Test bottom right pixel for right alignment.
+ shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT);
+ EXPECT_FALSE(status_area_widget->IsMessageBubbleShown());
+ generator.ClickLeftButton();
+ EXPECT_TRUE(status_area_widget->IsMessageBubbleShown());
+ generator.ClickLeftButton();
+ EXPECT_FALSE(status_area_widget->IsMessageBubbleShown());
+
+ // Test bottom left pixel for left alignment.
James Cook 2013/09/18 01:36:07 Nice, I didn't think of that case. Good test.
+ generator.MoveMouseTo(0, 399);
+ shelf->SetAlignment(SHELF_ALIGNMENT_LEFT);
+ EXPECT_FALSE(status_area_widget->IsMessageBubbleShown());
+ generator.ClickLeftButton();
+ EXPECT_TRUE(status_area_widget->IsMessageBubbleShown());
+ generator.ClickLeftButton();
+ EXPECT_FALSE(status_area_widget->IsMessageBubbleShown());
+}
+
} // namespace internal
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698