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/system/web_notification/web_notification_tray.h" | 5 #include "ash/system/web_notification/web_notification_tray.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 UpdateNotification("test_id2", "test_id3"); | 201 UpdateNotification("test_id2", "test_id3"); |
202 EXPECT_TRUE(GetTray()->IsPopupVisible()); | 202 EXPECT_TRUE(GetTray()->IsPopupVisible()); |
203 | 203 |
204 // Removing the first notification should not hide the popup bubble. | 204 // Removing the first notification should not hide the popup bubble. |
205 RemoveNotification("test_id1"); | 205 RemoveNotification("test_id1"); |
206 EXPECT_TRUE(GetTray()->IsPopupVisible()); | 206 EXPECT_TRUE(GetTray()->IsPopupVisible()); |
207 | 207 |
208 // Removing the visible notification should hide the popup bubble. | 208 // Removing the visible notification should hide the popup bubble. |
209 RemoveNotification("test_id3"); | 209 RemoveNotification("test_id3"); |
210 EXPECT_FALSE(GetTray()->IsPopupVisible()); | 210 EXPECT_FALSE(GetTray()->IsPopupVisible()); |
| 211 |
| 212 // Now test that we can show multiple popups and then show the message center. |
| 213 AddNotification("test_id4"); |
| 214 AddNotification("test_id5"); |
| 215 EXPECT_TRUE(GetTray()->IsPopupVisible()); |
| 216 |
| 217 GetTray()->message_center_tray_->ShowMessageCenterBubble(); |
| 218 GetTray()->message_center_tray_->HideMessageCenterBubble(); |
| 219 |
| 220 EXPECT_FALSE(GetTray()->IsPopupVisible()); |
211 } | 221 } |
212 | 222 |
213 using message_center::NotificationList; | 223 using message_center::NotificationList; |
214 | 224 |
215 | 225 |
216 // Flakily fails. http://crbug.com/229791 | 226 // Flakily fails. http://crbug.com/229791 |
217 TEST_F(WebNotificationTrayTest, DISABLED_ManyMessageCenterNotifications) { | 227 TEST_F(WebNotificationTrayTest, DISABLED_ManyMessageCenterNotifications) { |
218 // Add the max visible notifications +1, ensure the correct visible number. | 228 // Add the max visible notifications +1, ensure the correct visible number. |
219 size_t notifications_to_add = | 229 size_t notifications_to_add = |
220 message_center::kMaxVisibleMessageCenterNotifications + 1; | 230 message_center::kMaxVisibleMessageCenterNotifications + 1; |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 | 478 |
469 // System tray is created on the primary display. The popups in the secondary | 479 // System tray is created on the primary display. The popups in the secondary |
470 // tray aren't affected. | 480 // tray aren't affected. |
471 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); | 481 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); |
472 EXPECT_GT(work_area.size().GetArea(), GetPopupWorkArea().size().GetArea()); | 482 EXPECT_GT(work_area.size().GetArea(), GetPopupWorkArea().size().GetArea()); |
473 EXPECT_EQ(work_area_second.ToString(), | 483 EXPECT_EQ(work_area_second.ToString(), |
474 GetPopupWorkAreaForTray(GetSecondaryTray()).ToString()); | 484 GetPopupWorkAreaForTray(GetSecondaryTray()).ToString()); |
475 } | 485 } |
476 | 486 |
477 } // namespace ash | 487 } // namespace ash |
OLD | NEW |