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

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

Issue 363933002: setConfig is deprecated, use setInfo or allocPixels instead. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/app_list/cocoa/apps_grid_controller_unittest.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 [controller updateNotification:notification.get()]; 398 [controller updateNotification:notification.get()];
399 EXPECT_EQ(5u, compute_message_lines()); 399 EXPECT_EQ(5u, compute_message_lines());
400 400
401 // Message and two line title: 3 lines. 401 // Message and two line title: 3 lines.
402 notification->set_title(ASCIIToUTF16("two\nlines")); 402 notification->set_title(ASCIIToUTF16("two\nlines"));
403 [controller updateNotification:notification.get()]; 403 [controller updateNotification:notification.get()];
404 EXPECT_EQ(3u, compute_message_lines()); 404 EXPECT_EQ(3u, compute_message_lines());
405 405
406 // Message, image and no title: 2 lines. 406 // Message, image and no title: 2 lines.
407 SkBitmap bitmap; 407 SkBitmap bitmap;
408 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 2, 2); 408 bitmap.allocN32Pixels(2, 2);
409 bitmap.allocPixels();
410 bitmap.eraseColor(SK_ColorGREEN); 409 bitmap.eraseColor(SK_ColorGREEN);
411 notification->set_title(ASCIIToUTF16("")); 410 notification->set_title(ASCIIToUTF16(""));
412 notification->set_image(gfx::Image::CreateFrom1xBitmap(bitmap)); 411 notification->set_image(gfx::Image::CreateFrom1xBitmap(bitmap));
413 [controller updateNotification:notification.get()]; 412 [controller updateNotification:notification.get()];
414 EXPECT_EQ(2u, compute_message_lines()); 413 EXPECT_EQ(2u, compute_message_lines());
415 414
416 // Message, image and one line title: 2 lines. 415 // Message, image and one line title: 2 lines.
417 notification->set_title(ASCIIToUTF16("one line")); 416 notification->set_title(ASCIIToUTF16("one line"));
418 [controller updateNotification:notification.get()]; 417 [controller updateNotification:notification.get()];
419 EXPECT_EQ(2u, compute_message_lines()); 418 EXPECT_EQ(2u, compute_message_lines());
(...skipping 12 matching lines...) Expand all
432 notification->set_title(ASCIIToUTF16("one line")); 431 notification->set_title(ASCIIToUTF16("one line"));
433 [controller updateNotification:notification.get()]; 432 [controller updateNotification:notification.get()];
434 EXPECT_EQ(1u, compute_message_lines()); 433 EXPECT_EQ(1u, compute_message_lines());
435 434
436 notification->set_title(ASCIIToUTF16("two\nlines")); 435 notification->set_title(ASCIIToUTF16("two\nlines"));
437 [controller updateNotification:notification.get()]; 436 [controller updateNotification:notification.get()];
438 EXPECT_EQ(0u, compute_message_lines()); 437 EXPECT_EQ(0u, compute_message_lines());
439 } 438 }
440 439
441 } // namespace message_center 440 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/app_list/cocoa/apps_grid_controller_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698