| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |