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

Unified Diff: remoting/host/heartbeat_sender_unittest.cc

Issue 7809003: Simplify IqRequest interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix windows Created 9 years, 3 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 | « remoting/host/heartbeat_sender.cc ('k') | remoting/host/register_support_host_request.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/heartbeat_sender_unittest.cc
diff --git a/remoting/host/heartbeat_sender_unittest.cc b/remoting/host/heartbeat_sender_unittest.cc
index 8818c156dd1490514b47cecf41d13023172f5488..49933c227b639aff4a5f4241b4abb0abcff779e9 100644
--- a/remoting/host/heartbeat_sender_unittest.cc
+++ b/remoting/host/heartbeat_sender_unittest.cc
@@ -27,6 +27,7 @@ using testing::DoAll;
using testing::Invoke;
using testing::NotNull;
using testing::Return;
+using testing::SaveArg;
namespace remoting {
@@ -50,7 +51,7 @@ class HeartbeatSenderTest : public testing::Test {
};
// Call Start() followed by Stop(), and makes sure an Iq stanza is
-// being send.
+// being sent.
TEST_F(HeartbeatSenderTest, DoSendStanza) {
// |iq_request| is freed by HeartbeatSender.
MockIqRequest* iq_request = new MockIqRequest();
@@ -66,12 +67,20 @@ TEST_F(HeartbeatSenderTest, DoSendStanza) {
EXPECT_CALL(signal_strategy_, CreateIqRequest())
.WillOnce(Return(iq_request));
- EXPECT_CALL(*iq_request, SendIq(buzz::STR_SET, kChromotingBotJid, NotNull()))
- .WillOnce(DoAll(DeleteArg<2>(), Return()));
+ XmlElement* sent_iq = NULL;
+ EXPECT_CALL(*iq_request, SendIq(NotNull()))
+ .WillOnce(SaveArg<0>(&sent_iq));
heartbeat_sender->OnSignallingConnected(&signal_strategy_, kTestJid);
message_loop_.RunAllPending();
+ scoped_ptr<XmlElement> stanza(sent_iq);
+ ASSERT_TRUE(stanza != NULL);
+
+ EXPECT_EQ(stanza->Attr(buzz::QName("", "to")),
+ std::string(kChromotingBotJid));
+ EXPECT_EQ(stanza->Attr(buzz::QName("", "type")), "set");
+
heartbeat_sender->OnSignallingDisconnected();
message_loop_.RunAllPending();
}
« no previous file with comments | « remoting/host/heartbeat_sender.cc ('k') | remoting/host/register_support_host_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698