diff options
Diffstat (limited to 'jingle')
-rw-r--r-- | jingle/notifier/listener/push_notifications_send_update_task.cc | 12 | ||||
-rw-r--r-- | jingle/notifier/listener/push_notifications_send_update_task_unittest.cc | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/jingle/notifier/listener/push_notifications_send_update_task.cc b/jingle/notifier/listener/push_notifications_send_update_task.cc index 9b5abb6..4e0c127 100644 --- a/jingle/notifier/listener/push_notifications_send_update_task.cc +++ b/jingle/notifier/listener/push_notifications_send_update_task.cc @@ -71,14 +71,20 @@ buzz::XmlElement* PushNotificationsSendUpdateTask::MakeUpdateMessage( recipient_element->AddAttr(buzz::QN_TO, recipient.to); if (!recipient.user_specific_data.empty()) { std::string base64_data; - base::Base64Encode(recipient.user_specific_data, &base64_data); - recipient_element->SetBodyText(base64_data); + if (!base::Base64Encode(recipient.user_specific_data, &base64_data)) { + DLOG(WARNING) << "Could not encode data " + << recipient.user_specific_data; + } else { + recipient_element->SetBodyText(base64_data); + } } } buzz::XmlElement* data = new buzz::XmlElement(kQnData, true); std::string base64_data; - base::Base64Encode(notification.data, &base64_data); + if (!base::Base64Encode(notification.data, &base64_data)) { + DLOG(WARNING) << "Could not encode data " << notification.data; + } data->SetBodyText(base64_data); push->AddElement(data); diff --git a/jingle/notifier/listener/push_notifications_send_update_task_unittest.cc b/jingle/notifier/listener/push_notifications_send_update_task_unittest.cc index 0395352..c57bd93 100644 --- a/jingle/notifier/listener/push_notifications_send_update_task_unittest.cc +++ b/jingle/notifier/listener/push_notifications_send_update_task_unittest.cc @@ -36,7 +36,7 @@ TEST_F(PushNotificationsSendUpdateTaskTest, MakeUpdateMessage) { notification.data = "test_data"; std::string base64_data; - base::Base64Encode(notification.data, &base64_data); + EXPECT_TRUE(base::Base64Encode(notification.data, &base64_data)); scoped_ptr<buzz::XmlElement> message( PushNotificationsSendUpdateTask::MakeUpdateMessage( |