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

Unified Diff: jingle/notifier/listener/push_notifications_send_update_task_unittest.cc

Issue 11232048: Adding XMPP ping functionality to CLoudPrint. XMPP ping and timeout is controlled thorugh Service S… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: jingle/notifier/listener/push_notifications_send_update_task_unittest.cc
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 3fa424ee35e6546cc6b8b067e92b7e7a560da1aa..6ea5c956ec52423bef4852270cc7dd6df920a86e 100644
--- a/jingle/notifier/listener/push_notifications_send_update_task_unittest.cc
+++ b/jingle/notifier/listener/push_notifications_send_update_task_unittest.cc
@@ -55,4 +55,21 @@ TEST_F(PushNotificationsSendUpdateTaskTest, MakeUpdateMessage) {
EXPECT_EQ(expected_xml_string, XmlElementToString(*message));
}
+TEST_F(PushNotificationsSendUpdateTaskTest, MakePingStanza) {
+ Notification notification;
+ notification.ping = true;
+ std::string task_id = "42";
+
+ scoped_ptr<buzz::XmlElement> message(
+ PushNotificationsSendUpdateTask::MakePingStanza(
+ notification, task_id));
+
+ std::string expected_xml_string =
+ base::StringPrintf(
+ "<cli:iq type=\"get\" id=\"%s\" xmlns:cli=\"jabber:client\">"
+ "<ping:ping xmlns:ping=\"urn:xmpp:ping\"/></cli:iq>",
+ task_id.c_str());
+ EXPECT_EQ(expected_xml_string, XmlElementToString(*message));
+}
+
} // namespace notifier

Powered by Google App Engine
This is Rietveld 408576698