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

Side by Side Diff: remoting/host/host_mock_objects.h

Issue 138753005: Add gnubby authentication to remoting host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Actually add braces Created 6 years, 10 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
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_HOST_HOST_MOCK_OBJECTS_H_ 5 #ifndef REMOTING_HOST_HOST_MOCK_OBJECTS_H_
6 #define REMOTING_HOST_HOST_MOCK_OBJECTS_H_ 6 #define REMOTING_HOST_HOST_MOCK_OBJECTS_H_
7 7
8 #include <string>
9
8 #include "net/base/ip_endpoint.h" 10 #include "net/base/ip_endpoint.h"
9 #include "remoting/host/chromoting_host_context.h" 11 #include "remoting/host/chromoting_host_context.h"
10 #include "remoting/host/client_session.h" 12 #include "remoting/host/client_session.h"
11 #include "remoting/host/client_session_control.h" 13 #include "remoting/host/client_session_control.h"
12 #include "remoting/host/desktop_environment.h" 14 #include "remoting/host/desktop_environment.h"
15 #include "remoting/host/gnubby_auth_handler.h"
16 #include "remoting/host/gnubby_connection.h"
17 #include "remoting/host/gnubby_connection_factory.h"
13 #include "remoting/host/host_status_observer.h" 18 #include "remoting/host/host_status_observer.h"
14 #include "remoting/host/input_injector.h" 19 #include "remoting/host/input_injector.h"
15 #include "remoting/host/screen_controls.h" 20 #include "remoting/host/screen_controls.h"
16 #include "remoting/host/screen_resolution.h" 21 #include "remoting/host/screen_resolution.h"
17 #include "remoting/proto/control.pb.h" 22 #include "remoting/proto/control.pb.h"
18 #include "testing/gmock/include/gmock/gmock.h" 23 #include "testing/gmock/include/gmock/gmock.h"
19 24
20 namespace base { 25 namespace base {
21 class SingleThreadTaskRunner; 26 class SingleThreadTaskRunner;
22 } // namespace base 27 } // namespace base
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 MOCK_METHOD1(OnClientConnected, void(const std::string& jid)); 124 MOCK_METHOD1(OnClientConnected, void(const std::string& jid));
120 MOCK_METHOD1(OnClientDisconnected, void(const std::string& jid)); 125 MOCK_METHOD1(OnClientDisconnected, void(const std::string& jid));
121 MOCK_METHOD3(OnClientRouteChange, 126 MOCK_METHOD3(OnClientRouteChange,
122 void(const std::string& jid, 127 void(const std::string& jid,
123 const std::string& channel_name, 128 const std::string& channel_name,
124 const protocol::TransportRoute& route)); 129 const protocol::TransportRoute& route));
125 MOCK_METHOD1(OnStart, void(const std::string& xmpp_login)); 130 MOCK_METHOD1(OnStart, void(const std::string& xmpp_login));
126 MOCK_METHOD0(OnShutdown, void()); 131 MOCK_METHOD0(OnShutdown, void());
127 }; 132 };
128 133
134 class MockGnubbyAuthHandler : public GnubbyAuthHandler {
135 public:
136 MockGnubbyAuthHandler(
137 GnubbyConnectionFactory* gnubby_connection_factory,
138 protocol::ClientStub* client_stub);
139 virtual ~MockGnubbyAuthHandler();
140
141 MOCK_METHOD1(DeliverClientMessage, void(const std::string message));
142 MOCK_METHOD1(ConnectionClosed, void(int connection_id));
143 MOCK_METHOD2(ConnectionError, void(int connection_id, int result));
144 MOCK_CONST_METHOD2(DeliverHostControlMessage,
145 void(const std::string control_type,
146 const std::string data));
147 MOCK_CONST_METHOD2(DeliverHostDataMessage,
148 void(int connection_id, const std::string data));
149
150 private:
151 DISALLOW_COPY_AND_ASSIGN(MockGnubbyAuthHandler);
152 };
153
154 class MockGnubbyConnection : public GnubbyConnection {
155 public:
156 MockGnubbyConnection(
157 GnubbyAuthHandler* auth_handler,
158 int connection_id,
159 net::StreamSocket* socket);
160 virtual ~MockGnubbyConnection();
161
162 MOCK_METHOD0(Read, void());
163 MOCK_METHOD1(Write, void(const std::string& data));
164
165 private:
166 DISALLOW_COPY_AND_ASSIGN(MockGnubbyConnection);
167 };
168
169 class MockGnubbyConnectionFactory : public GnubbyConnectionFactory {
170 public:
171 MockGnubbyConnectionFactory();
172 virtual ~MockGnubbyConnectionFactory();
173
174 MOCK_METHOD3(Create,
175 GnubbyConnection*(GnubbyAuthHandler* auth_handler,
176 int connection_id,
177 net::StreamSocket* socket));
178
179 private:
180 DISALLOW_COPY_AND_ASSIGN(MockGnubbyConnectionFactory);
181 };
182
129 } // namespace remoting 183 } // namespace remoting
130 184
131 #endif // REMOTING_HOST_HOST_MOCK_OBJECTS_H_ 185 #endif // REMOTING_HOST_HOST_MOCK_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698