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

Unified Diff: ui/message_center/message_center_tray_unittest.cc

Issue 14631005: Enable users of NotificationUIManager to specify binary images. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase for relanding. Created 7 years, 6 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 | « ui/message_center/message_center_style.h ('k') | ui/message_center/notification.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/message_center_tray_unittest.cc
diff --git a/ui/message_center/message_center_tray_unittest.cc b/ui/message_center/message_center_tray_unittest.cc
index 1b774f892a468a7e744de523faae42620810f11a..b8aaad38921a4989d17cd7d23f35bb985735ded4 100644
--- a/ui/message_center/message_center_tray_unittest.cc
+++ b/ui/message_center/message_center_tray_unittest.cc
@@ -57,6 +57,19 @@ class MessageCenterTrayTest : public testing::Test {
}
protected:
+ void AddNotification(const std::string& id) {
+ scoped_ptr<Notification> notification(
+ new Notification(message_center::NOTIFICATION_TYPE_SIMPLE,
+ id,
+ ASCIIToUTF16("Test Web Notification"),
+ ASCIIToUTF16("Notification message body."),
+ gfx::Image(),
+ ASCIIToUTF16("www.test.org"),
+ "" /* extension id */,
+ NULL /* optional_fields */,
+ NULL /* delegate */));
+ message_center_->AddNotification(notification.Pass());
+ }
scoped_ptr<MockDelegate> delegate_;
scoped_ptr<MessageCenterTray> message_center_tray_;
MessageCenter* message_center_;
@@ -102,14 +115,7 @@ TEST_F(MessageCenterTrayTest, BasicPopup) {
ASSERT_FALSE(message_center_tray_->popups_visible());
ASSERT_FALSE(message_center_tray_->message_center_visible());
- message_center_->AddNotification(message_center::NOTIFICATION_TYPE_SIMPLE,
- "BasicPopup",
- ASCIIToUTF16("Test Web Notification"),
- ASCIIToUTF16("Notification message body."),
- ASCIIToUTF16("www.test.org"),
- "" /* extension id */,
- NULL /* optional_fields */,
- NULL /* delegate */);
+ AddNotification("BasicPopup");
ASSERT_TRUE(message_center_tray_->popups_visible());
ASSERT_FALSE(message_center_tray_->message_center_visible());
@@ -124,14 +130,7 @@ TEST_F(MessageCenterTrayTest, MessageCenterClosesPopups) {
ASSERT_FALSE(message_center_tray_->popups_visible());
ASSERT_FALSE(message_center_tray_->message_center_visible());
- message_center_->AddNotification(message_center::NOTIFICATION_TYPE_SIMPLE,
- "MessageCenterClosesPopups",
- ASCIIToUTF16("Test Web Notification"),
- ASCIIToUTF16("Notification message body."),
- ASCIIToUTF16("www.test.org"),
- "" /* extension id */,
- NULL /* optional_fields */,
- NULL /* delegate */);
+ AddNotification("MessageCenterClosesPopups");
ASSERT_TRUE(message_center_tray_->popups_visible());
ASSERT_FALSE(message_center_tray_->message_center_visible());
@@ -142,14 +141,7 @@ TEST_F(MessageCenterTrayTest, MessageCenterClosesPopups) {
ASSERT_FALSE(message_center_tray_->popups_visible());
ASSERT_TRUE(message_center_tray_->message_center_visible());
- message_center_->AddNotification(message_center::NOTIFICATION_TYPE_SIMPLE,
- "MessageCenterClosesPopups2",
- ASCIIToUTF16("Test Web Notification"),
- ASCIIToUTF16("Notification message body."),
- ASCIIToUTF16("www.test.org"),
- "" /* extension id */,
- NULL /* optional_fields */,
- NULL /* delegate */);
+ AddNotification("MessageCenterClosesPopups2");
message_center_tray_->ShowPopupBubble();
@@ -170,14 +162,7 @@ TEST_F(MessageCenterTrayTest, ShowBubbleFails) {
ASSERT_FALSE(message_center_tray_->popups_visible());
ASSERT_FALSE(message_center_tray_->message_center_visible());
- message_center_->AddNotification(message_center::NOTIFICATION_TYPE_SIMPLE,
- "ShowBubbleFails",
- ASCIIToUTF16("Test Web Notification"),
- ASCIIToUTF16("Notification message body."),
- ASCIIToUTF16("www.test.org"),
- "" /* extension id */,
- NULL /* optional_fields */,
- NULL /* delegate */);
+ AddNotification("ShowBubbleFails");
message_center_tray_->ShowPopupBubble();
« no previous file with comments | « ui/message_center/message_center_style.h ('k') | ui/message_center/notification.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698