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

Unified Diff: ui/message_center/cocoa/notification_controller_unittest.mm

Issue 256883002: Update notification style: allow 2-line titles if the message is blank. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix rsesek comments. Created 6 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 | « ui/message_center/cocoa/notification_controller.mm ('k') | ui/message_center/message_center_style.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/cocoa/notification_controller_unittest.mm
diff --git a/ui/message_center/cocoa/notification_controller_unittest.mm b/ui/message_center/cocoa/notification_controller_unittest.mm
index fefee79552e815049e971a34ecd10c99cf61377a..6f50e9186bb04a1bf4fc7bc013ac0623b18d41c9 100644
--- a/ui/message_center/cocoa/notification_controller_unittest.mm
+++ b/ui/message_center/cocoa/notification_controller_unittest.mm
@@ -331,4 +331,31 @@ TEST_F(NotificationControllerTest, List) {
NSMinY([[controller titleView] frame]));
}
+TEST_F(NotificationControllerTest, NoMessage) {
+ message_center::RichNotificationData optional;
+ optional.context_message = UTF8ToUTF16("Context Message");
+
+ scoped_ptr<message_center::Notification> notification(
+ new message_center::Notification(
+ message_center::NOTIFICATION_TYPE_BASE_FORMAT,
+ "an_id",
+ UTF8ToUTF16("Notification Title"),
+ UTF8ToUTF16(""),
+ gfx::Image(),
+ base::string16(),
+ DummyNotifierId(),
+ optional,
+ NULL));
+
+ MockMessageCenter message_center;
+ base::scoped_nsobject<MCNotificationController> controller(
+ [[MCNotificationController alloc] initWithNotification:notification.get()
+ messageCenter:&message_center]);
+ [controller view];
+
+ EXPECT_FALSE([[controller titleView] isHidden]);
+ EXPECT_TRUE([[controller messageView] isHidden]);
+ EXPECT_FALSE([[controller contextMessageView] isHidden]);
+}
+
} // namespace message_center
« no previous file with comments | « ui/message_center/cocoa/notification_controller.mm ('k') | ui/message_center/message_center_style.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698