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/thread_task_runner_handle.h" | 15 #include "base/thread_task_runner_handle.h" |
16 #include "jingle/glue/thread_wrapper.h" | 16 #include "jingle/glue/thread_wrapper.h" |
17 #include "net/base/test_data_directory.h" | 17 #include "net/base/test_data_directory.h" |
18 #include "net/url_request/url_request_context_getter.h" | 18 #include "net/url_request/url_request_context_getter.h" |
19 #include "remoting/base/rsa_key_pair.h" | 19 #include "remoting/base/rsa_key_pair.h" |
20 #include "remoting/client/audio_player.h" | 20 #include "remoting/client/audio_player.h" |
21 #include "remoting/client/chromoting_client.h" | 21 #include "remoting/client/chromoting_client.h" |
22 #include "remoting/client/client_context.h" | 22 #include "remoting/client/client_context.h" |
23 #include "remoting/client/client_user_interface.h" | 23 #include "remoting/client/client_user_interface.h" |
24 #include "remoting/client/video_renderer.h" | |
25 #include "remoting/host/chromoting_host.h" | 24 #include "remoting/host/chromoting_host.h" |
26 #include "remoting/host/chromoting_host_context.h" | 25 #include "remoting/host/chromoting_host_context.h" |
27 #include "remoting/host/fake_desktop_environment.h" | 26 #include "remoting/host/fake_desktop_environment.h" |
28 #include "remoting/protocol/jingle_session_manager.h" | 27 #include "remoting/protocol/jingle_session_manager.h" |
29 #include "remoting/protocol/me2me_host_authenticator_factory.h" | 28 #include "remoting/protocol/me2me_host_authenticator_factory.h" |
30 #include "remoting/protocol/negotiating_client_authenticator.h" | 29 #include "remoting/protocol/negotiating_client_authenticator.h" |
31 #include "remoting/protocol/session_config.h" | 30 #include "remoting/protocol/session_config.h" |
32 #include "remoting/protocol/transport_context.h" | 31 #include "remoting/protocol/transport_context.h" |
33 #include "remoting/protocol/video_frame_pump.h" | 32 #include "remoting/protocol/video_frame_pump.h" |
| 33 #include "remoting/protocol/video_renderer.h" |
34 #include "remoting/signaling/fake_signal_strategy.h" | 34 #include "remoting/signaling/fake_signal_strategy.h" |
35 #include "remoting/test/fake_network_dispatcher.h" | 35 #include "remoting/test/fake_network_dispatcher.h" |
36 #include "remoting/test/fake_port_allocator.h" | 36 #include "remoting/test/fake_port_allocator.h" |
37 #include "remoting/test/fake_socket_factory.h" | 37 #include "remoting/test/fake_socket_factory.h" |
38 #include "testing/gtest/include/gtest/gtest.h" | 38 #include "testing/gtest/include/gtest/gtest.h" |
39 | 39 |
40 namespace remoting { | 40 namespace remoting { |
41 | 41 |
42 using protocol::ChannelConfig; | 42 using protocol::ChannelConfig; |
43 | 43 |
(...skipping 26 matching lines...) Expand all Loading... |
70 ~FakeCursorShapeStub() override {} | 70 ~FakeCursorShapeStub() override {} |
71 | 71 |
72 // protocol::CursorShapeStub interface. | 72 // protocol::CursorShapeStub interface. |
73 void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape) override{}; | 73 void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape) override{}; |
74 }; | 74 }; |
75 | 75 |
76 class ProtocolPerfTest | 76 class ProtocolPerfTest |
77 : public testing::Test, | 77 : public testing::Test, |
78 public testing::WithParamInterface<NetworkPerformanceParams>, | 78 public testing::WithParamInterface<NetworkPerformanceParams>, |
79 public ClientUserInterface, | 79 public ClientUserInterface, |
80 public VideoRenderer, | 80 public protocol::VideoRenderer, |
81 public protocol::VideoStub, | 81 public protocol::VideoStub, |
82 public HostStatusObserver { | 82 public HostStatusObserver { |
83 public: | 83 public: |
84 ProtocolPerfTest() | 84 ProtocolPerfTest() |
85 : host_thread_("host"), | 85 : host_thread_("host"), |
86 capture_thread_("capture"), | 86 capture_thread_("capture"), |
87 encode_thread_("encode") { | 87 encode_thread_("encode") { |
88 protocol::VideoFramePump::EnableTimestampsForTests(); | 88 protocol::VideoFramePump::EnableTimestampsForTests(); |
89 host_thread_.StartWithOptions( | 89 host_thread_.StartWithOptions( |
90 base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); | 90 base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 << "ms Encode: " << last_video_packet_->encode_time_ms() | 482 << "ms Encode: " << last_video_packet_->encode_time_ms() |
483 << "ms Capture: " << last_video_packet_->capture_time_ms() | 483 << "ms Capture: " << last_video_packet_->capture_time_ms() |
484 << "ms"; | 484 << "ms"; |
485 sum += latency; | 485 sum += latency; |
486 } | 486 } |
487 | 487 |
488 LOG(INFO) << "Average: " << (sum / kFrames).InMillisecondsF(); | 488 LOG(INFO) << "Average: " << (sum / kFrames).InMillisecondsF(); |
489 } | 489 } |
490 | 490 |
491 } // namespace remoting | 491 } // namespace remoting |
OLD | NEW |