| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/protocol/jingle_session.h" | 5 #include "remoting/protocol/jingle_session.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 FakeSignalStrategy::Connect(host_signal_strategy_.get(), | 146 FakeSignalStrategy::Connect(host_signal_strategy_.get(), |
| 147 client_signal_strategy_.get()); | 147 client_signal_strategy_.get()); |
| 148 | 148 |
| 149 EXPECT_CALL(host_server_listener_, OnSessionManagerReady()) | 149 EXPECT_CALL(host_server_listener_, OnSessionManagerReady()) |
| 150 .Times(1); | 150 .Times(1); |
| 151 | 151 |
| 152 NetworkSettings network_settings(NetworkSettings::NAT_TRAVERSAL_OUTGOING); | 152 NetworkSettings network_settings(NetworkSettings::NAT_TRAVERSAL_OUTGOING); |
| 153 | 153 |
| 154 scoped_ptr<TransportFactory> host_transport(new LibjingleTransportFactory( | 154 scoped_ptr<TransportFactory> host_transport(new LibjingleTransportFactory( |
| 155 NULL, | 155 NULL, |
| 156 ChromiumPortAllocator::Create(NULL, network_settings) | 156 ChromiumPortAllocator::Create(NULL, network_settings).Pass(), |
| 157 .PassAs<cricket::HttpPortAllocatorBase>(), | |
| 158 network_settings)); | 157 network_settings)); |
| 159 host_server_.reset(new JingleSessionManager(host_transport.Pass())); | 158 host_server_.reset(new JingleSessionManager(host_transport.Pass())); |
| 160 host_server_->Init(host_signal_strategy_.get(), &host_server_listener_); | 159 host_server_->Init(host_signal_strategy_.get(), &host_server_listener_); |
| 161 | 160 |
| 162 scoped_ptr<AuthenticatorFactory> factory( | 161 scoped_ptr<AuthenticatorFactory> factory( |
| 163 new FakeHostAuthenticatorFactory(auth_round_trips, | 162 new FakeHostAuthenticatorFactory(auth_round_trips, |
| 164 messages_till_start, auth_action, true)); | 163 messages_till_start, auth_action, true)); |
| 165 host_server_->set_authenticator_factory(factory.Pass()); | 164 host_server_->set_authenticator_factory(factory.Pass()); |
| 166 | 165 |
| 167 EXPECT_CALL(client_server_listener_, OnSessionManagerReady()) | 166 EXPECT_CALL(client_server_listener_, OnSessionManagerReady()) |
| 168 .Times(1); | 167 .Times(1); |
| 169 scoped_ptr<TransportFactory> client_transport(new LibjingleTransportFactory( | 168 scoped_ptr<TransportFactory> client_transport(new LibjingleTransportFactory( |
| 170 NULL, | 169 NULL, |
| 171 ChromiumPortAllocator::Create(NULL, network_settings) | 170 ChromiumPortAllocator::Create(NULL, network_settings).Pass(), |
| 172 .PassAs<cricket::HttpPortAllocatorBase>(), | |
| 173 network_settings)); | 171 network_settings)); |
| 174 client_server_.reset( | 172 client_server_.reset( |
| 175 new JingleSessionManager(client_transport.Pass())); | 173 new JingleSessionManager(client_transport.Pass())); |
| 176 client_server_->Init(client_signal_strategy_.get(), | 174 client_server_->Init(client_signal_strategy_.get(), |
| 177 &client_server_listener_); | 175 &client_server_listener_); |
| 178 } | 176 } |
| 179 | 177 |
| 180 void CreateSessionManagers(int auth_round_trips, | 178 void CreateSessionManagers(int auth_round_trips, |
| 181 FakeAuthenticator::Action auth_action) { | 179 FakeAuthenticator::Action auth_action) { |
| 182 CreateSessionManagers(auth_round_trips, 0, auth_action); | 180 CreateSessionManagers(auth_round_trips, 0, auth_action); |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 kChannelName, base::Bind(&JingleSessionTest::OnClientChannelCreated, | 528 kChannelName, base::Bind(&JingleSessionTest::OnClientChannelCreated, |
| 531 base::Unretained(this))); | 529 base::Unretained(this))); |
| 532 client_session_->GetTransportChannelFactory()->CancelChannelCreation( | 530 client_session_->GetTransportChannelFactory()->CancelChannelCreation( |
| 533 kChannelName); | 531 kChannelName); |
| 534 | 532 |
| 535 EXPECT_TRUE(!client_socket_.get()); | 533 EXPECT_TRUE(!client_socket_.get()); |
| 536 } | 534 } |
| 537 | 535 |
| 538 } // namespace protocol | 536 } // namespace protocol |
| 539 } // namespace remoting | 537 } // namespace remoting |
| OLD | NEW |