| Index: chrome/browser/extensions/notifications_apitest.cc
|
| diff --git a/chrome/browser/extensions/notifications_apitest.cc b/chrome/browser/extensions/notifications_apitest.cc
|
| index 834efa4eed42f278c17b518d293808b5f20f0986..261275ccdf8afd04a376f75d511e84b29b4232f9 100644
|
| --- a/chrome/browser/extensions/notifications_apitest.cc
|
| +++ b/chrome/browser/extensions/notifications_apitest.cc
|
| @@ -9,6 +9,31 @@
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/ui/browser.h"
|
|
|
| +#if defined(ENABLE_MESSAGE_CENTER)
|
| +
|
| +#include "ui/message_center/message_center_switches.h"
|
| +#include "ui/message_center/message_center_util.h"
|
| +
|
| +class RichWebkitNotificationTest : public ExtensionApiTest {
|
| + protected:
|
| + virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
|
| + ExtensionApiTest::SetUpCommandLine(command_line);
|
| + command_line->AppendSwitch(
|
| + message_center::switches::kEnableRichNotifications);
|
| + }
|
| +};
|
| +
|
| +class DisabledRichWebkitNotificationTest : public ExtensionApiTest {
|
| + protected:
|
| + virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
|
| + ExtensionApiTest::SetUpCommandLine(command_line);
|
| + command_line->AppendSwitch(
|
| + message_center::switches::kDisableRichNotifications);
|
| + }
|
| +};
|
| +
|
| +#endif
|
| +
|
| // TODO(kbr): remove: http://crbug.com/222296
|
| #if defined(OS_MACOSX)
|
| #import "base/mac/mac_util.h"
|
| @@ -22,17 +47,30 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, NotificationsNoPermission) {
|
| #endif
|
| }
|
|
|
| -// Disabled after createHTMLNotification removal
|
| -// (http://trac.webkit.org/changeset/140983)
|
| -IN_PROC_BROWSER_TEST_F(ExtensionApiTest,
|
| - DISABLED_NotificationsHasPermissionManifest) {
|
| -#if defined(OS_LINUX) && defined(TOOLKIT_VIEWS)
|
| - // Notifications not supported on linux/views yet.
|
| -#else
|
| +#if defined(ENABLE_MESSAGE_CENTER)
|
| +IN_PROC_BROWSER_TEST_F(RichWebkitNotificationTest, NoHTMLNotifications) {
|
| + ASSERT_TRUE(RunExtensionTest("notifications/no_html")) << message_;
|
| +}
|
| +
|
| +#if !defined(OS_CHROMEOS)
|
| +// HTML notifications fail on ChromeOS whether or not rich notifications
|
| +// are enabled.
|
| +IN_PROC_BROWSER_TEST_F(DisabledRichWebkitNotificationTest,
|
| + HasHTMLNotifications) {
|
| + 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)
|
|
|