summaryrefslogtreecommitdiffstats
path: root/remoting/test
diff options
context:
space:
mode:
authorsergeyu <sergeyu@chromium.org>2016-02-11 15:47:01 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-11 23:48:38 +0000
commitc3c43e8732254dedcbd313629f8c9eba93dff6fa (patch)
treedec7b5fa7233c9063fa651e7dbebe1242b303826 /remoting/test
parentcb092cd91ca95112508d2b86af2b8199e1b90e77 (diff)
downloadchromium_src-c3c43e8732254dedcbd313629f8c9eba93dff6fa.zip
chromium_src-c3c43e8732254dedcbd313629f8c9eba93dff6fa.tar.gz
chromium_src-c3c43e8732254dedcbd313629f8c9eba93dff6fa.tar.bz2
Use UrlRequest in PortAllocator.
PepperPortAllocator and ChromiumPortAllocator were different only in how they were sending HTTP requests to allocate relay session. They were using pp::URLLoader and net::URLFetcher respectively, but otherwise contained largely the same logic. Now URL request logic is abstracted with remoting::UrlRequest interface and so a single PortAllocator implementation can be used in all cases. BUG=577954 Review URL: https://codereview.chromium.org/1681393006 Cr-Commit-Position: refs/heads/master@{#375042}
Diffstat (limited to 'remoting/test')
-rw-r--r--remoting/test/protocol_perftest.cc5
-rw-r--r--remoting/test/test_chromoting_client.cc11
2 files changed, 9 insertions, 7 deletions
diff --git a/remoting/test/protocol_perftest.cc b/remoting/test/protocol_perftest.cc
index 3d09b8c..0a0c084 100644
--- a/remoting/test/protocol_perftest.cc
+++ b/remoting/test/protocol_perftest.cc
@@ -18,6 +18,7 @@
#include "net/base/test_data_directory.h"
#include "net/url_request/url_request_context_getter.h"
#include "remoting/base/rsa_key_pair.h"
+#include "remoting/base/url_request.h"
#include "remoting/client/audio_player.h"
#include "remoting/client/chromoting_client.h"
#include "remoting/client/client_context.h"
@@ -319,7 +320,7 @@ class ProtocolPerfTest
GetParam().out_of_order_rate);
scoped_refptr<protocol::TransportContext> transport_context(
new protocol::TransportContext(
- host_signaling_.get(), std::move(port_allocator_factory),
+ host_signaling_.get(), std::move(port_allocator_factory), nullptr,
network_settings, protocol::TransportRole::SERVER));
scoped_ptr<protocol::SessionManager> session_manager(
new protocol::JingleSessionManager(host_signaling_.get()));
@@ -384,7 +385,7 @@ class ProtocolPerfTest
GetParam().out_of_order_rate);
scoped_refptr<protocol::TransportContext> transport_context(
new protocol::TransportContext(
- host_signaling_.get(), std::move(port_allocator_factory),
+ host_signaling_.get(), std::move(port_allocator_factory), nullptr,
network_settings, protocol::TransportRole::CLIENT));
std::vector<protocol::AuthenticationMethod> auth_methods;
diff --git a/remoting/test/test_chromoting_client.cc b/remoting/test/test_chromoting_client.cc
index 027cd01..b48d611 100644
--- a/remoting/test/test_chromoting_client.cc
+++ b/remoting/test/test_chromoting_client.cc
@@ -13,12 +13,13 @@
#include "jingle/glue/thread_wrapper.h"
#include "net/base/request_priority.h"
#include "net/socket/client_socket_factory.h"
+#include "remoting/base/chromium_url_request.h"
#include "remoting/base/url_request_context_getter.h"
#include "remoting/client/audio_player.h"
#include "remoting/client/chromoting_client.h"
#include "remoting/client/client_context.h"
#include "remoting/client/token_fetcher_proxy.h"
-#include "remoting/protocol/chromium_port_allocator.h"
+#include "remoting/protocol/chromium_port_allocator_factory.h"
#include "remoting/protocol/host_stub.h"
#include "remoting/protocol/negotiating_client_authenticator.h"
#include "remoting/protocol/network_settings.h"
@@ -125,12 +126,12 @@ void TestChromotingClient::StartConnection(
protocol::NetworkSettings network_settings(
protocol::NetworkSettings::NAT_TRAVERSAL_FULL);
- scoped_ptr<protocol::ChromiumPortAllocatorFactory> port_allocator_factory(
- new protocol::ChromiumPortAllocatorFactory(request_context_getter));
-
scoped_refptr<protocol::TransportContext> transport_context(
new protocol::TransportContext(
- signal_strategy_.get(), std::move(port_allocator_factory),
+ signal_strategy_.get(),
+ make_scoped_ptr(new protocol::ChromiumPortAllocatorFactory()),
+ make_scoped_ptr(
+ new ChromiumUrlRequestFactory(request_context_getter)),
network_settings, protocol::TransportRole::CLIENT));
scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher>