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_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 "net/base/ip_endpoint.h" | 8 #include "net/base/ip_endpoint.h" |
9 #include "remoting/host/capturer.h" | 9 #include "remoting/host/capturer.h" |
10 #include "remoting/host/curtain.h" | 10 #include "remoting/host/curtain.h" |
11 #include "remoting/host/chromoting_host_context.h" | 11 #include "remoting/host/chromoting_host_context.h" |
12 #include "remoting/host/client_session.h" | 12 #include "remoting/host/client_session.h" |
13 #include "remoting/host/continue_window.h" | 13 #include "remoting/host/continue_window.h" |
14 #include "remoting/host/disconnect_window.h" | 14 #include "remoting/host/disconnect_window.h" |
15 #include "remoting/host/event_executor.h" | 15 #include "remoting/host/event_executor.h" |
16 #include "remoting/host/local_input_monitor.h" | 16 #include "remoting/host/local_input_monitor.h" |
17 #include "remoting/host/session_manager_factory.h" | |
17 #include "remoting/host/user_authenticator.h" | 18 #include "remoting/host/user_authenticator.h" |
18 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
19 | 20 |
20 namespace remoting { | 21 namespace remoting { |
21 | 22 |
22 class MockCapturer : public Capturer { | 23 class MockCapturer : public Capturer { |
23 public: | 24 public: |
24 MockCapturer(); | 25 MockCapturer(); |
25 virtual ~MockCapturer(); | 26 virtual ~MockCapturer(); |
26 | 27 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 MOCK_METHOD1(InjectKeyEvent, void(const protocol::KeyEvent& event)); | 129 MOCK_METHOD1(InjectKeyEvent, void(const protocol::KeyEvent& event)); |
129 MOCK_METHOD1(InjectMouseEvent, void(const protocol::MouseEvent& event)); | 130 MOCK_METHOD1(InjectMouseEvent, void(const protocol::MouseEvent& event)); |
130 MOCK_METHOD0(OnSessionFinished, void()); | 131 MOCK_METHOD0(OnSessionFinished, void()); |
131 | 132 |
132 void OnSessionStarted(scoped_ptr<protocol::ClipboardStub> client_clipboard); | 133 void OnSessionStarted(scoped_ptr<protocol::ClipboardStub> client_clipboard); |
133 | 134 |
134 private: | 135 private: |
135 DISALLOW_COPY_AND_ASSIGN(MockEventExecutor); | 136 DISALLOW_COPY_AND_ASSIGN(MockEventExecutor); |
136 }; | 137 }; |
137 | 138 |
139 class MockSessionManagerFactory : public SessionManagerFactory { | |
140 public: | |
141 MockSessionManagerFactory(); | |
142 virtual ~MockSessionManagerFactory(); | |
143 | |
144 MOCK_METHOD2(MakeSessionManagerPtr, protocol::SessionManager*( | |
145 const NetworkSettings& network_settings, | |
146 const scoped_refptr<net::URLRequestContextGetter>& | |
147 url_request_context_getter)); | |
148 scoped_ptr<protocol::SessionManager> MakeSessionManager( | |
149 const NetworkSettings& network_settings, | |
150 const scoped_refptr<net::URLRequestContextGetter>& | |
151 url_request_context_getter) { | |
152 return scoped_ptr<protocol::SessionManager>(MakeSessionManagerPtr( | |
153 network_settings, url_request_context_getter)); | |
Wez
2012/06/11 22:17:06
Although it seems a bit pointless, I think this be
simonmorris
2012/06/11 23:08:59
This way is consistent with protocol_mock_objects.
| |
154 } | |
155 | |
156 private: | |
157 DISALLOW_COPY_AND_ASSIGN(MockSessionManagerFactory); | |
158 }; | |
159 | |
138 class MockUserAuthenticator : public UserAuthenticator { | 160 class MockUserAuthenticator : public UserAuthenticator { |
139 public: | 161 public: |
140 MockUserAuthenticator(); | 162 MockUserAuthenticator(); |
141 virtual ~MockUserAuthenticator(); | 163 virtual ~MockUserAuthenticator(); |
142 | 164 |
143 MOCK_METHOD2(Authenticate, bool(const std::string& username, | 165 MOCK_METHOD2(Authenticate, bool(const std::string& username, |
144 const std::string& password)); | 166 const std::string& password)); |
145 | 167 |
146 private: | 168 private: |
147 DISALLOW_COPY_AND_ASSIGN(MockUserAuthenticator); | 169 DISALLOW_COPY_AND_ASSIGN(MockUserAuthenticator); |
148 }; | 170 }; |
149 | 171 |
150 } // namespace remoting | 172 } // namespace remoting |
151 | 173 |
152 #endif // REMOTING_HOST_HOST_MOCK_OBJECTS_H_ | 174 #endif // REMOTING_HOST_HOST_MOCK_OBJECTS_H_ |
OLD | NEW |