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

Side by Side Diff: remoting/signaling/iq_sender_unittest.cc

Issue 2798393007: Use SignalingAddress in SignalStrategy insterface. (Closed)
Patch Set: header Created 3 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/signaling/iq_sender.h" 5 #include "remoting/signaling/iq_sender.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 29 matching lines...) Expand all
40 const char kTo[] = "user@domain.com"; 40 const char kTo[] = "user@domain.com";
41 41
42 MATCHER_P(XmlEq, expected, "") { 42 MATCHER_P(XmlEq, expected, "") {
43 return arg->Str() == expected->Str(); 43 return arg->Str() == expected->Str();
44 } 44 }
45 45
46 } // namespace 46 } // namespace
47 47
48 class IqSenderTest : public testing::Test { 48 class IqSenderTest : public testing::Test {
49 public: 49 public:
50 IqSenderTest() { 50 IqSenderTest() : signal_strategy_(SignalingAddress("local_jid@domain.com")) {
51 EXPECT_CALL(signal_strategy_, AddListener(NotNull())); 51 EXPECT_CALL(signal_strategy_, AddListener(NotNull()));
52 sender_.reset(new IqSender(&signal_strategy_)); 52 sender_.reset(new IqSender(&signal_strategy_));
53 EXPECT_CALL(signal_strategy_, RemoveListener( 53 EXPECT_CALL(signal_strategy_, RemoveListener(
54 static_cast<SignalStrategy::Listener*>(sender_.get()))); 54 static_cast<SignalStrategy::Listener*>(sender_.get())));
55 } 55 }
56 56
57 protected: 57 protected:
58 void SendTestMessage() { 58 void SendTestMessage() {
59 std::unique_ptr<XmlElement> iq_body( 59 std::unique_ptr<XmlElement> iq_body(
60 new XmlElement(QName(kNamespace, kBodyTag))); 60 new XmlElement(QName(kNamespace, kBodyTag)));
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 SendTestMessage(); 147 SendTestMessage();
148 }); 148 });
149 149
150 EXPECT_FALSE(FormatAndDeliverResponse("different_user@domain.com", nullptr)); 150 EXPECT_FALSE(FormatAndDeliverResponse("different_user@domain.com", nullptr));
151 151
152 EXPECT_CALL(callback_, Run(_, _)).Times(0); 152 EXPECT_CALL(callback_, Run(_, _)).Times(0);
153 base::RunLoop().RunUntilIdle(); 153 base::RunLoop().RunUntilIdle();
154 } 154 }
155 155
156 } // namespace remoting 156 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/signaling/fake_signal_strategy.cc ('k') | remoting/signaling/log_to_server_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698