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

Side by Side Diff: remoting/host/heartbeat_sender_unittest.cc

Issue 14314026: remoting: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/host/heartbeat_sender.h" 5 #include "remoting/host/heartbeat_sender.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 } 75 }
76 76
77 virtual void TearDown() OVERRIDE { 77 virtual void TearDown() OVERRIDE {
78 heartbeat_sender_.reset(); 78 heartbeat_sender_.reset();
79 EXPECT_TRUE(signal_strategy_listeners_.empty()); 79 EXPECT_TRUE(signal_strategy_listeners_.empty());
80 } 80 }
81 81
82 void ValidateHeartbeatStanza(XmlElement* stanza, 82 void ValidateHeartbeatStanza(XmlElement* stanza,
83 const char* expectedSequenceId); 83 const char* expectedSequenceId);
84 84
85 MessageLoop message_loop_; 85 base::MessageLoop message_loop_;
86 MockSignalStrategy signal_strategy_; 86 MockSignalStrategy signal_strategy_;
87 std::set<SignalStrategy::Listener*> signal_strategy_listeners_; 87 std::set<SignalStrategy::Listener*> signal_strategy_listeners_;
88 scoped_refptr<RsaKeyPair> key_pair_; 88 scoped_refptr<RsaKeyPair> key_pair_;
89 scoped_ptr<HeartbeatSender> heartbeat_sender_; 89 scoped_ptr<HeartbeatSender> heartbeat_sender_;
90 }; 90 };
91 91
92 // Call Start() followed by Stop(), and make sure a valid heartbeat is sent. 92 // Call Start() followed by Stop(), and make sure a valid heartbeat is sent.
93 TEST_F(HeartbeatSenderTest, DoSendStanza) { 93 TEST_F(HeartbeatSenderTest, DoSendStanza) {
94 XmlElement* sent_iq = NULL; 94 XmlElement* sent_iq = NULL;
95 EXPECT_CALL(signal_strategy_, GetLocalJid()) 95 EXPECT_CALL(signal_strategy_, GetLocalJid())
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 EXPECT_TRUE(heartbeat_stanza->NextNamed(signature_tag) == NULL); 238 EXPECT_TRUE(heartbeat_stanza->NextNamed(signature_tag) == NULL);
239 239
240 scoped_refptr<RsaKeyPair> key_pair = RsaKeyPair::FromString(kTestRsaKeyPair); 240 scoped_refptr<RsaKeyPair> key_pair = RsaKeyPair::FromString(kTestRsaKeyPair);
241 ASSERT_TRUE(key_pair); 241 ASSERT_TRUE(key_pair);
242 std::string expected_signature = 242 std::string expected_signature =
243 key_pair->SignMessage(std::string(kTestJid) + ' ' + expectedSequenceId); 243 key_pair->SignMessage(std::string(kTestJid) + ' ' + expectedSequenceId);
244 EXPECT_EQ(expected_signature, signature->BodyText()); 244 EXPECT_EQ(expected_signature, signature->BodyText());
245 } 245 }
246 246
247 } // namespace remoting 247 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/desktop_process_unittest.cc ('k') | remoting/host/host_change_notification_listener_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698