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 "chrome/browser/browser_process.h" | 5 #include "chrome/browser/browser_process.h" |
6 #include "chrome/browser/extensions/api/notifications/notifications_api.h" | 6 #include "chrome/browser/extensions/api/notifications/notifications_api.h" |
7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
8 #include "chrome/browser/extensions/extension_function_test_utils.h" | 8 #include "chrome/browser/extensions/extension_function_test_utils.h" |
9 #include "chrome/common/chrome_notification_types.h" | 9 #include "chrome/common/chrome_notification_types.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 return; | 267 return; |
268 #endif | 268 #endif |
269 | 269 |
270 ASSERT_TRUE(RunExtensionTest("notifications/api/events")) << message_; | 270 ASSERT_TRUE(RunExtensionTest("notifications/api/events")) << message_; |
271 } | 271 } |
272 | 272 |
273 IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestCSP) { | 273 IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestCSP) { |
274 ASSERT_TRUE(RunExtensionTest("notifications/api/csp")) << message_; | 274 ASSERT_TRUE(RunExtensionTest("notifications/api/csp")) << message_; |
275 } | 275 } |
276 | 276 |
277 #ifdef ENABLE_MESSAGE_CENTER | |
278 #if !defined(OS_WIN) || !defined(USE_ASH) | 277 #if !defined(OS_WIN) || !defined(USE_ASH) |
279 | 278 |
280 IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestByUser) { | 279 IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestByUser) { |
281 if (!message_center::IsRichNotificationEnabled()) | 280 if (!message_center::IsRichNotificationEnabled()) |
282 return; | 281 return; |
283 | 282 |
284 const extensions::Extension* extension = | 283 const extensions::Extension* extension = |
285 LoadExtensionAndWait("notifications/api/by_user"); | 284 LoadExtensionAndWait("notifications/api/by_user"); |
286 ASSERT_TRUE(extension) << message_; | 285 ASSERT_TRUE(extension) << message_; |
287 | 286 |
288 { | 287 { |
289 ResultCatcher catcher; | 288 ResultCatcher catcher; |
290 g_browser_process->message_center()->RemoveNotification( | 289 g_browser_process->message_center()->RemoveNotification( |
291 extension->id() + "-FOO", | 290 extension->id() + "-FOO", |
292 false); | 291 false); |
293 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 292 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
294 } | 293 } |
295 | 294 |
296 { | 295 { |
297 ResultCatcher catcher; | 296 ResultCatcher catcher; |
298 g_browser_process->message_center()->RemoveNotification( | 297 g_browser_process->message_center()->RemoveNotification( |
299 extension->id() + "-BAR", | 298 extension->id() + "-BAR", |
300 true); | 299 true); |
301 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 300 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
302 } | 301 } |
303 } | 302 } |
304 | 303 |
305 #endif | 304 #endif |
306 #endif | |
OLD | NEW |