Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1613)

Unified Diff: chrome/browser/extensions/notifications_apitest.cc

Issue 13533019: Disables HTML notifications when rich notifications are enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Indentation in test fixed. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/renderer/chrome_render_view_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/renderer/chrome_render_view_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698