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..0193872228c17d6e43c3d09b2adc450866c9ea5d 100644 |
| --- a/chrome/browser/extensions/notifications_apitest.cc |
| +++ b/chrome/browser/extensions/notifications_apitest.cc |
| @@ -8,9 +8,6 @@ |
| #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 +53,20 @@ 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 |
| + if (!message_center::IsRichNotificationEnabled()) |
| + return; |
|
dewittj
2013/05/08 18:53:01
This is fine, but I wonder if this is a good place
Dmitry Titov
2013/05/08 23:03:26
Done, added a special macro for that.
|
| ASSERT_TRUE(RunExtensionTest("notifications/has_not_permission")) << message_; |
| -#endif |
| } |
| -#if defined(ENABLE_MESSAGE_CENTER) |
| IN_PROC_BROWSER_TEST_F(RichWebkitNotificationTest, NoHTMLNotifications) { |
| + if (!message_center::IsRichNotificationEnabled()) |
| + return; |
| ASSERT_TRUE(RunExtensionTest("notifications/no_html")) << message_; |
| } |
| @@ -87,20 +81,17 @@ IN_PROC_BROWSER_TEST_F(DisabledRichWebkitNotificationTest, |
| } |
| #endif |
| -#elif !defined(OS_LINUX) || !defined(TOOLKIT_VIEWS) |
| -// Notifications not supported on linux/views yet. |
| IN_PROC_BROWSER_TEST_F(ExtensionApiTest, |
| NotificationsHasPermissionManifest) { |
| + // Test is looking for HTML Notificaitons. |
|
dewittj
2013/05/08 18:53:01
nit: spelling
Dmitry Titov
2013/05/08 23:03:26
Removed the whole test. It's giving exactly the co
|
| + if (message_center::IsRichNotificationEnabled()) |
| + return; |
| + |
| 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 +103,12 @@ 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) { |
| + if (!message_center::IsRichNotificationEnabled()) |
| + return; |
| + |
| const extensions::Extension* extension = |
| LoadExtensionAndWait("notifications/api/unload"); |
| ASSERT_TRUE(extension) << message_; |
| @@ -126,4 +118,3 @@ IN_PROC_BROWSER_TEST_F(NotificationIdleTest, NotificationsAllowUnload) { |
| extensions::ExtensionSystem::Get(profile())->process_manager(); |
| EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id_)); |
| } |
| -#endif |