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

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

Issue 15782010: Update remoting/ and jingle/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
« no previous file with comments | « remoting/host/heartbeat_sender.cc ('k') | remoting/host/host_port_allocator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 : public testing::Test, 52 : public testing::Test,
53 public HeartbeatSender::Listener { 53 public HeartbeatSender::Listener {
54 protected: 54 protected:
55 // Overridden from HeartbeatSender::Listener 55 // Overridden from HeartbeatSender::Listener
56 virtual void OnUnknownHostIdError() OVERRIDE { 56 virtual void OnUnknownHostIdError() OVERRIDE {
57 NOTREACHED(); 57 NOTREACHED();
58 } 58 }
59 59
60 virtual void SetUp() OVERRIDE { 60 virtual void SetUp() OVERRIDE {
61 key_pair_ = RsaKeyPair::FromString(kTestRsaKeyPair); 61 key_pair_ = RsaKeyPair::FromString(kTestRsaKeyPair);
62 ASSERT_TRUE(key_pair_); 62 ASSERT_TRUE(key_pair_.get());
63 63
64 EXPECT_CALL(signal_strategy_, GetState()) 64 EXPECT_CALL(signal_strategy_, GetState())
65 .WillOnce(Return(SignalStrategy::DISCONNECTED)); 65 .WillOnce(Return(SignalStrategy::DISCONNECTED));
66 EXPECT_CALL(signal_strategy_, AddListener(NotNull())) 66 EXPECT_CALL(signal_strategy_, AddListener(NotNull()))
67 .WillRepeatedly(AddListener(&signal_strategy_listeners_)); 67 .WillRepeatedly(AddListener(&signal_strategy_listeners_));
68 EXPECT_CALL(signal_strategy_, RemoveListener(NotNull())) 68 EXPECT_CALL(signal_strategy_, RemoveListener(NotNull()))
69 .WillRepeatedly(RemoveListener(&signal_strategy_listeners_)); 69 .WillRepeatedly(RemoveListener(&signal_strategy_listeners_));
70 EXPECT_CALL(signal_strategy_, GetLocalJid()) 70 EXPECT_CALL(signal_strategy_, GetLocalJid())
71 .WillRepeatedly(Return(kTestJid)); 71 .WillRepeatedly(Return(kTestJid));
72 72
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 buzz::QName(kChromotingXmlNamespace, "sequence-id"))); 231 buzz::QName(kChromotingXmlNamespace, "sequence-id")));
232 EXPECT_EQ(std::string(kHostId), 232 EXPECT_EQ(std::string(kHostId),
233 heartbeat_stanza->Attr(QName(kChromotingXmlNamespace, "hostid"))); 233 heartbeat_stanza->Attr(QName(kChromotingXmlNamespace, "hostid")));
234 234
235 QName signature_tag(kChromotingXmlNamespace, "signature"); 235 QName signature_tag(kChromotingXmlNamespace, "signature");
236 XmlElement* signature = heartbeat_stanza->FirstNamed(signature_tag); 236 XmlElement* signature = heartbeat_stanza->FirstNamed(signature_tag);
237 ASSERT_TRUE(signature != NULL); 237 ASSERT_TRUE(signature != NULL);
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.get());
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/heartbeat_sender.cc ('k') | remoting/host/host_port_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698