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

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

Issue 16159005: [Mac][MC] Adjust the size of the status item view based on the unread count. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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/status_item_view_unittest.mm
diff --git a/ui/message_center/cocoa/status_item_view_unittest.mm b/ui/message_center/cocoa/status_item_view_unittest.mm
index 075e23a5d9a7829e62bb0f3d48da446314b02612..6bffcf439c9cc465ab96a62ce9369d7a4dcbeb02 100644
--- a/ui/message_center/cocoa/status_item_view_unittest.mm
+++ b/ui/message_center/cocoa/status_item_view_unittest.mm
@@ -43,14 +43,32 @@ TEST_F(StatusItemViewTest, Callback) {
}
TEST_F(StatusItemViewTest, UnreadCount) {
+ CGFloat initial_width = NSWidth([view_ frame]);
+
+ CGFloat width = initial_width;
[view_ setUnreadCount:2];
[view_ display];
+ EXPECT_GT(NSWidth([view_ frame]), width);
+ width = NSWidth([view_ frame]);
+
[view_ setUnreadCount:10];
[view_ display];
+ EXPECT_GT(NSWidth([view_ frame]), width);
+ width = NSWidth([view_ frame]);
+
+ CGFloat max_width = width;
+
[view_ setUnreadCount:0];
[view_ display];
+ EXPECT_LT(NSWidth([view_ frame]), width);
+ width = NSWidth([view_ frame]);
+ EXPECT_CGFLOAT_EQ(width, initial_width);
+
[view_ setUnreadCount:1000];
[view_ display];
+ EXPECT_GT(NSWidth([view_ frame]), width);
+ width = NSWidth([view_ frame]);
+ EXPECT_CGFLOAT_EQ(width, max_width);
}
TEST_F(StatusItemViewTest, Highlight) {
« ui/message_center/cocoa/status_item_view.mm ('K') | « ui/message_center/cocoa/status_item_view.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698