OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/notifications/notification_conversion_helper.h" | 5 #include "chrome/browser/notifications/notification_conversion_helper.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/notifications/notification.h" | 8 #include "chrome/browser/notifications/notification.h" |
9 #include "chrome/browser/notifications/notification_test_util.h" | 9 #include "chrome/browser/notifications/notification_test_util.h" |
10 #include "chrome/common/extensions/api/notifications.h" | 10 #include "chrome/common/extensions/api/notifications.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 bitmap.allocN32Pixels(1, 1); | 55 bitmap.allocN32Pixels(1, 1); |
56 bitmap.eraseColor(SkColorSetRGB(1, 2, 3)); | 56 bitmap.eraseColor(SkColorSetRGB(1, 2, 3)); |
57 gfx::Image icon = gfx::Image::CreateFrom1xBitmap(bitmap); | 57 gfx::Image icon = gfx::Image::CreateFrom1xBitmap(bitmap); |
58 | 58 |
59 scoped_ptr<Notification> notification(new Notification( | 59 scoped_ptr<Notification> notification(new Notification( |
60 type, | 60 type, |
61 GURL(), | 61 GURL(), |
62 base::UTF8ToUTF16("Title"), | 62 base::UTF8ToUTF16("Title"), |
63 base::UTF8ToUTF16("This is a message."), | 63 base::UTF8ToUTF16("This is a message."), |
64 icon, | 64 icon, |
65 blink::WebTextDirectionDefault, | |
66 message_center::NotifierId(message_center::NotifierId::APPLICATION, | 65 message_center::NotifierId(message_center::NotifierId::APPLICATION, |
67 "Notifier 1"), | 66 "Notifier 1"), |
68 base::UTF8ToUTF16("Notifier's Name"), | 67 base::UTF8ToUTF16("Notifier's Name"), |
69 base::UTF8ToUTF16("id1"), | 68 base::UTF8ToUTF16("id1"), |
70 optional_fields, | 69 optional_fields, |
71 delegate)); | 70 delegate)); |
72 | 71 |
73 return notification.Pass(); | 72 return notification.Pass(); |
74 } | 73 } |
75 | 74 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 scoped_ptr<extensions::api::notifications::NotificationOptions> options3( | 116 scoped_ptr<extensions::api::notifications::NotificationOptions> options3( |
118 new extensions::api::notifications::NotificationOptions()); | 117 new extensions::api::notifications::NotificationOptions()); |
119 NotificationConversionHelper::NotificationToNotificationOptions( | 118 NotificationConversionHelper::NotificationToNotificationOptions( |
120 *(notification3), options3.get()); | 119 *(notification3), options3.get()); |
121 EXPECT_EQ(options3->type, extensions::api::notifications::TEMPLATE_TYPE_LIST); | 120 EXPECT_EQ(options3->type, extensions::api::notifications::TEMPLATE_TYPE_LIST); |
122 EXPECT_EQ(options3->items->at(0)->title, "Item 1 Title"); | 121 EXPECT_EQ(options3->items->at(0)->title, "Item 1 Title"); |
123 EXPECT_EQ(options3->items->at(0)->message, "Item 1 Message"); | 122 EXPECT_EQ(options3->items->at(0)->message, "Item 1 Message"); |
124 EXPECT_EQ(options3->items->at(1)->title, "Item 2 Title"); | 123 EXPECT_EQ(options3->items->at(1)->title, "Item 2 Title"); |
125 EXPECT_EQ(options3->items->at(1)->message, "Item 2 Message"); | 124 EXPECT_EQ(options3->items->at(1)->message, "Item 2 Message"); |
126 } | 125 } |
OLD | NEW |