OLD | NEW |
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 #ifndef REMOTING_TEST_TEST_CHROMOTING_CLIENT_H_ | 5 #ifndef REMOTING_TEST_TEST_CHROMOTING_CLIENT_H_ |
6 #define REMOTING_TEST_TEST_CHROMOTING_CLIENT_H_ | 6 #define REMOTING_TEST_TEST_CHROMOTING_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "remoting/client/chromoting_client.h" | 14 #include "remoting/client/chromoting_client.h" |
15 #include "remoting/client/client_user_interface.h" | 15 #include "remoting/client/client_user_interface.h" |
16 #include "remoting/protocol/clipboard_filter.h" | 16 #include "remoting/protocol/clipboard_filter.h" |
17 #include "remoting/protocol/cursor_shape_stub.h" | 17 #include "remoting/protocol/cursor_shape_stub.h" |
18 #include "remoting/test/remote_connection_observer.h" | 18 #include "remoting/test/remote_connection_observer.h" |
19 | 19 |
20 namespace remoting { | 20 namespace remoting { |
21 | 21 |
22 class ClientContext; | 22 class ClientContext; |
23 class XmppSignalStrategy; | 23 class XmppSignalStrategy; |
24 class VideoRenderer; | |
25 | 24 |
26 namespace protocol { | 25 namespace protocol { |
27 class ClipboardStub; | 26 class ClipboardStub; |
28 class HostStub; | 27 class HostStub; |
29 class InputStub; | 28 class InputStub; |
| 29 class VideoRenderer; |
30 } // namespace protocol | 30 } // namespace protocol |
31 | 31 |
32 namespace test { | 32 namespace test { |
33 | 33 |
34 struct ConnectionSetupInfo; | 34 struct ConnectionSetupInfo; |
35 | 35 |
36 // Manages a chromoting connection to a remote host. Destroying a | 36 // Manages a chromoting connection to a remote host. Destroying a |
37 // TestChromotingClient object with an active connection will close it. | 37 // TestChromotingClient object with an active connection will close it. |
38 // Must be used from a thread running an IO message loop. | 38 // Must be used from a thread running an IO message loop. |
39 // RemoteConnectionObserver objects must not destroy this class within a | 39 // RemoteConnectionObserver objects must not destroy this class within a |
40 // callback. | 40 // callback. |
41 // A VideoRenderer can be passed in to customize the connection. | 41 // A VideoRenderer can be passed in to customize the connection. |
42 class TestChromotingClient : public ClientUserInterface, | 42 class TestChromotingClient : public ClientUserInterface, |
43 public protocol::ClipboardStub, | 43 public protocol::ClipboardStub, |
44 public protocol::CursorShapeStub { | 44 public protocol::CursorShapeStub { |
45 public: | 45 public: |
46 TestChromotingClient(); | 46 TestChromotingClient(); |
47 explicit TestChromotingClient(scoped_ptr<VideoRenderer> video_renderer); | 47 explicit TestChromotingClient( |
| 48 scoped_ptr<protocol::VideoRenderer> video_renderer); |
48 ~TestChromotingClient() override; | 49 ~TestChromotingClient() override; |
49 | 50 |
50 // Starts a Chromoting connection using the specified connection setup info. | 51 // Starts a Chromoting connection using the specified connection setup info. |
51 void StartConnection(const ConnectionSetupInfo& connection_setup_info); | 52 void StartConnection(const ConnectionSetupInfo& connection_setup_info); |
52 | 53 |
53 // Ends the current remote connection and updates the connection state. | 54 // Ends the current remote connection and updates the connection state. |
54 void EndConnection(); | 55 void EndConnection(); |
55 | 56 |
56 // Stubs used to send messages to the remote host. | 57 // Stubs used to send messages to the remote host. |
57 protocol::ClipboardStub* clipboard_forwarder() { | 58 protocol::ClipboardStub* clipboard_forwarder() { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // ConnectionToHost used by TestChromotingClient tests. | 108 // ConnectionToHost used by TestChromotingClient tests. |
108 scoped_ptr<protocol::ConnectionToHost> test_connection_to_host_; | 109 scoped_ptr<protocol::ConnectionToHost> test_connection_to_host_; |
109 | 110 |
110 // Creates and manages the connection to the remote host. | 111 // Creates and manages the connection to the remote host. |
111 scoped_ptr<ChromotingClient> chromoting_client_; | 112 scoped_ptr<ChromotingClient> chromoting_client_; |
112 | 113 |
113 // Manages the threads and task runners for |chromoting_client_|. | 114 // Manages the threads and task runners for |chromoting_client_|. |
114 scoped_ptr<ClientContext> client_context_; | 115 scoped_ptr<ClientContext> client_context_; |
115 | 116 |
116 // Processes video packets from the host. | 117 // Processes video packets from the host. |
117 scoped_ptr<VideoRenderer> video_renderer_; | 118 scoped_ptr<protocol::VideoRenderer> video_renderer_; |
118 | 119 |
119 // SignalStrategy used for connection signaling. | 120 // SignalStrategy used for connection signaling. |
120 scoped_ptr<SignalStrategy> signal_strategy_; | 121 scoped_ptr<SignalStrategy> signal_strategy_; |
121 | 122 |
122 DISALLOW_COPY_AND_ASSIGN(TestChromotingClient); | 123 DISALLOW_COPY_AND_ASSIGN(TestChromotingClient); |
123 }; | 124 }; |
124 | 125 |
125 } // namespace test | 126 } // namespace test |
126 } // namespace remoting | 127 } // namespace remoting |
127 | 128 |
128 #endif // REMOTING_TEST_TEST_CHROMOTING_CLIENT_H_ | 129 #endif // REMOTING_TEST_TEST_CHROMOTING_CLIENT_H_ |
OLD | NEW |