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

Unified Diff: ash/shelf/shelf_layout_manager_unittest.cc

Issue 2583393002: Send notification to users upon receiving sms messages (Closed)
Patch Set: update return type Created 3 years, 10 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 47ee97d2fbe8dd2bb3be826a85abf277eaeb4572..ed605a46aef5f55bb4a59e68ad2a97d40e86b8d3 100644
--- a/ash/shelf/shelf_layout_manager_unittest.cc
+++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -1537,42 +1537,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, BackgroundTypeWhenLockingScreen) {

Powered by Google App Engine
This is Rietveld 408576698