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

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, unittests added 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/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..0f916dac299b080ad06a80658e3737a71023ba8f 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,15 @@ TEST_F(XmppPushClientTest, SendNotification) {
xmpp_push_client_->SendNotification(Notification());
}
+// Make sure nothing blows up when the XMPP push client sends a ping
akalin 2012/10/25 00:51:10 append period. Add: // TODO(akalin): Figure out
gene 2012/10/25 01:06:22 Done.
+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.
//

Powered by Google App Engine
This is Rietveld 408576698