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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "remoting/protocol/fake_connection_to_host.h" | 9 #include "remoting/protocol/fake_connection_to_host.h" |
10 #include "remoting/signaling/fake_signal_strategy.h" | 10 #include "remoting/signaling/fake_signal_strategy.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // Pass ownership of the FakeConnectionToHost to the chromoting instance but | 65 // Pass ownership of the FakeConnectionToHost to the chromoting instance but |
66 // keep the ptr around so we can use it to simulate state changes. It will | 66 // keep the ptr around so we can use it to simulate state changes. It will |
67 // remain valid until |test_chromoting_client_| is destroyed. | 67 // remain valid until |test_chromoting_client_| is destroyed. |
68 fake_connection_to_host_ = new FakeConnectionToHost(); | 68 fake_connection_to_host_ = new FakeConnectionToHost(); |
69 test_chromoting_client_->SetSignalStrategyForTests(make_scoped_ptr( | 69 test_chromoting_client_->SetSignalStrategyForTests(make_scoped_ptr( |
70 new FakeSignalStrategy("test_user@faux_address.com/123"))); | 70 new FakeSignalStrategy("test_user@faux_address.com/123"))); |
71 test_chromoting_client_->SetConnectionToHostForTests( | 71 test_chromoting_client_->SetConnectionToHostForTests( |
72 make_scoped_ptr(fake_connection_to_host_)); | 72 make_scoped_ptr(fake_connection_to_host_)); |
73 | 73 |
74 connection_setup_info_.host_jid = "test_host@faux_address.com/321"; | 74 connection_setup_info_.host_jid = "test_host@faux_address.com/321"; |
75 connection_setup_info_.auth_methods.push_back( | |
76 protocol::AuthenticationMethod::THIRD_PARTY); | |
77 } | 75 } |
78 | 76 |
79 void TestChromotingClientTest::TearDown() { | 77 void TestChromotingClientTest::TearDown() { |
80 test_chromoting_client_->RemoveRemoteConnectionObserver(this); | 78 test_chromoting_client_->RemoveRemoteConnectionObserver(this); |
81 fake_connection_to_host_ = nullptr; | 79 fake_connection_to_host_ = nullptr; |
82 | 80 |
83 // The chromoting instance must be destroyed before the message loop. | 81 // The chromoting instance must be destroyed before the message loop. |
84 test_chromoting_client_.reset(); | 82 test_chromoting_client_.reset(); |
85 | 83 |
86 // The IceTransportFactory destroys the PortAllocator via a DeleteSoon | 84 // The IceTransportFactory destroys the PortAllocator via a DeleteSoon |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 // Close the connection via the TestChromotingClient and verify the error | 193 // Close the connection via the TestChromotingClient and verify the error |
196 // state is persisted. | 194 // state is persisted. |
197 test_chromoting_client_->EndConnection(); | 195 test_chromoting_client_->EndConnection(); |
198 EXPECT_EQ(protocol::ConnectionToHost::State::FAILED, connection_state_); | 196 EXPECT_EQ(protocol::ConnectionToHost::State::FAILED, connection_state_); |
199 EXPECT_EQ(protocol::ErrorCode::UNKNOWN_ERROR, error_code_); | 197 EXPECT_EQ(protocol::ErrorCode::UNKNOWN_ERROR, error_code_); |
200 EXPECT_FALSE(is_connected_to_host_); | 198 EXPECT_FALSE(is_connected_to_host_); |
201 } | 199 } |
202 | 200 |
203 } // namespace test | 201 } // namespace test |
204 } // namespace remoting | 202 } // namespace remoting |
OLD | NEW |