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

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

Issue 149433005: Adds a small icon to notifications, and connects it to synced notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nits Created 6 years, 11 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
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 59046aaf01bd0cb8eae40fbfe6c03bad27e1ce35..e01745a024520aefa99729f86ddbabd9efce9a91 100644
--- a/ui/message_center/cocoa/notification_controller_unittest.mm
+++ b/ui/message_center/cocoa/notification_controller_unittest.mm
@@ -65,6 +65,10 @@ class MockMessageCenter : public message_center::FakeMessageCenter {
return closeButton_.get();
}
+- (NSImageView*)smallImageView {
+ return smallImage_.get();
+}
+
- (NSButton*)secondButton {
// The buttons are in Cocoa-y-order, so the 2nd button is first.
NSView* view = [[bottomView_ subviews] objectAtIndex:0];
@@ -122,7 +126,9 @@ TEST_F(NotificationControllerTest, BasicLayout) {
DummyNotifierId(),
message_center::RichNotificationData(),
NULL));
- notification->set_icon(gfx::Image([TestIcon() retain]));
+ gfx::Image testIcon([TestIcon() retain]);
+ notification->set_icon(testIcon);
+ notification->set_small_image(testIcon);
base::scoped_nsobject<MCNotificationController> controller(
[[MCNotificationController alloc] initWithNotification:notification.get()
@@ -130,6 +136,7 @@ TEST_F(NotificationControllerTest, BasicLayout) {
[controller view];
EXPECT_EQ(TestIcon(), [[controller iconView] image]);
+ EXPECT_EQ(TestIcon(), [[controller smallImageView] image]);
EXPECT_EQ(base::SysNSStringToUTF16([[controller titleView] string]),
notification->title());
EXPECT_EQ(base::SysNSStringToUTF16([[controller messageView] string]),
@@ -209,11 +216,15 @@ TEST_F(NotificationControllerTest, Update) {
EXPECT_EQ(NSHeight([[controller view] frame]),
message_center::kNotificationIconSize);
EXPECT_FALSE([[controller iconView] image]);
+ EXPECT_FALSE([[controller smallImageView] image]);
// Update the icon.
- notification->set_icon(gfx::Image([TestIcon() retain]));
+ gfx::Image testIcon([TestIcon() retain]);
+ notification->set_icon(testIcon);
+ notification->set_small_image(testIcon);
[controller updateNotification:notification.get()];
EXPECT_EQ(TestIcon(), [[controller iconView] image]);
+ EXPECT_EQ(TestIcon(), [[controller smallImageView] image]);
EXPECT_EQ(NSHeight([[controller view] frame]),
message_center::kNotificationIconSize);
}

Powered by Google App Engine
This is Rietveld 408576698