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

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: maybe 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
« no previous file with comments | « ash/shelf/shelf_layout_manager.cc ('k') | ash/system/status_area_widget_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5ef7039e66a3fcb8082e0e2e7dee14521fec054e 100644
--- a/ash/shelf/shelf_layout_manager_unittest.cc
+++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -1836,5 +1836,45 @@ TEST_F(ShelfLayoutManagerTest, ShelfBackgroundColorAutoHide) {
EXPECT_EQ(SHELF_BACKGROUND_OVERLAP, GetShelfWidget()->GetBackgroundType());
}
+#if defined(OS_CHROMEOS)
+#define MAYBE_StatusAreaHitBoxCoversEdge StatusAreaHitBoxCoversEdge
+#else
+#define MAYBE_StatusAreaHitBoxCoversEdge DISABLED_StatusAreaHitBoxCoversEdge
+#endif
+
+// Verify the hit bounds of the status area extend to the edge of the shelf.
+TEST_F(ShelfLayoutManagerTest, MAYBE_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.
+ 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
« no previous file with comments | « ash/shelf/shelf_layout_manager.cc ('k') | ash/system/status_area_widget_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698