OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "chrome/browser/notifications/sync_notifier/sync_notifier_test_utils.h" | 5 #include "chrome/browser/notifications/sync_notifier/sync_notifier_test_utils.h" |
6 | 6 |
7 // Fake data for creating a SyncData object to use in creating a | 7 // Fake data for creating a SyncData object to use in creating a |
8 // SyncedNotification. | 8 // SyncedNotification. |
9 const char kAppId1[] = "fboilmbenheemaomgaeehigklolhkhnf"; | 9 const char kAppId1[] = "fboilmbenheemaomgaeehigklolhkhnf"; |
10 const char kAppId2[] = "fbcmoldooppoahjhfflnmljoanccekpf"; | 10 const char kAppId2[] = "fbcmoldooppoahjhfflnmljoanccekpf"; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 coalesced_notification->set_app_id(app_id); | 102 coalesced_notification->set_app_id(app_id); |
103 | 103 |
104 coalesced_notification->set_key(key); | 104 coalesced_notification->set_key(key); |
105 | 105 |
106 coalesced_notification-> | 106 coalesced_notification-> |
107 set_priority(static_cast<sync_pb::CoalescedSyncedNotification_Priority>( | 107 set_priority(static_cast<sync_pb::CoalescedSyncedNotification_Priority>( |
108 kProtobufPriority)); | 108 kProtobufPriority)); |
109 | 109 |
110 // Set the title. | 110 // Set the title. |
111 simple_expanded_layout->set_title(title); | 111 simple_expanded_layout->set_title(title); |
| 112 simple_collapsed_layout->set_heading(title); |
112 | 113 |
113 // Set the text. | 114 // Set the text. |
114 simple_expanded_layout->set_text(text); | 115 simple_expanded_layout->set_text(text); |
| 116 simple_collapsed_layout->set_description(text); |
| 117 simple_collapsed_layout->set_annotation(text); |
115 | 118 |
116 // Set the heading. | 119 // Set the heading. |
117 simple_collapsed_layout->set_heading(title); | 120 simple_collapsed_layout->set_heading(title); |
118 | 121 |
119 // Add the collapsed info and set the app_icon_url on it. | 122 // Add the collapsed info and set the app_icon_url on it. |
120 expanded_info->add_collapsed_info(); | 123 simple_collapsed_layout-> |
121 expanded_info-> | |
122 mutable_collapsed_info(0)-> | |
123 mutable_simple_collapsed_layout()-> | |
124 mutable_app_icon()-> | 124 mutable_app_icon()-> |
125 set_url(app_icon_url); | 125 set_url(app_icon_url); |
126 | 126 |
127 // Add the media object and set the image url on it. | 127 // Add the media object and set the image url on it. |
128 simple_expanded_layout->add_media(); | 128 simple_collapsed_layout->add_media(); |
129 simple_expanded_layout-> | 129 simple_collapsed_layout-> |
130 mutable_media(0)-> | 130 mutable_media(0)-> |
131 mutable_image()-> | 131 mutable_image()-> |
132 set_url(image_url); | 132 set_url(image_url); |
133 | 133 |
134 coalesced_notification->set_creation_time_msec(kFakeCreationTime); | 134 coalesced_notification->set_creation_time_msec(kFakeCreationTime); |
135 | 135 |
136 coalesced_notification->set_read_state(read_state); | 136 coalesced_notification->set_read_state(read_state); |
137 | 137 |
138 // Contained notification one. | 138 // Contained notification one. |
139 // We re-use the collapsed info we added for the app_icon_url, | 139 expanded_info->add_collapsed_info(); |
140 // so no need to create another one here. | |
141 sync_pb::SimpleCollapsedLayout* notification_layout1 = | 140 sync_pb::SimpleCollapsedLayout* notification_layout1 = |
142 expanded_info-> | 141 expanded_info-> |
143 mutable_collapsed_info(0)-> | 142 mutable_collapsed_info(0)-> |
144 mutable_simple_collapsed_layout(); | 143 mutable_simple_collapsed_layout(); |
145 notification_layout1->set_heading(kContainedTitle1); | 144 notification_layout1->set_heading(kContainedTitle1); |
146 notification_layout1->set_description(kContainedMessage1); | 145 notification_layout1->set_description(kContainedMessage1); |
147 | 146 |
148 // Contained notification two. | 147 // Contained notification two. |
149 expanded_info->add_collapsed_info(); | 148 expanded_info->add_collapsed_info(); |
150 sync_pb::SimpleCollapsedLayout* notification_layout2 = | 149 sync_pb::SimpleCollapsedLayout* notification_layout2 = |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 action2->mutable_icon()->set_alt_text(kButtonTwoTitle); | 188 action2->mutable_icon()->set_alt_text(kButtonTwoTitle); |
190 action2->set_url(kButtonTwoUrl); | 189 action2->set_url(kButtonTwoUrl); |
191 | 190 |
192 syncer::SyncData sync_data = syncer::SyncData::CreateLocalData( | 191 syncer::SyncData sync_data = syncer::SyncData::CreateLocalData( |
193 "syncer::SYNCED_NOTIFICATIONS", | 192 "syncer::SYNCED_NOTIFICATIONS", |
194 "ChromeNotifierServiceUnitTest", | 193 "ChromeNotifierServiceUnitTest", |
195 entity_specifics); | 194 entity_specifics); |
196 | 195 |
197 return sync_data; | 196 return sync_data; |
198 } | 197 } |
OLD | NEW |