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 <string> | 8 #include <string> |
9 | 9 |
10 #include "net/base/ip_endpoint.h" | 10 #include "net/base/ip_endpoint.h" |
11 #include "remoting/proto/internal.pb.h" | 11 #include "remoting/proto/internal.pb.h" |
12 #include "remoting/proto/video.pb.h" | 12 #include "remoting/proto/video.pb.h" |
| 13 #include "remoting/protocol/authenticator.h" |
13 #include "remoting/protocol/client_stub.h" | 14 #include "remoting/protocol/client_stub.h" |
14 #include "remoting/protocol/clipboard_stub.h" | 15 #include "remoting/protocol/clipboard_stub.h" |
15 #include "remoting/protocol/connection_to_client.h" | 16 #include "remoting/protocol/connection_to_client.h" |
16 #include "remoting/protocol/host_event_stub.h" | 17 #include "remoting/protocol/host_event_stub.h" |
17 #include "remoting/protocol/host_stub.h" | 18 #include "remoting/protocol/host_stub.h" |
18 #include "remoting/protocol/input_stub.h" | 19 #include "remoting/protocol/input_stub.h" |
19 #include "remoting/protocol/session.h" | 20 #include "remoting/protocol/session.h" |
| 21 #include "remoting/protocol/session_manager.h" |
20 #include "remoting/protocol/transport.h" | 22 #include "remoting/protocol/transport.h" |
21 #include "remoting/protocol/video_stub.h" | 23 #include "remoting/protocol/video_stub.h" |
22 #include "testing/gmock/include/gmock/gmock.h" | 24 #include "testing/gmock/include/gmock/gmock.h" |
23 | 25 |
24 namespace remoting { | 26 namespace remoting { |
25 namespace protocol { | 27 namespace protocol { |
26 | 28 |
27 class MockConnectionToClient : public ConnectionToClient { | 29 class MockConnectionToClient : public ConnectionToClient { |
28 public: | 30 public: |
29 MockConnectionToClient(Session* session, | 31 MockConnectionToClient(Session* session, |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 MOCK_METHOD0(receiver_token, const std::string&()); | 171 MOCK_METHOD0(receiver_token, const std::string&()); |
170 MOCK_METHOD1(set_receiver_token, void(const std::string& receiver_token)); | 172 MOCK_METHOD1(set_receiver_token, void(const std::string& receiver_token)); |
171 MOCK_METHOD1(set_shared_secret, void(const std::string& secret)); | 173 MOCK_METHOD1(set_shared_secret, void(const std::string& secret)); |
172 MOCK_METHOD0(shared_secret, const std::string&()); | 174 MOCK_METHOD0(shared_secret, const std::string&()); |
173 MOCK_METHOD0(Close, void()); | 175 MOCK_METHOD0(Close, void()); |
174 | 176 |
175 private: | 177 private: |
176 DISALLOW_COPY_AND_ASSIGN(MockSession); | 178 DISALLOW_COPY_AND_ASSIGN(MockSession); |
177 }; | 179 }; |
178 | 180 |
| 181 class MockSessionManager : public SessionManager { |
| 182 public: |
| 183 MockSessionManager(); |
| 184 virtual ~MockSessionManager(); |
| 185 |
| 186 MOCK_METHOD2(Init, void(SignalStrategy*, Listener*)); |
| 187 MOCK_METHOD4(ConnectPtr, Session*( |
| 188 const std::string&, |
| 189 Authenticator*, |
| 190 CandidateSessionConfig*, |
| 191 const Session::StateChangeCallback&)); |
| 192 MOCK_METHOD0(Close, void()); |
| 193 MOCK_METHOD1(set_authenticator_factory_ptr, void(AuthenticatorFactory*)); |
| 194 virtual scoped_ptr<Session> Connect( |
| 195 const std::string& host_jid, |
| 196 scoped_ptr<Authenticator> authenticator, |
| 197 scoped_ptr<CandidateSessionConfig> config, |
| 198 const Session::StateChangeCallback& state_change_callback) { |
| 199 return scoped_ptr<Session>(ConnectPtr( |
| 200 host_jid, |
| 201 authenticator.get(), |
| 202 config.get(), |
| 203 state_change_callback)); |
| 204 }; |
| 205 virtual void set_authenticator_factory( |
| 206 scoped_ptr<AuthenticatorFactory> authenticator_factory) { |
| 207 set_authenticator_factory_ptr(authenticator_factory.release()); |
| 208 }; |
| 209 |
| 210 private: |
| 211 DISALLOW_COPY_AND_ASSIGN(MockSessionManager); |
| 212 }; |
| 213 |
179 } // namespace protocol | 214 } // namespace protocol |
180 } // namespace remoting | 215 } // namespace remoting |
181 | 216 |
182 #endif // REMOTING_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_ | 217 #endif // REMOTING_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_ |
OLD | NEW |