Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: remoting/host/it2me/it2me_host_unittest.cc

Issue 2798393007: Use SignalingAddress in SignalStrategy insterface. (Closed)
Patch Set: header Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « remoting/host/host_status_logger_unittest.cc ('k') | remoting/host/it2me/it2me_native_messaging_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698