OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_ | 5 #ifndef REMOTING_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_ |
6 #define REMOTING_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_ | 6 #define REMOTING_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_ |
7 | 7 |
8 #include <cstdint> | 8 #include <cstdint> |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "remoting/protocol/client_stub.h" | 23 #include "remoting/protocol/client_stub.h" |
24 #include "remoting/protocol/clipboard_stub.h" | 24 #include "remoting/protocol/clipboard_stub.h" |
25 #include "remoting/protocol/connection_to_client.h" | 25 #include "remoting/protocol/connection_to_client.h" |
26 #include "remoting/protocol/host_stub.h" | 26 #include "remoting/protocol/host_stub.h" |
27 #include "remoting/protocol/input_stub.h" | 27 #include "remoting/protocol/input_stub.h" |
28 #include "remoting/protocol/pairing_registry.h" | 28 #include "remoting/protocol/pairing_registry.h" |
29 #include "remoting/protocol/session.h" | 29 #include "remoting/protocol/session.h" |
30 #include "remoting/protocol/session_manager.h" | 30 #include "remoting/protocol/session_manager.h" |
31 #include "remoting/protocol/transport.h" | 31 #include "remoting/protocol/transport.h" |
32 #include "remoting/protocol/video_stub.h" | 32 #include "remoting/protocol/video_stub.h" |
| 33 #include "remoting/signaling/signaling_address.h" |
33 #include "testing/gmock/include/gmock/gmock.h" | 34 #include "testing/gmock/include/gmock/gmock.h" |
34 #include "third_party/libjingle_xmpp/xmllite/xmlelement.h" | 35 #include "third_party/libjingle_xmpp/xmllite/xmlelement.h" |
35 | 36 |
36 namespace remoting { | 37 namespace remoting { |
37 | 38 |
38 class VideoEncoder; | 39 class VideoEncoder; |
39 | 40 |
40 namespace protocol { | 41 namespace protocol { |
41 | 42 |
42 class MockAuthenticator : public Authenticator { | 43 class MockAuthenticator : public Authenticator { |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 200 |
200 class MockSessionManager : public SessionManager { | 201 class MockSessionManager : public SessionManager { |
201 public: | 202 public: |
202 MockSessionManager(); | 203 MockSessionManager(); |
203 ~MockSessionManager() override; | 204 ~MockSessionManager() override; |
204 | 205 |
205 MOCK_METHOD1(AcceptIncoming, void(const IncomingSessionCallback&)); | 206 MOCK_METHOD1(AcceptIncoming, void(const IncomingSessionCallback&)); |
206 void set_protocol_config( | 207 void set_protocol_config( |
207 std::unique_ptr<CandidateSessionConfig> config) override {} | 208 std::unique_ptr<CandidateSessionConfig> config) override {} |
208 MOCK_METHOD2(ConnectPtr, | 209 MOCK_METHOD2(ConnectPtr, |
209 Session*(const std::string& host_jid, | 210 Session*(const SignalingAddress& peer_address, |
210 Authenticator* authenticator)); | 211 Authenticator* authenticator)); |
211 MOCK_METHOD0(Close, void()); | 212 MOCK_METHOD0(Close, void()); |
212 MOCK_METHOD1(set_authenticator_factory_ptr, | 213 MOCK_METHOD1(set_authenticator_factory_ptr, |
213 void(AuthenticatorFactory* factory)); | 214 void(AuthenticatorFactory* factory)); |
214 std::unique_ptr<Session> Connect( | 215 std::unique_ptr<Session> Connect( |
215 const std::string& host_jid, | 216 const SignalingAddress& peer_address, |
216 std::unique_ptr<Authenticator> authenticator) override { | 217 std::unique_ptr<Authenticator> authenticator) override { |
217 return base::WrapUnique(ConnectPtr(host_jid, authenticator.get())); | 218 return base::WrapUnique(ConnectPtr(peer_address, authenticator.get())); |
218 } | 219 } |
219 void set_authenticator_factory( | 220 void set_authenticator_factory( |
220 std::unique_ptr<AuthenticatorFactory> authenticator_factory) override { | 221 std::unique_ptr<AuthenticatorFactory> authenticator_factory) override { |
221 set_authenticator_factory_ptr(authenticator_factory.release()); | 222 set_authenticator_factory_ptr(authenticator_factory.release()); |
222 } | 223 } |
223 | 224 |
224 private: | 225 private: |
225 DISALLOW_COPY_AND_ASSIGN(MockSessionManager); | 226 DISALLOW_COPY_AND_ASSIGN(MockSessionManager); |
226 }; | 227 }; |
227 | 228 |
(...skipping 26 matching lines...) Expand all Loading... |
254 // Runs tasks synchronously instead of posting them to |task_runner|. | 255 // Runs tasks synchronously instead of posting them to |task_runner|. |
255 void PostTask(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 256 void PostTask(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
256 const tracked_objects::Location& from_here, | 257 const tracked_objects::Location& from_here, |
257 const base::Closure& task) override; | 258 const base::Closure& task) override; |
258 }; | 259 }; |
259 | 260 |
260 } // namespace protocol | 261 } // namespace protocol |
261 } // namespace remoting | 262 } // namespace remoting |
262 | 263 |
263 #endif // REMOTING_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_ | 264 #endif // REMOTING_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_ |
OLD | NEW |