Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: remoting/protocol/protocol_mock_objects.h

Issue 10538091: [Chromoting] Make ChromotingHost's dependency on libjingle injected, instead of hard-coded. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch for Windows. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/host/simple_host_process.cc ('k') | remoting/protocol/protocol_mock_objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « remoting/host/simple_host_process.cc ('k') | remoting/protocol/protocol_mock_objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698