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

Unified Diff: remoting/test/test_chromoting_client.cc

Issue 1520323007: Simplify ConnectionToHost interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sm_cleanup
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/test/test_chromoting_client.h ('k') | remoting/test/test_chromoting_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « remoting/test/test_chromoting_client.h ('k') | remoting/test/test_chromoting_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698