| OLD | NEW |
| 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/register_support_host_request.h" | 5 #include "remoting/host/register_support_host_request.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 ASSERT_TRUE(key_pair_); | 62 ASSERT_TRUE(key_pair_); |
| 63 | 63 |
| 64 EXPECT_CALL(signal_strategy_, AddListener(NotNull())) | 64 EXPECT_CALL(signal_strategy_, AddListener(NotNull())) |
| 65 .WillRepeatedly(AddListener(&signal_strategy_listeners_)); | 65 .WillRepeatedly(AddListener(&signal_strategy_listeners_)); |
| 66 EXPECT_CALL(signal_strategy_, RemoveListener(NotNull())) | 66 EXPECT_CALL(signal_strategy_, RemoveListener(NotNull())) |
| 67 .WillRepeatedly(RemoveListener(&signal_strategy_listeners_)); | 67 .WillRepeatedly(RemoveListener(&signal_strategy_listeners_)); |
| 68 EXPECT_CALL(signal_strategy_, GetLocalJid()) | 68 EXPECT_CALL(signal_strategy_, GetLocalJid()) |
| 69 .WillRepeatedly(Return(kTestJid)); | 69 .WillRepeatedly(Return(kTestJid)); |
| 70 } | 70 } |
| 71 | 71 |
| 72 MessageLoop message_loop_; | 72 base::MessageLoop message_loop_; |
| 73 MockSignalStrategy signal_strategy_; | 73 MockSignalStrategy signal_strategy_; |
| 74 ObserverList<SignalStrategy::Listener, true> signal_strategy_listeners_; | 74 ObserverList<SignalStrategy::Listener, true> signal_strategy_listeners_; |
| 75 scoped_refptr<RsaKeyPair> key_pair_; | 75 scoped_refptr<RsaKeyPair> key_pair_; |
| 76 MockCallback callback_; | 76 MockCallback callback_; |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 TEST_F(RegisterSupportHostRequestTest, Send) { | 79 TEST_F(RegisterSupportHostRequestTest, Send) { |
| 80 // |iq_request| is freed by RegisterSupportHostRequest. | 80 // |iq_request| is freed by RegisterSupportHostRequest. |
| 81 int64 start_time = static_cast<int64>(base::Time::Now().ToDoubleT()); | 81 int64 start_time = static_cast<int64>(base::Time::Now().ToDoubleT()); |
| 82 | 82 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 while ((listener = it.GetNext()) != NULL) { | 156 while ((listener = it.GetNext()) != NULL) { |
| 157 if (listener->OnSignalStrategyIncomingStanza(response.get())) | 157 if (listener->OnSignalStrategyIncomingStanza(response.get())) |
| 158 consumed++; | 158 consumed++; |
| 159 } | 159 } |
| 160 EXPECT_EQ(1, consumed); | 160 EXPECT_EQ(1, consumed); |
| 161 | 161 |
| 162 message_loop_.RunUntilIdle(); | 162 message_loop_.RunUntilIdle(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 } // namespace remoting | 165 } // namespace remoting |
| OLD | NEW |