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

Side by Side Diff: remoting/test/test_chromoting_client_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
« no previous file with comments | « remoting/test/protocol_perftest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/test/test_chromoting_client.h" 5 #include "remoting/test/test_chromoting_client.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 void TestChromotingClientTest::SetUp() { 64 void TestChromotingClientTest::SetUp() {
65 test_chromoting_client_.reset(new TestChromotingClient()); 65 test_chromoting_client_.reset(new TestChromotingClient());
66 test_chromoting_client_->AddRemoteConnectionObserver(this); 66 test_chromoting_client_->AddRemoteConnectionObserver(this);
67 67
68 // Pass ownership of the FakeConnectionToHost to the chromoting instance but 68 // Pass ownership of the FakeConnectionToHost to the chromoting instance but
69 // keep the ptr around so we can use it to simulate state changes. It will 69 // keep the ptr around so we can use it to simulate state changes. It will
70 // remain valid until |test_chromoting_client_| is destroyed. 70 // remain valid until |test_chromoting_client_| is destroyed.
71 fake_connection_to_host_ = new FakeConnectionToHost(); 71 fake_connection_to_host_ = new FakeConnectionToHost();
72 test_chromoting_client_->SetSignalStrategyForTests( 72 test_chromoting_client_->SetSignalStrategyForTests(
73 base::MakeUnique<FakeSignalStrategy>("test_user@faux_address.com/123")); 73 base::MakeUnique<FakeSignalStrategy>(
74 SignalingAddress("test_user@faux_address.com/123")));
74 test_chromoting_client_->SetConnectionToHostForTests( 75 test_chromoting_client_->SetConnectionToHostForTests(
75 base::WrapUnique(fake_connection_to_host_)); 76 base::WrapUnique(fake_connection_to_host_));
76 77
77 connection_setup_info_.host_jid = "test_host@faux_address.com/321"; 78 connection_setup_info_.host_jid = "test_host@faux_address.com/321";
78 } 79 }
79 80
80 void TestChromotingClientTest::TearDown() { 81 void TestChromotingClientTest::TearDown() {
81 test_chromoting_client_->RemoveRemoteConnectionObserver(this); 82 test_chromoting_client_->RemoveRemoteConnectionObserver(this);
82 fake_connection_to_host_ = nullptr; 83 fake_connection_to_host_ = nullptr;
83 84
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 // Close the connection via the TestChromotingClient and verify the error 197 // Close the connection via the TestChromotingClient and verify the error
197 // state is persisted. 198 // state is persisted.
198 test_chromoting_client_->EndConnection(); 199 test_chromoting_client_->EndConnection();
199 EXPECT_EQ(protocol::ConnectionToHost::State::FAILED, connection_state_); 200 EXPECT_EQ(protocol::ConnectionToHost::State::FAILED, connection_state_);
200 EXPECT_EQ(protocol::ErrorCode::UNKNOWN_ERROR, error_code_); 201 EXPECT_EQ(protocol::ErrorCode::UNKNOWN_ERROR, error_code_);
201 EXPECT_FALSE(is_connected_to_host_); 202 EXPECT_FALSE(is_connected_to_host_);
202 } 203 }
203 204
204 } // namespace test 205 } // namespace test
205 } // namespace remoting 206 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/test/protocol_perftest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698