| Index: chrome/browser/notifications/notification_conversion_helper_unittest.cc
|
| diff --git a/chrome/browser/notifications/notification_conversion_helper_unittest.cc b/chrome/browser/notifications/notification_conversion_helper_unittest.cc
|
| index d26ab6dd846121924de9feec7e0d44278421a4a6..6707a05f7a51e51c5ae9940f63fdf3c07f643183 100644
|
| --- a/chrome/browser/notifications/notification_conversion_helper_unittest.cc
|
| +++ b/chrome/browser/notifications/notification_conversion_helper_unittest.cc
|
| @@ -23,51 +23,6 @@ class NotificationConversionHelperTest : public testing::Test {
|
|
|
| void TearDown() override {}
|
|
|
| - protected:
|
| - std::unique_ptr<Notification> CreateNotification(
|
| - message_center::NotificationType type) {
|
| - message_center::RichNotificationData optional_fields;
|
| - optional_fields.priority = 1;
|
| - optional_fields.context_message =
|
| - base::UTF8ToUTF16("I am a context message.");
|
| - optional_fields.timestamp = base::Time::FromDoubleT(12345678.9);
|
| - optional_fields.buttons.push_back(
|
| - message_center::ButtonInfo(base::UTF8ToUTF16("Button 1")));
|
| - optional_fields.buttons.push_back(
|
| - message_center::ButtonInfo(base::UTF8ToUTF16("Button 2")));
|
| - optional_fields.clickable = false;
|
| -
|
| - if (type == message_center::NOTIFICATION_TYPE_IMAGE)
|
| - optional_fields.image = gfx::Image();
|
| - if (type == message_center::NOTIFICATION_TYPE_MULTIPLE) {
|
| - optional_fields.items.push_back(message_center::NotificationItem(
|
| - base::UTF8ToUTF16("Item 1 Title"),
|
| - base::UTF8ToUTF16("Item 1 Message")));
|
| - optional_fields.items.push_back(message_center::NotificationItem(
|
| - base::UTF8ToUTF16("Item 2 Title"),
|
| - base::UTF8ToUTF16("Item 2 Message")));
|
| - }
|
| - if (type == message_center::NOTIFICATION_TYPE_PROGRESS)
|
| - optional_fields.progress = 50;
|
| -
|
| - NotificationDelegate* delegate(new MockNotificationDelegate("id1"));
|
| -
|
| - SkBitmap bitmap;
|
| - bitmap.allocN32Pixels(1, 1);
|
| - bitmap.eraseColor(SkColorSetRGB(1, 2, 3));
|
| - gfx::Image icon = gfx::Image::CreateFrom1xBitmap(bitmap);
|
| -
|
| - std::unique_ptr<Notification> notification(new Notification(
|
| - type, base::UTF8ToUTF16("Title"),
|
| - base::UTF8ToUTF16("This is a message."), icon,
|
| - message_center::NotifierId(message_center::NotifierId::APPLICATION,
|
| - "Notifier 1"),
|
| - base::UTF8ToUTF16("Notifier's Name"), GURL(), "id1", optional_fields,
|
| - delegate));
|
| -
|
| - return notification;
|
| - }
|
| -
|
| private:
|
| DISALLOW_COPY_AND_ASSIGN(NotificationConversionHelperTest);
|
| };
|
| @@ -75,7 +30,8 @@ class NotificationConversionHelperTest : public testing::Test {
|
| TEST_F(NotificationConversionHelperTest, NotificationToNotificationOptions) {
|
| // Create a notification of image type
|
| std::unique_ptr<Notification> notification1 =
|
| - CreateNotification(message_center::NOTIFICATION_TYPE_IMAGE);
|
| + NotificationGenerator::CreateNotification(
|
| + message_center::NOTIFICATION_TYPE_IMAGE);
|
| std::unique_ptr<extensions::api::notifications::NotificationOptions> options1(
|
| new extensions::api::notifications::NotificationOptions());
|
| NotificationConversionHelper::NotificationToNotificationOptions(
|
| @@ -97,7 +53,8 @@ TEST_F(NotificationConversionHelperTest, NotificationToNotificationOptions) {
|
|
|
| // Create a notification of progress type
|
| std::unique_ptr<Notification> notification2 =
|
| - CreateNotification(message_center::NOTIFICATION_TYPE_PROGRESS);
|
| + NotificationGenerator::CreateNotification(
|
| + message_center::NOTIFICATION_TYPE_PROGRESS);
|
| std::unique_ptr<extensions::api::notifications::NotificationOptions> options2(
|
| new extensions::api::notifications::NotificationOptions());
|
| NotificationConversionHelper::NotificationToNotificationOptions(
|
| @@ -108,7 +65,8 @@ TEST_F(NotificationConversionHelperTest, NotificationToNotificationOptions) {
|
|
|
| // Create a notification of multiple type
|
| std::unique_ptr<Notification> notification3 =
|
| - CreateNotification(message_center::NOTIFICATION_TYPE_MULTIPLE);
|
| + NotificationGenerator::CreateNotification(
|
| + message_center::NOTIFICATION_TYPE_MULTIPLE);
|
| std::unique_ptr<extensions::api::notifications::NotificationOptions> options3(
|
| new extensions::api::notifications::NotificationOptions());
|
| NotificationConversionHelper::NotificationToNotificationOptions(
|
|
|