Index: remoting/test/test_chromoting_client.cc |
diff --git a/remoting/test/test_chromoting_client.cc b/remoting/test/test_chromoting_client.cc |
index da19a6d0ce10dc2bdb3a53929fa3c469b81ed8a9..2e678e4ad0e55cd951f6ab9443ccf4294af06051 100644 |
--- a/remoting/test/test_chromoting_client.cc |
+++ b/remoting/test/test_chromoting_client.cc |
@@ -107,17 +107,19 @@ void TestChromotingClient::StartConnection( |
test_connection_to_host_.Pass()); |
} |
- XmppSignalStrategy::XmppServerConfig xmpp_server_config; |
- xmpp_server_config.host = kXmppHostName; |
- xmpp_server_config.port = kXmppPortNumber; |
- xmpp_server_config.use_tls = true; |
- xmpp_server_config.username = connection_setup_info.user_name; |
- xmpp_server_config.auth_token = connection_setup_info.access_token; |
- |
- // Set up the signal strategy. This must outlive the client object. |
- signal_strategy_.reset( |
- new XmppSignalStrategy(net::ClientSocketFactory::GetDefaultFactory(), |
- request_context_getter, xmpp_server_config)); |
+ if (!signal_strategy_) { |
+ XmppSignalStrategy::XmppServerConfig xmpp_server_config; |
+ xmpp_server_config.host = kXmppHostName; |
+ xmpp_server_config.port = kXmppPortNumber; |
+ xmpp_server_config.use_tls = true; |
+ xmpp_server_config.username = connection_setup_info.user_name; |
+ xmpp_server_config.auth_token = connection_setup_info.access_token; |
+ |
+ // Set up the signal strategy. This must outlive the client object. |
+ signal_strategy_.reset( |
+ new XmppSignalStrategy(net::ClientSocketFactory::GetDefaultFactory(), |
+ request_context_getter, xmpp_server_config)); |
+ } |
protocol::NetworkSettings network_settings( |
protocol::NetworkSettings::NAT_TRAVERSAL_FULL); |
@@ -187,6 +189,11 @@ void TestChromotingClient::RemoveRemoteConnectionObserver( |
connection_observers_.RemoveObserver(observer); |
} |
+void TestChromotingClient::SetSignalStrategyForTests( |
+ scoped_ptr<SignalStrategy> signal_strategy) { |
+ signal_strategy_ = signal_strategy.Pass(); |
+} |
+ |
void TestChromotingClient::SetConnectionToHostForTests( |
scoped_ptr<protocol::ConnectionToHost> connection_to_host) { |
test_connection_to_host_ = connection_to_host.Pass(); |