| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/extensions/extension_apitest.h" | 5 #include "chrome/browser/extensions/extension_apitest.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser.h" | |
| 8 #include "chrome/browser/notifications/desktop_notification_service.h" | 7 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 9 #include "chrome/browser/profile.h" | 8 #include "chrome/browser/profile.h" |
| 9 #include "chrome/browser/ui/browser.h" |
| 10 | 10 |
| 11 // Fails and hoses bot, http://crbug.com/50060. | 11 // Fails and hoses bot, http://crbug.com/50060. |
| 12 // Flaky, http://crbug.com/42314. | 12 // Flaky, http://crbug.com/42314. |
| 13 #if defined(OS_MACOSX) | 13 #if defined(OS_MACOSX) |
| 14 #define MAYBE_Notifications DISABLED_Notifications | 14 #define MAYBE_Notifications DISABLED_Notifications |
| 15 #else | 15 #else |
| 16 #define MAYBE_Notifications FLAKY_Notifications | 16 #define MAYBE_Notifications FLAKY_Notifications |
| 17 #endif | 17 #endif |
| 18 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_Notifications) { | 18 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_Notifications) { |
| 19 #if defined(OS_LINUX) && defined(TOOLKIT_VIEWS) | 19 #if defined(OS_LINUX) && defined(TOOLKIT_VIEWS) |
| 20 // Notifications not supported on linux/views yet. | 20 // Notifications not supported on linux/views yet. |
| 21 #else | 21 #else |
| 22 ASSERT_TRUE(RunExtensionTest("notifications/has_not_permission")) << message_; | 22 ASSERT_TRUE(RunExtensionTest("notifications/has_not_permission")) << message_; |
| 23 ASSERT_TRUE(RunExtensionTest("notifications/has_permission_manifest")) | 23 ASSERT_TRUE(RunExtensionTest("notifications/has_permission_manifest")) |
| 24 << message_; | 24 << message_; |
| 25 browser()->profile()->GetDesktopNotificationService() | 25 browser()->profile()->GetDesktopNotificationService() |
| 26 ->GrantPermission(GURL( | 26 ->GrantPermission(GURL( |
| 27 "chrome-extension://peoadpeiejnhkmpaakpnompolbglelel")); | 27 "chrome-extension://peoadpeiejnhkmpaakpnompolbglelel")); |
| 28 ASSERT_TRUE(RunExtensionTest("notifications/has_permission_prefs")) | 28 ASSERT_TRUE(RunExtensionTest("notifications/has_permission_prefs")) |
| 29 << message_; | 29 << message_; |
| 30 #endif | 30 #endif |
| 31 } | 31 } |
| 32 | 32 |
| OLD | NEW |