#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#import "ui/base/cocoa/hover_image_button.h"
-#import "ui/base/test/ui_cocoa_test_helper.h"
+#import "ui/gfx/test/ui_cocoa_test_helper.h"
#include "ui/message_center/fake_message_center.h"
#include "ui/message_center/message_center_style.h"
#include "ui/message_center/notification.h"
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];
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()
[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]),
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);
}