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

Side by Side Diff: ui/message_center/cocoa/notification_controller_unittest.mm

Issue 102473005: Refresh for the Chrome notifications image template. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac unit test Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ui/message_center/cocoa/notification_controller.h" 5 #import "ui/message_center/cocoa/notification_controller.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #include "base/mac/scoped_nsobject.h" 8 #include "base/mac/scoped_nsobject.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 notification->set_image(gfx::Image([image retain])); 255 notification->set_image(gfx::Image([image retain]));
256 256
257 MockMessageCenter message_center; 257 MockMessageCenter message_center;
258 258
259 base::scoped_nsobject<MCNotificationController> controller( 259 base::scoped_nsobject<MCNotificationController> controller(
260 [[MCNotificationController alloc] initWithNotification:notification.get() 260 [[MCNotificationController alloc] initWithNotification:notification.get()
261 messageCenter:&message_center]); 261 messageCenter:&message_center]);
262 [controller view]; 262 [controller view];
263 263
264 ASSERT_EQ(1u, [[controller bottomSubviews] count]); 264 ASSERT_EQ(1u, [[controller bottomSubviews] count]);
265 ASSERT_TRUE([[[controller bottomSubviews] lastObject] 265 ASSERT_TRUE([[[[controller bottomSubviews] lastObject] contentView]
266 isKindOfClass:[NSImageView class]]); 266 isKindOfClass:[NSImageView class]]);
267 EXPECT_EQ(image, [[[controller bottomSubviews] lastObject] image]); 267 EXPECT_EQ(image,
268 [[[[controller bottomSubviews] lastObject] contentView] image]);
268 } 269 }
269 270
270 TEST_F(NotificationControllerTest, List) { 271 TEST_F(NotificationControllerTest, List) {
271 message_center::RichNotificationData optional; 272 message_center::RichNotificationData optional;
272 message_center::NotificationItem item1( 273 message_center::NotificationItem item1(
273 UTF8ToUTF16("First title"), UTF8ToUTF16("first message")); 274 UTF8ToUTF16("First title"), UTF8ToUTF16("first message"));
274 optional.items.push_back(item1); 275 optional.items.push_back(item1);
275 message_center::NotificationItem item2( 276 message_center::NotificationItem item2(
276 UTF8ToUTF16("Second title"), 277 UTF8ToUTF16("Second title"),
277 UTF8ToUTF16("second slightly longer message")); 278 UTF8ToUTF16("second slightly longer message"));
(...skipping 23 matching lines...) Expand all
301 [controller view]; 302 [controller view];
302 303
303 EXPECT_FALSE([[controller titleView] isHidden]); 304 EXPECT_FALSE([[controller titleView] isHidden]);
304 EXPECT_TRUE([[controller messageView] isHidden]); 305 EXPECT_TRUE([[controller messageView] isHidden]);
305 EXPECT_FALSE([[controller contextMessageView] isHidden]); 306 EXPECT_FALSE([[controller contextMessageView] isHidden]);
306 307
307 EXPECT_EQ(3u, [[[controller listView] subviews] count]); 308 EXPECT_EQ(3u, [[[controller listView] subviews] count]);
308 EXPECT_LT(NSMaxY([[controller listView] frame]), 309 EXPECT_LT(NSMaxY([[controller listView] frame]),
309 NSMinY([[controller titleView] frame])); 310 NSMinY([[controller titleView] frame]));
310 } 311 }
OLDNEW
« 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