OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/it2me/it2me_host.h" | 5 #include "remoting/host/it2me/it2me_host.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 | 181 |
182 std::unique_ptr<ChromotingHostContext> host_context( | 182 std::unique_ptr<ChromotingHostContext> host_context( |
183 ChromotingHostContext::Create(new AutoThreadTaskRunner( | 183 ChromotingHostContext::Create(new AutoThreadTaskRunner( |
184 base::ThreadTaskRunnerHandle::Get(), run_loop_->QuitClosure()))); | 184 base::ThreadTaskRunnerHandle::Get(), run_loop_->QuitClosure()))); |
185 network_task_runner_ = host_context->network_task_runner(); | 185 network_task_runner_ = host_context->network_task_runner(); |
186 ui_task_runner_ = host_context->ui_task_runner(); | 186 ui_task_runner_ = host_context->ui_task_runner(); |
187 | 187 |
188 std::unique_ptr<FakeIt2MeDialogFactory> dialog_factory( | 188 std::unique_ptr<FakeIt2MeDialogFactory> dialog_factory( |
189 new FakeIt2MeDialogFactory()); | 189 new FakeIt2MeDialogFactory()); |
190 dialog_factory_ = dialog_factory.get(); | 190 dialog_factory_ = dialog_factory.get(); |
191 it2me_host_ = | 191 it2me_host_ = new It2MeHost( |
192 new It2MeHost(std::move(host_context), /*policy_watcher=*/nullptr, | 192 std::move(host_context), /*policy_watcher=*/nullptr, |
193 std::move(dialog_factory), weak_factory_.GetWeakPtr(), | 193 std::move(dialog_factory), weak_factory_.GetWeakPtr(), |
194 base::WrapUnique(new FakeSignalStrategy("fake_local_jid")), | 194 base::WrapUnique( |
195 "fake_user_name", "fake_bot_jid"); | 195 new FakeSignalStrategy(SignalingAddress("fake_local_jid"))), |
| 196 "fake_user_name", "fake_bot_jid"); |
196 } | 197 } |
197 | 198 |
198 void It2MeHostTest::TearDown() { | 199 void It2MeHostTest::TearDown() { |
199 network_task_runner_ = nullptr; | 200 network_task_runner_ = nullptr; |
200 ui_task_runner_ = nullptr; | 201 ui_task_runner_ = nullptr; |
201 it2me_host_ = nullptr; | 202 it2me_host_ = nullptr; |
202 run_loop_->Run(); | 203 run_loop_->Run(); |
203 } | 204 } |
204 | 205 |
205 void It2MeHostTest::OnValidationComplete(const base::Closure& resume_callback, | 206 void It2MeHostTest::OnValidationComplete(const base::Closure& resume_callback, |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 ASSERT_EQ(ValidationResult::SUCCESS, validation_result_); | 397 ASSERT_EQ(ValidationResult::SUCCESS, validation_result_); |
397 ASSERT_EQ(It2MeHostState::kConnecting, last_host_state_); | 398 ASSERT_EQ(It2MeHostState::kConnecting, last_host_state_); |
398 | 399 |
399 RunValidationCallback(kTestClientJid2); | 400 RunValidationCallback(kTestClientJid2); |
400 ASSERT_EQ(ValidationResult::ERROR_TOO_MANY_CONNECTIONS, validation_result_); | 401 ASSERT_EQ(ValidationResult::ERROR_TOO_MANY_CONNECTIONS, validation_result_); |
401 RunUntilStateChanged(It2MeHostState::kDisconnected); | 402 RunUntilStateChanged(It2MeHostState::kDisconnected); |
402 ASSERT_EQ(It2MeHostState::kDisconnected, last_host_state_); | 403 ASSERT_EQ(It2MeHostState::kDisconnected, last_host_state_); |
403 } | 404 } |
404 | 405 |
405 } // namespace remoting | 406 } // namespace remoting |
OLD | NEW |