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

Side by Side Diff: remoting/test/test_chromoting_client.cc

Issue 1681393006: Use UrlRequest in PortAllocator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « remoting/test/protocol_perftest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/test/test_chromoting_client.h" 5 #include "remoting/test/test_chromoting_client.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/thread_task_runner_handle.h" 12 #include "base/thread_task_runner_handle.h"
13 #include "jingle/glue/thread_wrapper.h" 13 #include "jingle/glue/thread_wrapper.h"
14 #include "net/base/request_priority.h" 14 #include "net/base/request_priority.h"
15 #include "net/socket/client_socket_factory.h" 15 #include "net/socket/client_socket_factory.h"
16 #include "remoting/base/chromium_url_request.h"
16 #include "remoting/base/url_request_context_getter.h" 17 #include "remoting/base/url_request_context_getter.h"
17 #include "remoting/client/audio_player.h" 18 #include "remoting/client/audio_player.h"
18 #include "remoting/client/chromoting_client.h" 19 #include "remoting/client/chromoting_client.h"
19 #include "remoting/client/client_context.h" 20 #include "remoting/client/client_context.h"
20 #include "remoting/client/token_fetcher_proxy.h" 21 #include "remoting/client/token_fetcher_proxy.h"
21 #include "remoting/protocol/chromium_port_allocator.h" 22 #include "remoting/protocol/chromium_port_allocator_factory.h"
22 #include "remoting/protocol/host_stub.h" 23 #include "remoting/protocol/host_stub.h"
23 #include "remoting/protocol/negotiating_client_authenticator.h" 24 #include "remoting/protocol/negotiating_client_authenticator.h"
24 #include "remoting/protocol/network_settings.h" 25 #include "remoting/protocol/network_settings.h"
25 #include "remoting/protocol/session_config.h" 26 #include "remoting/protocol/session_config.h"
26 #include "remoting/protocol/third_party_client_authenticator.h" 27 #include "remoting/protocol/third_party_client_authenticator.h"
27 #include "remoting/protocol/transport_context.h" 28 #include "remoting/protocol/transport_context.h"
28 #include "remoting/signaling/xmpp_signal_strategy.h" 29 #include "remoting/signaling/xmpp_signal_strategy.h"
29 #include "remoting/test/connection_setup_info.h" 30 #include "remoting/test/connection_setup_info.h"
30 #include "remoting/test/test_video_renderer.h" 31 #include "remoting/test/test_video_renderer.h"
31 32
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 119
119 // Set up the signal strategy. This must outlive the client object. 120 // Set up the signal strategy. This must outlive the client object.
120 signal_strategy_.reset( 121 signal_strategy_.reset(
121 new XmppSignalStrategy(net::ClientSocketFactory::GetDefaultFactory(), 122 new XmppSignalStrategy(net::ClientSocketFactory::GetDefaultFactory(),
122 request_context_getter, xmpp_server_config)); 123 request_context_getter, xmpp_server_config));
123 } 124 }
124 125
125 protocol::NetworkSettings network_settings( 126 protocol::NetworkSettings network_settings(
126 protocol::NetworkSettings::NAT_TRAVERSAL_FULL); 127 protocol::NetworkSettings::NAT_TRAVERSAL_FULL);
127 128
128 scoped_ptr<protocol::ChromiumPortAllocatorFactory> port_allocator_factory(
129 new protocol::ChromiumPortAllocatorFactory(request_context_getter));
130
131 scoped_refptr<protocol::TransportContext> transport_context( 129 scoped_refptr<protocol::TransportContext> transport_context(
132 new protocol::TransportContext( 130 new protocol::TransportContext(
133 signal_strategy_.get(), std::move(port_allocator_factory), 131 signal_strategy_.get(),
132 make_scoped_ptr(new protocol::ChromiumPortAllocatorFactory()),
133 make_scoped_ptr(
134 new ChromiumUrlRequestFactory(request_context_getter)),
134 network_settings, protocol::TransportRole::CLIENT)); 135 network_settings, protocol::TransportRole::CLIENT));
135 136
136 scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher> 137 scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher>
137 token_fetcher(new TokenFetcherProxy( 138 token_fetcher(new TokenFetcherProxy(
138 base::Bind(&FetchThirdPartyToken, 139 base::Bind(&FetchThirdPartyToken,
139 connection_setup_info.authorization_code, 140 connection_setup_info.authorization_code,
140 connection_setup_info.shared_secret), 141 connection_setup_info.shared_secret),
141 connection_setup_info.public_key)); 142 connection_setup_info.public_key));
142 143
143 protocol::FetchSecretCallback fetch_secret_callback; 144 protocol::FetchSecretCallback fetch_secret_callback;
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 VLOG(1) << "TestChromotingClient::InjectClipboardEvent() Called"; 277 VLOG(1) << "TestChromotingClient::InjectClipboardEvent() Called";
277 } 278 }
278 279
279 void TestChromotingClient::SetCursorShape( 280 void TestChromotingClient::SetCursorShape(
280 const protocol::CursorShapeInfo& cursor_shape) { 281 const protocol::CursorShapeInfo& cursor_shape) {
281 VLOG(1) << "TestChromotingClient::SetCursorShape() Called"; 282 VLOG(1) << "TestChromotingClient::SetCursorShape() Called";
282 } 283 }
283 284
284 } // namespace test 285 } // namespace test
285 } // namespace remoting 286 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/test/protocol_perftest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698