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

Side by Side Diff: remoting/protocol/jingle_session_unittest.cc

Issue 10233021: Move PortAllocator creation out of LibjingleTransportFactory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
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.h" 8 #include "base/message_loop.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "base/test/test_timeouts.h" 10 #include "base/test/test_timeouts.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 void CreateSessionManagers(int auth_round_trips, 132 void CreateSessionManagers(int auth_round_trips,
133 FakeAuthenticator::Action auth_action) { 133 FakeAuthenticator::Action auth_action) {
134 host_signal_strategy_.reset(new FakeSignalStrategy(kHostJid)); 134 host_signal_strategy_.reset(new FakeSignalStrategy(kHostJid));
135 client_signal_strategy_.reset(new FakeSignalStrategy(kClientJid)); 135 client_signal_strategy_.reset(new FakeSignalStrategy(kClientJid));
136 FakeSignalStrategy::Connect(host_signal_strategy_.get(), 136 FakeSignalStrategy::Connect(host_signal_strategy_.get(),
137 client_signal_strategy_.get()); 137 client_signal_strategy_.get());
138 138
139 EXPECT_CALL(host_server_listener_, OnSessionManagerReady()) 139 EXPECT_CALL(host_server_listener_, OnSessionManagerReady())
140 .Times(1); 140 .Times(1);
141 host_server_.reset(new JingleSessionManager( 141 host_server_.reset(new JingleSessionManager(
142 scoped_ptr<TransportFactory>(new LibjingleTransportFactory()))); 142 scoped_ptr<TransportFactory>(new LibjingleTransportFactory()),
143 host_server_->Init(host_signal_strategy_.get(), &host_server_listener_, 143 false));
144 NetworkSettings(false)); 144 host_server_->Init(host_signal_strategy_.get(), &host_server_listener_);
145 145
146 scoped_ptr<AuthenticatorFactory> factory( 146 scoped_ptr<AuthenticatorFactory> factory(
147 new FakeHostAuthenticatorFactory(auth_round_trips, auth_action, true)); 147 new FakeHostAuthenticatorFactory(auth_round_trips, auth_action, true));
148 host_server_->set_authenticator_factory(factory.Pass()); 148 host_server_->set_authenticator_factory(factory.Pass());
149 149
150 EXPECT_CALL(client_server_listener_, OnSessionManagerReady()) 150 EXPECT_CALL(client_server_listener_, OnSessionManagerReady())
151 .Times(1); 151 .Times(1);
152 client_server_.reset(new JingleSessionManager( 152 client_server_.reset(new JingleSessionManager(
153 scoped_ptr<TransportFactory>(new LibjingleTransportFactory()))); 153 scoped_ptr<TransportFactory>(new LibjingleTransportFactory()), false));
154 client_server_->Init(client_signal_strategy_.get(), 154 client_server_->Init(client_signal_strategy_.get(),
155 &client_server_listener_, NetworkSettings( 155 &client_server_listener_);
156 TransportConfig::NAT_TRAVERSAL_OUTGOING));
157 } 156 }
158 157
159 void CloseSessionManager() { 158 void CloseSessionManager() {
160 if (host_server_.get()) { 159 if (host_server_.get()) {
161 host_server_->Close(); 160 host_server_->Close();
162 host_server_.reset(); 161 host_server_.reset();
163 } 162 }
164 if (client_server_.get()) { 163 if (client_server_.get()) {
165 client_server_->Close(); 164 client_server_->Close();
166 client_server_.reset(); 165 client_server_.reset();
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 EXPECT_CALL(client_channel_callback_, OnDone(_)) 391 EXPECT_CALL(client_channel_callback_, OnDone(_))
393 .Times(AtMost(1)); 392 .Times(AtMost(1));
394 393
395 message_loop_->Run(); 394 message_loop_->Run();
396 395
397 EXPECT_TRUE(!host_socket_.get()); 396 EXPECT_TRUE(!host_socket_.get());
398 } 397 }
399 398
400 } // namespace protocol 399 } // namespace protocol
401 } // namespace remoting 400 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698