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

Unified Diff: jingle/notifier/listener/xmpp_push_client_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: comments addressed 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
« no previous file with comments | « jingle/notifier/listener/xmpp_push_client.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: jingle/notifier/listener/xmpp_push_client_unittest.cc
diff --git a/jingle/notifier/listener/xmpp_push_client_unittest.cc b/jingle/notifier/listener/xmpp_push_client_unittest.cc
index 3487479d50e016677bba86f41b3a7657fd6db358..3beb488f6902c313f01ccbb983a8064802242dde 100644
--- a/jingle/notifier/listener/xmpp_push_client_unittest.cc
+++ b/jingle/notifier/listener/xmpp_push_client_unittest.cc
@@ -27,6 +27,7 @@ class MockObserver : public PushClientObserver {
MOCK_METHOD0(OnNotificationsEnabled, void());
MOCK_METHOD1(OnNotificationsDisabled, void(NotificationsDisabledReason));
MOCK_METHOD1(OnIncomingNotification, void(const Notification&));
+ MOCK_METHOD0(OnPingResponse, void());
};
class XmppPushClientTest : public testing::Test {
@@ -110,6 +111,17 @@ TEST_F(XmppPushClientTest, SendNotification) {
xmpp_push_client_->SendNotification(Notification());
}
+// Make sure nothing blows up when the XMPP push client sends a ping.
+//
+// TODO(akalin): Figure out how to test that the ping was actually sent.
+TEST_F(XmppPushClientTest, SendPing) {
+ EXPECT_CALL(mock_observer_, OnNotificationsEnabled());
+
+ xmpp_push_client_->OnConnect(fake_base_task_.AsWeakPtr());
+ xmpp_push_client_->OnSubscribed();
+ xmpp_push_client_->SendPing();
+}
+
// Make sure nothing blows up when the XMPP push client sends a
// notification when disconnected, and the client connects.
//
« no previous file with comments | « jingle/notifier/listener/xmpp_push_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698