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/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 public: | 50 public: |
51 MOCK_METHOD3(OnResponse, void(bool result, const std::string& support_id, | 51 MOCK_METHOD3(OnResponse, void(bool result, const std::string& support_id, |
52 const base::TimeDelta& lifetime)); | 52 const base::TimeDelta& lifetime)); |
53 }; | 53 }; |
54 | 54 |
55 } // namespace | 55 } // namespace |
56 | 56 |
57 class RegisterSupportHostRequestTest : public testing::Test { | 57 class RegisterSupportHostRequestTest : public testing::Test { |
58 public: | 58 public: |
59 protected: | 59 protected: |
60 virtual void SetUp() { | 60 void SetUp() override { |
61 key_pair_ = RsaKeyPair::FromString(kTestRsaKeyPair); | 61 key_pair_ = RsaKeyPair::FromString(kTestRsaKeyPair); |
62 ASSERT_TRUE(key_pair_.get()); | 62 ASSERT_TRUE(key_pair_.get()); |
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 } |
(...skipping 85 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 base::RunLoop().RunUntilIdle(); | 162 base::RunLoop().RunUntilIdle(); |
163 } | 163 } |
164 | 164 |
165 } // namespace remoting | 165 } // namespace remoting |
OLD | NEW |