Index: chrome/browser/notifications/message_center_notifications_browsertest.cc |
diff --git a/chrome/browser/notifications/message_center_notifications_browsertest.cc b/chrome/browser/notifications/message_center_notifications_browsertest.cc |
index 556eb5a41e32cf82886f7b5ba60a19eb379960cb..71cc0a66d3b2f866ba527e7969011521340bbe12 100644 |
--- a/chrome/browser/notifications/message_center_notifications_browsertest.cc |
+++ b/chrome/browser/notifications/message_center_notifications_browsertest.cc |
@@ -16,10 +16,8 @@ |
#include "chrome/browser/ui/browser.h" |
#include "chrome/test/base/in_process_browser_test.h" |
#include "ui/message_center/message_center.h" |
- |
-#if defined(ENABLE_MESSAGE_CENTER) |
#include "ui/message_center/message_center_switches.h" |
-#endif |
+#include "ui/message_center/message_center_util.h" |
class MessageCenterNotificationsTest : public InProcessBrowserTest { |
public: |
@@ -98,19 +96,36 @@ class MessageCenterNotificationsTest : public InProcessBrowserTest { |
IN_PROC_BROWSER_TEST_F(MessageCenterNotificationsTest, RetrieveBaseParts) { |
// Make sure comamnd-line switch has an effect. |
- EXPECT_TRUE(NotificationUIManager::DelegatesToMessageCenter()); |
+ EXPECT_EQ(NotificationUIManager::DelegatesToMessageCenter(), |
+ message_center::IsRichNotificationEnabled()); |
EXPECT_TRUE(manager()); |
EXPECT_TRUE(message_center()); |
} |
-IN_PROC_BROWSER_TEST_F(MessageCenterNotificationsTest, BasicAddCancel) { |
+// MessaceCenter-specific test. |
+#if defined(RUN_MESSAGE_CENTER_TESTS) |
+#define MAYBE_BasicAddCancel BasicAddCancel |
+#else |
+#define MAYBE_BasicAddCancel DISABLED_BasicAddCancel |
+#endif |
+ |
+IN_PROC_BROWSER_TEST_F(MessageCenterNotificationsTest, MAYBE_BasicAddCancel) { |
+ EXPECT_TRUE(NotificationUIManager::DelegatesToMessageCenter()); |
manager()->Add(CreateTestNotification("hey"), profile()); |
EXPECT_EQ(1u, message_center()->NotificationCount()); |
manager()->CancelById("hey"); |
EXPECT_EQ(0u, message_center()->NotificationCount()); |
} |
-IN_PROC_BROWSER_TEST_F(MessageCenterNotificationsTest, BasicDelegate) { |
+// MessaceCenter-specific test. |
+#if defined(RUN_MESSAGE_CENTER_TESTS) |
+#define MAYBE_BasicDelegate BasicDelegate |
+#else |
+#define MAYBE_BasicDelegate DISABLED_BasicDelegate |
+#endif |
+ |
+IN_PROC_BROWSER_TEST_F(MessageCenterNotificationsTest, MAYBE_BasicDelegate) { |
+ EXPECT_TRUE(NotificationUIManager::DelegatesToMessageCenter()); |
TestDelegate* delegate; |
manager()->Add(CreateTestNotification("hey", &delegate), profile()); |
// Verify that delegate accumulated correct log of events. |
@@ -121,7 +136,16 @@ IN_PROC_BROWSER_TEST_F(MessageCenterNotificationsTest, BasicDelegate) { |
delegate->Release(); |
} |
-IN_PROC_BROWSER_TEST_F(MessageCenterNotificationsTest, ButtonClickedDelegate) { |
+// MessaceCenter-specific test. |
+#if defined(RUN_MESSAGE_CENTER_TESTS) |
+#define MAYBE_ButtonClickedDelegate ButtonClickedDelegate |
+#else |
+#define MAYBE_ButtonClickedDelegate DISABLED_ButtonClickedDelegate |
+#endif |
+ |
+IN_PROC_BROWSER_TEST_F(MessageCenterNotificationsTest, |
+ MAYBE_ButtonClickedDelegate) { |
+ EXPECT_TRUE(NotificationUIManager::DelegatesToMessageCenter()); |
TestDelegate* delegate; |
manager()->Add(CreateTestNotification("n", &delegate), profile()); |
message_center()->ClickOnNotificationButton("n", 1); |