| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/common/system/web_notification/web_notification_tray.h" | 5 #include "ash/common/system/web_notification/web_notification_tray.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/common/material_design/material_design_controller.h" | 10 #include "ash/common/material_design/material_design_controller.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 GetTray()->ShowPopups(); | 259 GetTray()->ShowPopups(); |
| 260 EXPECT_TRUE(GetTray()->IsPopupVisible()); | 260 EXPECT_TRUE(GetTray()->IsPopupVisible()); |
| 261 EXPECT_EQ(notifications_to_add, GetMessageCenter()->NotificationCount()); | 261 EXPECT_EQ(notifications_to_add, GetMessageCenter()->NotificationCount()); |
| 262 NotificationList::PopupNotifications popups = | 262 NotificationList::PopupNotifications popups = |
| 263 GetMessageCenter()->GetPopupNotifications(); | 263 GetMessageCenter()->GetPopupNotifications(); |
| 264 EXPECT_EQ(message_center::kMaxVisiblePopupNotifications, popups.size()); | 264 EXPECT_EQ(message_center::kMaxVisiblePopupNotifications, popups.size()); |
| 265 } | 265 } |
| 266 | 266 |
| 267 // Verifies if the notification appears on both displays when extended mode. | 267 // Verifies if the notification appears on both displays when extended mode. |
| 268 TEST_P(WebNotificationTrayTest, PopupShownOnBothDisplays) { | 268 TEST_P(WebNotificationTrayTest, PopupShownOnBothDisplays) { |
| 269 if (!SupportsMultipleDisplays()) | |
| 270 return; | |
| 271 | |
| 272 Shell::GetInstance() | 269 Shell::GetInstance() |
| 273 ->screen_layout_observer() | 270 ->screen_layout_observer() |
| 274 ->set_show_notifications_for_testing(true); | 271 ->set_show_notifications_for_testing(true); |
| 275 UpdateDisplay("400x400,200x200"); | 272 UpdateDisplay("400x400,200x200"); |
| 276 // UpdateDisplay() creates the display notifications, so popup is visible. | 273 // UpdateDisplay() creates the display notifications, so popup is visible. |
| 277 EXPECT_TRUE(GetTray()->IsPopupVisible()); | 274 EXPECT_TRUE(GetTray()->IsPopupVisible()); |
| 278 WebNotificationTray* secondary_tray = GetSecondaryTray(); | 275 WebNotificationTray* secondary_tray = GetSecondaryTray(); |
| 279 ASSERT_TRUE(secondary_tray); | 276 ASSERT_TRUE(secondary_tray); |
| 280 EXPECT_TRUE(secondary_tray->IsPopupVisible()); | 277 EXPECT_TRUE(secondary_tray->IsPopupVisible()); |
| 281 | 278 |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 gfx::Point out_of_bounds(bounds.x() - 1, center_point.y()); | 500 gfx::Point out_of_bounds(bounds.x() - 1, center_point.y()); |
| 504 generator.MoveTouch(out_of_bounds); | 501 generator.MoveTouch(out_of_bounds); |
| 505 EXPECT_FALSE(tray->is_active()); | 502 EXPECT_FALSE(tray->is_active()); |
| 506 | 503 |
| 507 generator.ReleaseTouch(); | 504 generator.ReleaseTouch(); |
| 508 EXPECT_FALSE(tray->is_active()); | 505 EXPECT_FALSE(tray->is_active()); |
| 509 EXPECT_FALSE(tray->IsMessageCenterBubbleVisible()); | 506 EXPECT_FALSE(tray->IsMessageCenterBubbleVisible()); |
| 510 } | 507 } |
| 511 | 508 |
| 512 } // namespace ash | 509 } // namespace ash |
| OLD | NEW |