OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <utility> | 5 #include <utility> |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "base/rand_util.h" | 11 #include "base/rand_util.h" |
12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
14 #include "base/synchronization/waitable_event.h" | 14 #include "base/synchronization/waitable_event.h" |
15 #include "base/task_runner_util.h" | 15 #include "base/task_runner_util.h" |
16 #include "base/thread_task_runner_handle.h" | 16 #include "base/thread_task_runner_handle.h" |
17 #include "jingle/glue/thread_wrapper.h" | 17 #include "jingle/glue/thread_wrapper.h" |
18 #include "net/base/test_data_directory.h" | 18 #include "net/base/test_data_directory.h" |
19 #include "net/url_request/url_request_context_getter.h" | 19 #include "net/url_request/url_request_context_getter.h" |
20 #include "remoting/base/rsa_key_pair.h" | 20 #include "remoting/base/rsa_key_pair.h" |
| 21 #include "remoting/base/url_request.h" |
21 #include "remoting/client/audio_player.h" | 22 #include "remoting/client/audio_player.h" |
22 #include "remoting/client/chromoting_client.h" | 23 #include "remoting/client/chromoting_client.h" |
23 #include "remoting/client/client_context.h" | 24 #include "remoting/client/client_context.h" |
24 #include "remoting/client/client_user_interface.h" | 25 #include "remoting/client/client_user_interface.h" |
25 #include "remoting/codec/video_decoder_verbatim.h" | 26 #include "remoting/codec/video_decoder_verbatim.h" |
26 #include "remoting/codec/video_decoder_vpx.h" | 27 #include "remoting/codec/video_decoder_vpx.h" |
27 #include "remoting/host/chromoting_host.h" | 28 #include "remoting/host/chromoting_host.h" |
28 #include "remoting/host/chromoting_host_context.h" | 29 #include "remoting/host/chromoting_host_context.h" |
29 #include "remoting/host/fake_desktop_environment.h" | 30 #include "remoting/host/fake_desktop_environment.h" |
30 #include "remoting/protocol/frame_consumer.h" | 31 #include "remoting/protocol/frame_consumer.h" |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 scoped_ptr<FakePortAllocatorFactory> port_allocator_factory( | 313 scoped_ptr<FakePortAllocatorFactory> port_allocator_factory( |
313 new FakePortAllocatorFactory(fake_network_dispatcher_)); | 314 new FakePortAllocatorFactory(fake_network_dispatcher_)); |
314 port_allocator_factory->socket_factory()->SetBandwidth( | 315 port_allocator_factory->socket_factory()->SetBandwidth( |
315 GetParam().bandwidth, GetParam().max_buffers); | 316 GetParam().bandwidth, GetParam().max_buffers); |
316 port_allocator_factory->socket_factory()->SetLatency( | 317 port_allocator_factory->socket_factory()->SetLatency( |
317 GetParam().latency_average, GetParam().latency_stddev); | 318 GetParam().latency_average, GetParam().latency_stddev); |
318 port_allocator_factory->socket_factory()->set_out_of_order_rate( | 319 port_allocator_factory->socket_factory()->set_out_of_order_rate( |
319 GetParam().out_of_order_rate); | 320 GetParam().out_of_order_rate); |
320 scoped_refptr<protocol::TransportContext> transport_context( | 321 scoped_refptr<protocol::TransportContext> transport_context( |
321 new protocol::TransportContext( | 322 new protocol::TransportContext( |
322 host_signaling_.get(), std::move(port_allocator_factory), | 323 host_signaling_.get(), std::move(port_allocator_factory), nullptr, |
323 network_settings, protocol::TransportRole::SERVER)); | 324 network_settings, protocol::TransportRole::SERVER)); |
324 scoped_ptr<protocol::SessionManager> session_manager( | 325 scoped_ptr<protocol::SessionManager> session_manager( |
325 new protocol::JingleSessionManager(host_signaling_.get())); | 326 new protocol::JingleSessionManager(host_signaling_.get())); |
326 session_manager->set_protocol_config(protocol_config_->Clone()); | 327 session_manager->set_protocol_config(protocol_config_->Clone()); |
327 | 328 |
328 // Encoder runs on a separate thread, main thread is used for everything | 329 // Encoder runs on a separate thread, main thread is used for everything |
329 // else. | 330 // else. |
330 host_.reset(new ChromotingHost( | 331 host_.reset(new ChromotingHost( |
331 &desktop_environment_factory_, std::move(session_manager), | 332 &desktop_environment_factory_, std::move(session_manager), |
332 transport_context, host_thread_.task_runner(), | 333 transport_context, host_thread_.task_runner(), |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 scoped_ptr<FakePortAllocatorFactory> port_allocator_factory( | 378 scoped_ptr<FakePortAllocatorFactory> port_allocator_factory( |
378 new FakePortAllocatorFactory(fake_network_dispatcher_)); | 379 new FakePortAllocatorFactory(fake_network_dispatcher_)); |
379 port_allocator_factory->socket_factory()->SetBandwidth( | 380 port_allocator_factory->socket_factory()->SetBandwidth( |
380 GetParam().bandwidth, GetParam().max_buffers); | 381 GetParam().bandwidth, GetParam().max_buffers); |
381 port_allocator_factory->socket_factory()->SetLatency( | 382 port_allocator_factory->socket_factory()->SetLatency( |
382 GetParam().latency_average, GetParam().latency_stddev); | 383 GetParam().latency_average, GetParam().latency_stddev); |
383 port_allocator_factory->socket_factory()->set_out_of_order_rate( | 384 port_allocator_factory->socket_factory()->set_out_of_order_rate( |
384 GetParam().out_of_order_rate); | 385 GetParam().out_of_order_rate); |
385 scoped_refptr<protocol::TransportContext> transport_context( | 386 scoped_refptr<protocol::TransportContext> transport_context( |
386 new protocol::TransportContext( | 387 new protocol::TransportContext( |
387 host_signaling_.get(), std::move(port_allocator_factory), | 388 host_signaling_.get(), std::move(port_allocator_factory), nullptr, |
388 network_settings, protocol::TransportRole::CLIENT)); | 389 network_settings, protocol::TransportRole::CLIENT)); |
389 | 390 |
390 std::vector<protocol::AuthenticationMethod> auth_methods; | 391 std::vector<protocol::AuthenticationMethod> auth_methods; |
391 auth_methods.push_back(protocol::AuthenticationMethod::Spake2( | 392 auth_methods.push_back(protocol::AuthenticationMethod::Spake2( |
392 protocol::AuthenticationMethod::NONE)); | 393 protocol::AuthenticationMethod::NONE)); |
393 scoped_ptr<protocol::Authenticator> client_authenticator( | 394 scoped_ptr<protocol::Authenticator> client_authenticator( |
394 new protocol::NegotiatingClientAuthenticator( | 395 new protocol::NegotiatingClientAuthenticator( |
395 std::string(), // client_pairing_id | 396 std::string(), // client_pairing_id |
396 std::string(), // client_pairing_secret | 397 std::string(), // client_pairing_secret |
397 std::string(), // authentication_tag | 398 std::string(), // authentication_tag |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 | 632 |
632 TEST_P(ProtocolPerfTest, TotalLatencyIce) { | 633 TEST_P(ProtocolPerfTest, TotalLatencyIce) { |
633 MeasureTotalLatency(false); | 634 MeasureTotalLatency(false); |
634 } | 635 } |
635 | 636 |
636 TEST_P(ProtocolPerfTest, TotalLatencyWebrtc) { | 637 TEST_P(ProtocolPerfTest, TotalLatencyWebrtc) { |
637 MeasureTotalLatency(true); | 638 MeasureTotalLatency(true); |
638 } | 639 } |
639 | 640 |
640 } // namespace remoting | 641 } // namespace remoting |
OLD | NEW |