OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/views/message_center/web_notification_tray.h" | 5 #include "chrome/browser/ui/views/message_center/web_notification_tray.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/system/status_area_widget.h" | 10 #include "ash/system/status_area_widget.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 g_browser_process->notification_ui_manager()->CancelById(id); | 96 g_browser_process->notification_ui_manager()->CancelById(id); |
97 } | 97 } |
98 | 98 |
99 private: | 99 private: |
100 DISALLOW_COPY_AND_ASSIGN(WebNotificationTrayTest); | 100 DISALLOW_COPY_AND_ASSIGN(WebNotificationTrayTest); |
101 }; | 101 }; |
102 | 102 |
103 } // namespace | 103 } // namespace |
104 | 104 |
105 | 105 |
106 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA) | |
107 // TODO(erg): linux_aura bringup: http://crbug.com/163931 | |
108 #define MAYBE_WebNotifications DISABLED_WebNotifications | |
109 #else | |
110 #define MAYBE_WebNotifications WebNotifications | |
111 #endif | |
112 | |
113 // TODO(dewittj): More exhaustive testing. | 106 // TODO(dewittj): More exhaustive testing. |
114 IN_PROC_BROWSER_TEST_F(WebNotificationTrayTest, MAYBE_WebNotifications) { | 107 IN_PROC_BROWSER_TEST_F(WebNotificationTrayTest, WebNotifications) { |
115 message_center::MessageCenter* message_center = | 108 message_center::MessageCenter* message_center = |
116 message_center::MessageCenter::Get(); | 109 message_center::MessageCenter::Get(); |
117 | 110 |
118 // Add a notification. | 111 // Add a notification. |
119 AddNotification("test_id1", "replace_id1"); | 112 AddNotification("test_id1", "replace_id1"); |
120 EXPECT_EQ(1u, message_center->NotificationCount()); | 113 EXPECT_EQ(1u, message_center->NotificationCount()); |
121 EXPECT_TRUE(message_center->HasNotification("test_id1")); | 114 EXPECT_TRUE(message_center->HasNotification("test_id1")); |
122 EXPECT_FALSE(message_center->HasNotification("test_id2")); | 115 EXPECT_FALSE(message_center->HasNotification("test_id2")); |
123 AddNotification("test_id2", "replace_id2"); | 116 AddNotification("test_id2", "replace_id2"); |
124 AddNotification("test_id2", "replace_id2"); | 117 AddNotification("test_id2", "replace_id2"); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 EXPECT_TRUE(message_center->IsMessageCenterVisible()); | 236 EXPECT_TRUE(message_center->IsMessageCenterVisible()); |
244 | 237 |
245 mc_manager->EnsureMessageCenterClosed(); | 238 mc_manager->EnsureMessageCenterClosed(); |
246 | 239 |
247 EXPECT_FALSE(message_center->IsMessageCenterVisible()); | 240 EXPECT_FALSE(message_center->IsMessageCenterVisible()); |
248 if (NULL != tray->message_center_delegate_) | 241 if (NULL != tray->message_center_delegate_) |
249 EXPECT_TRUE(tray->message_center_delegate_->GetWidget()->IsClosed()); | 242 EXPECT_TRUE(tray->message_center_delegate_->GetWidget()->IsClosed()); |
250 } | 243 } |
251 | 244 |
252 } // namespace message_center | 245 } // namespace message_center |
OLD | NEW |