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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 QName(kChromotingXmlNamespace, "support-id")); | 143 QName(kChromotingXmlNamespace, "support-id")); |
144 support_id->AddText(kSupportId); | 144 support_id->AddText(kSupportId); |
145 result->AddElement(support_id); | 145 result->AddElement(support_id); |
146 | 146 |
147 XmlElement* support_id_lifetime = new XmlElement( | 147 XmlElement* support_id_lifetime = new XmlElement( |
148 QName(kChromotingXmlNamespace, "support-id-lifetime")); | 148 QName(kChromotingXmlNamespace, "support-id-lifetime")); |
149 support_id_lifetime->AddText(kSupportIdLifetime); | 149 support_id_lifetime->AddText(kSupportIdLifetime); |
150 result->AddElement(support_id_lifetime); | 150 result->AddElement(support_id_lifetime); |
151 | 151 |
152 int consumed = 0; | 152 int consumed = 0; |
153 ObserverListBase<SignalStrategy::Listener>::Iterator it( | 153 base::ObserverListBase<SignalStrategy::Listener>::Iterator it( |
154 &signal_strategy_listeners_); | 154 &signal_strategy_listeners_); |
155 SignalStrategy::Listener* listener; | 155 SignalStrategy::Listener* listener; |
156 while ((listener = it.GetNext()) != nullptr) { | 156 while ((listener = it.GetNext()) != nullptr) { |
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 |