OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |