Chromium Code Reviews| Index: chrome/browser/extensions/notifications_apitest.cc |
| diff --git a/chrome/browser/extensions/notifications_apitest.cc b/chrome/browser/extensions/notifications_apitest.cc |
| index a1a8b39fe9be1977b97dd314a064378c1c74bca9..99049bf54e9ec71712ea09968af14b9c68892dae 100644 |
| --- a/chrome/browser/extensions/notifications_apitest.cc |
| +++ b/chrome/browser/extensions/notifications_apitest.cc |
| @@ -4,13 +4,11 @@ |
| #include "chrome/browser/extensions/extension_apitest.h" |
| +#include "base/logging.h" |
| #include "chrome/browser/notifications/desktop_notification_service.h" |
| #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/ui/browser.h" |
| - |
| -#if defined(ENABLE_MESSAGE_CENTER) |
| - |
| #include "chrome/browser/extensions/extension_process_manager.h" |
| #include "chrome/browser/extensions/lazy_background_page_test_util.h" |
| #include "chrome/common/chrome_switches.h" |
| @@ -56,23 +54,18 @@ class NotificationIdleTest : public RichWebkitNotificationTest { |
| } |
| }; |
| -#endif |
| - |
| // TODO(kbr): remove: http://crbug.com/222296 |
| #if defined(OS_MACOSX) |
| #import "base/mac/mac_util.h" |
| #endif |
| IN_PROC_BROWSER_TEST_F(ExtensionApiTest, NotificationsNoPermission) { |
| -#if defined(OS_LINUX) && defined(TOOLKIT_VIEWS) |
| - // Notifications not supported on linux/views yet. |
| -#else |
| + SKIP_THIS_TEST_IF_MESSAGE_CENTER_DISABLED(); |
|
sky
2013/05/09 15:50:38
Having this compile switch still results in spinni
Dmitry Titov
2013/05/10 00:16:45
Done.
|
| ASSERT_TRUE(RunExtensionTest("notifications/has_not_permission")) << message_; |
| -#endif |
| } |
| -#if defined(ENABLE_MESSAGE_CENTER) |
| IN_PROC_BROWSER_TEST_F(RichWebkitNotificationTest, NoHTMLNotifications) { |
| + SKIP_THIS_TEST_IF_MESSAGE_CENTER_DISABLED(); |
| ASSERT_TRUE(RunExtensionTest("notifications/no_html")) << message_; |
| } |
| @@ -80,27 +73,14 @@ IN_PROC_BROWSER_TEST_F(RichWebkitNotificationTest, NoHTMLNotifications) { |
| // HTML notifications fail on ChromeOS whether or not rich notifications |
| // are enabled. |
| IN_PROC_BROWSER_TEST_F(DisabledRichWebkitNotificationTest, |
| - HasHTMLNotifications) { |
| + HasHTMLNotificationsAndManifestPermission) { |
| ASSERT_FALSE(message_center::IsRichNotificationEnabled()); |
| ASSERT_TRUE(RunExtensionTest("notifications/has_permission_manifest")) |
| << message_; |
| } |
| #endif |
| -#elif !defined(OS_LINUX) || !defined(TOOLKIT_VIEWS) |
| -// Notifications not supported on linux/views yet. |
| -IN_PROC_BROWSER_TEST_F(ExtensionApiTest, |
| - NotificationsHasPermissionManifest) { |
| - ASSERT_TRUE(RunExtensionTest("notifications/has_permission_manifest")) |
| - << message_; |
| -} |
| -#endif |
| - |
| IN_PROC_BROWSER_TEST_F(ExtensionApiTest, NotificationsHasPermission) { |
| -#if defined(OS_LINUX) && defined(TOOLKIT_VIEWS) |
| - // Notifications not supported on linux/views yet. |
| -#else |
| - |
| #if defined(OS_MACOSX) |
| // TODO(kbr): re-enable: http://crbug.com/222296 |
| if (base::mac::IsOSMountainLionOrLater()) |
| @@ -112,11 +92,10 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, NotificationsHasPermission) { |
| "chrome-extension://peoadpeiejnhkmpaakpnompolbglelel")); |
| ASSERT_TRUE(RunExtensionTest("notifications/has_permission_prefs")) |
| << message_; |
| -#endif |
| } |
| -#if defined(ENABLE_MESSAGE_CENTER) |
| IN_PROC_BROWSER_TEST_F(NotificationIdleTest, NotificationsAllowUnload) { |
| + SKIP_THIS_TEST_IF_MESSAGE_CENTER_DISABLED(); |
| const extensions::Extension* extension = |
| LoadExtensionAndWait("notifications/api/unload"); |
| ASSERT_TRUE(extension) << message_; |
| @@ -126,4 +105,3 @@ IN_PROC_BROWSER_TEST_F(NotificationIdleTest, NotificationsAllowUnload) { |
| extensions::ExtensionSystem::Get(profile())->process_manager(); |
| EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id_)); |
| } |
| -#endif |