OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/extensions/file_browser_notifications.h" | 5 #include "chrome/browser/chromeos/extensions/file_browser_notifications.h" |
6 | 6 |
7 #include <gtest/gtest.h> | 7 #include <gtest/gtest.h> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 return false; | 102 return false; |
103 } | 103 } |
104 | 104 |
105 BalloonCollection* collection_; | 105 BalloonCollection* collection_; |
106 scoped_ptr<MockFileBrowserNotifications> notifications_; | 106 scoped_ptr<MockFileBrowserNotifications> notifications_; |
107 }; | 107 }; |
108 | 108 |
109 #if defined(USE_AURA) | 109 #if defined(USE_AURA) |
110 // TODO(jamescook): Fails on linux_chromeos_aura because we haven't implemented | 110 // TODO(jamescook): Fails on linux_chromeos_aura because we haven't implemented |
111 // chromeos::SystemNotification yet. http://crbug.com/104471 | 111 // chromeos::SystemNotification yet. http://crbug.com/104471 |
112 #define MAYBE_TestBasic FAILS_TestBasic | 112 #define MAYBE_TestBasic DISABLED_TestBasic |
113 #else | 113 #else |
114 #define MAYBE_TestBasic TestBasic | 114 #define MAYBE_TestBasic TestBasic |
115 #endif | 115 #endif |
116 IN_PROC_BROWSER_TEST_F(FileBrowserNotificationsTest, MAYBE_TestBasic) { | 116 IN_PROC_BROWSER_TEST_F(FileBrowserNotificationsTest, MAYBE_TestBasic) { |
117 InitNotifications(); | 117 InitNotifications(); |
118 // We start with no balloons. | 118 // We start with no balloons. |
119 EXPECT_EQ(0u, collection_->GetActiveBalloons().size()); | 119 EXPECT_EQ(0u, collection_->GetActiveBalloons().size()); |
120 | 120 |
121 // Showing a notification both updates our data and shows a balloon. | 121 // Showing a notification both updates our data and shows a balloon. |
122 notifications_->ShowNotification(FileBrowserNotifications::DEVICE, "path"); | 122 notifications_->ShowNotification(FileBrowserNotifications::DEVICE, "path"); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 // Running the message loop allows the balloon to disappear. | 157 // Running the message loop allows the balloon to disappear. |
158 ui_test_utils::RunAllPendingInMessageLoop(); | 158 ui_test_utils::RunAllPendingInMessageLoop(); |
159 EXPECT_EQ(1u, collection_->GetActiveBalloons().size()); | 159 EXPECT_EQ(1u, collection_->GetActiveBalloons().size()); |
160 EXPECT_FALSE(FindBalloon("DFpath")); | 160 EXPECT_FALSE(FindBalloon("DFpath")); |
161 EXPECT_TRUE(FindBalloon("Dpath")); | 161 EXPECT_TRUE(FindBalloon("Dpath")); |
162 }; | 162 }; |
163 | 163 |
164 #if defined(USE_AURA) | 164 #if defined(USE_AURA) |
165 // TODO(jamescook): Fails on linux_chromeos_aura because we haven't implemented | 165 // TODO(jamescook): Fails on linux_chromeos_aura because we haven't implemented |
166 // chromeos::SystemNotification yet. http://crbug.com/104471 | 166 // chromeos::SystemNotification yet. http://crbug.com/104471 |
167 #define MAYBE_ShowDelayedTest FAILS_ShowDelayedTest | 167 #define MAYBE_ShowDelayedTest DISABLED_ShowDelayedTest |
168 #else | 168 #else |
169 // TODO(jamescook): This test is flaky on linux_chromeos, occasionally causing | 169 // TODO(jamescook): This test is flaky on linux_chromeos, occasionally causing |
170 // this assertion failure inside Gtk: | 170 // this assertion failure inside Gtk: |
171 // "murrine_style_draw_box: assertion `height >= -1' failed" | 171 // "murrine_style_draw_box: assertion `height >= -1' failed" |
172 // There may be an underlying bug in the ChromeOS notification code. | 172 // There may be an underlying bug in the ChromeOS notification code. |
173 // I'm not marking it as FLAKY because this doesn't happen on the bots. | 173 // I'm not marking it as FLAKY because this doesn't happen on the bots. |
174 #define MAYBE_ShowDelayedTest ShowDelayedTest | 174 #define MAYBE_ShowDelayedTest ShowDelayedTest |
175 #endif | 175 #endif |
176 IN_PROC_BROWSER_TEST_F(FileBrowserNotificationsTest, MAYBE_ShowDelayedTest) { | 176 IN_PROC_BROWSER_TEST_F(FileBrowserNotificationsTest, MAYBE_ShowDelayedTest) { |
177 InitNotifications(); | 177 InitNotifications(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 ui_test_utils::RunAllPendingInMessageLoop(); | 221 ui_test_utils::RunAllPendingInMessageLoop(); |
222 EXPECT_EQ(2u, collection_->GetActiveBalloons().size()); | 222 EXPECT_EQ(2u, collection_->GetActiveBalloons().size()); |
223 EXPECT_TRUE(FindBalloon("Dpath")); | 223 EXPECT_TRUE(FindBalloon("Dpath")); |
224 EXPECT_TRUE(FindBalloon("DFpath")); | 224 EXPECT_TRUE(FindBalloon("DFpath")); |
225 EXPECT_FALSE(FindBalloon("Fpath")); | 225 EXPECT_FALSE(FindBalloon("Fpath")); |
226 } | 226 } |
227 | 227 |
228 #if defined(USE_AURA) | 228 #if defined(USE_AURA) |
229 // TODO(jamescook): Fails on linux_chromeos_aura because we haven't implemented | 229 // TODO(jamescook): Fails on linux_chromeos_aura because we haven't implemented |
230 // chromeos::SystemNotification yet. http://crbug.com/104471 | 230 // chromeos::SystemNotification yet. http://crbug.com/104471 |
231 #define MAYBE_HideDelayedTest FAILS_HideDelayedTest | 231 #define MAYBE_HideDelayedTest DISABLED_HideDelayedTest |
232 #else | 232 #else |
233 #define MAYBE_HideDelayedTest HideDelayedTest | 233 #define MAYBE_HideDelayedTest HideDelayedTest |
234 #endif | 234 #endif |
235 IN_PROC_BROWSER_TEST_F(FileBrowserNotificationsTest, MAYBE_HideDelayedTest) { | 235 IN_PROC_BROWSER_TEST_F(FileBrowserNotificationsTest, MAYBE_HideDelayedTest) { |
236 InitNotifications(); | 236 InitNotifications(); |
237 // Showing now, and scheduling a hide for later, results in one balloon. | 237 // Showing now, and scheduling a hide for later, results in one balloon. |
238 notifications_->ShowNotification(FileBrowserNotifications::DEVICE, "path"); | 238 notifications_->ShowNotification(FileBrowserNotifications::DEVICE, "path"); |
239 notifications_->HideNotificationDelayed(FileBrowserNotifications::DEVICE, | 239 notifications_->HideNotificationDelayed(FileBrowserNotifications::DEVICE, |
240 "path", 3000); | 240 "path", 3000); |
241 EXPECT_EQ(1u, collection_->GetActiveBalloons().size()); | 241 EXPECT_EQ(1u, collection_->GetActiveBalloons().size()); |
(...skipping 14 matching lines...) Expand all Loading... |
256 | 256 |
257 // Delayed hide for a notification that doesn't exist does nothing. | 257 // Delayed hide for a notification that doesn't exist does nothing. |
258 notifications_->HideNotificationDelayed(FileBrowserNotifications::DEVICE_FAIL, | 258 notifications_->HideNotificationDelayed(FileBrowserNotifications::DEVICE_FAIL, |
259 "path", 3000); | 259 "path", 3000); |
260 notifications_->ExecuteHide(); | 260 notifications_->ExecuteHide(); |
261 ui_test_utils::RunAllPendingInMessageLoop(); | 261 ui_test_utils::RunAllPendingInMessageLoop(); |
262 EXPECT_EQ(0u, collection_->GetActiveBalloons().size()); | 262 EXPECT_EQ(0u, collection_->GetActiveBalloons().size()); |
263 } | 263 } |
264 | 264 |
265 } // namespace chromeos. | 265 } // namespace chromeos. |
OLD | NEW |