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

Unified Diff: ash/shelf/shelf_layout_manager_unittest.cc

Issue 2583393002: Send notification to users upon receiving sms messages (Closed)
Patch Set: Created 3 years, 11 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 d3424f0e5f6d7d86e71a281db75b4c4acb2f3ad6..25848e0bf0e2c2d0ca720b76f594609058979fd0 100644
--- a/ash/shelf/shelf_layout_manager_unittest.cc
+++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -1524,42 +1524,24 @@ TEST_F(ShelfLayoutManagerTest, BubbleEnlargesShelfMouseHitArea) {
layout_manager->LayoutShelf();
ui::test::EventGenerator& generator(GetEventGenerator());
- // Make two iterations - first without a message bubble which should make
- // the shelf disappear and then with a message bubble which should keep it
- // visible.
- for (int i = 0; i < 2; i++) {
- // Make sure the shelf is visible and position the mouse over it. Then
- // allow auto hide.
- shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
- EXPECT_FALSE(status_area_widget->IsMessageBubbleShown());
- gfx::Point center =
- status_area_widget->GetWindowBoundsInScreen().CenterPoint();
- generator.MoveMouseTo(center.x(), center.y());
- shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
- EXPECT_TRUE(layout_manager->IsVisible());
- if (!i) {
- // In our first iteration we make sure there is no bubble.
- tray->CloseSystemBubble();
- EXPECT_FALSE(status_area_widget->IsMessageBubbleShown());
- } else {
- // In our second iteration we show a bubble.
- test::TestSystemTrayItem* item = new test::TestSystemTrayItem();
- tray->AddTrayItem(base::WrapUnique(item));
- tray->ShowNotificationView(item);
- EXPECT_TRUE(status_area_widget->IsMessageBubbleShown());
- }
- // Move the pointer over the edge of the shelf.
- generator.MoveMouseTo(
- center.x(), status_area_widget->GetWindowBoundsInScreen().y() - 8);
- layout_manager->UpdateVisibilityState();
- if (i) {
- EXPECT_TRUE(layout_manager->IsVisible());
- EXPECT_TRUE(status_area_widget->IsMessageBubbleShown());
- } else {
- EXPECT_FALSE(layout_manager->IsVisible());
- EXPECT_FALSE(status_area_widget->IsMessageBubbleShown());
- }
- }
+ // Make sure the shelf is visible and position the mouse over it. Then
+ // allow auto hide.
+ shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
+ EXPECT_FALSE(status_area_widget->IsMessageBubbleShown());
+ gfx::Point center =
+ status_area_widget->GetWindowBoundsInScreen().CenterPoint();
+ generator.MoveMouseTo(center.x(), center.y());
+ shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
+ EXPECT_TRUE(layout_manager->IsVisible());
+ // Make sure there is no bubble.
+ tray->CloseSystemBubble();
+ EXPECT_FALSE(status_area_widget->IsMessageBubbleShown());
+ // Move the pointer over the edge of the shelf.
+ generator.MoveMouseTo(center.x(),
+ status_area_widget->GetWindowBoundsInScreen().y() - 8);
+ layout_manager->UpdateVisibilityState();
+ EXPECT_FALSE(layout_manager->IsVisible());
+ EXPECT_FALSE(status_area_widget->IsMessageBubbleShown());
}
TEST_F(ShelfLayoutManagerTest, ShelfBackgroundColor) {

Powered by Google App Engine
This is Rietveld 408576698