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/network_settings.h" |
| 18 #include "remoting/host/session_manager_factory.h" |
17 #include "remoting/host/user_authenticator.h" | 19 #include "remoting/host/user_authenticator.h" |
18 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
19 | 21 |
20 namespace remoting { | 22 namespace remoting { |
21 | 23 |
22 class MockCapturer : public Capturer { | 24 class MockCapturer : public Capturer { |
23 public: | 25 public: |
24 MockCapturer(); | 26 MockCapturer(); |
25 virtual ~MockCapturer(); | 27 virtual ~MockCapturer(); |
26 | 28 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 MOCK_METHOD1(InjectKeyEvent, void(const protocol::KeyEvent& event)); | 130 MOCK_METHOD1(InjectKeyEvent, void(const protocol::KeyEvent& event)); |
129 MOCK_METHOD1(InjectMouseEvent, void(const protocol::MouseEvent& event)); | 131 MOCK_METHOD1(InjectMouseEvent, void(const protocol::MouseEvent& event)); |
130 MOCK_METHOD0(OnSessionFinished, void()); | 132 MOCK_METHOD0(OnSessionFinished, void()); |
131 | 133 |
132 void OnSessionStarted(scoped_ptr<protocol::ClipboardStub> client_clipboard); | 134 void OnSessionStarted(scoped_ptr<protocol::ClipboardStub> client_clipboard); |
133 | 135 |
134 private: | 136 private: |
135 DISALLOW_COPY_AND_ASSIGN(MockEventExecutor); | 137 DISALLOW_COPY_AND_ASSIGN(MockEventExecutor); |
136 }; | 138 }; |
137 | 139 |
| 140 class MockSessionManagerFactory : public SessionManagerFactory { |
| 141 public: |
| 142 MockSessionManagerFactory(); |
| 143 virtual ~MockSessionManagerFactory(); |
| 144 |
| 145 MOCK_METHOD2(CreateSessionManagerPtr, protocol::SessionManager*( |
| 146 const NetworkSettings& network_settings, |
| 147 const scoped_refptr<net::URLRequestContextGetter>& |
| 148 url_request_context_getter)); |
| 149 scoped_ptr<protocol::SessionManager> CreateSessionManager( |
| 150 const NetworkSettings& network_settings, |
| 151 const scoped_refptr<net::URLRequestContextGetter>& |
| 152 url_request_context_getter) { |
| 153 return scoped_ptr<protocol::SessionManager>(CreateSessionManagerPtr( |
| 154 network_settings, url_request_context_getter)); |
| 155 } |
| 156 |
| 157 private: |
| 158 DISALLOW_COPY_AND_ASSIGN(MockSessionManagerFactory); |
| 159 }; |
| 160 |
138 class MockUserAuthenticator : public UserAuthenticator { | 161 class MockUserAuthenticator : public UserAuthenticator { |
139 public: | 162 public: |
140 MockUserAuthenticator(); | 163 MockUserAuthenticator(); |
141 virtual ~MockUserAuthenticator(); | 164 virtual ~MockUserAuthenticator(); |
142 | 165 |
143 MOCK_METHOD2(Authenticate, bool(const std::string& username, | 166 MOCK_METHOD2(Authenticate, bool(const std::string& username, |
144 const std::string& password)); | 167 const std::string& password)); |
145 | 168 |
146 private: | 169 private: |
147 DISALLOW_COPY_AND_ASSIGN(MockUserAuthenticator); | 170 DISALLOW_COPY_AND_ASSIGN(MockUserAuthenticator); |
148 }; | 171 }; |
149 | 172 |
150 } // namespace remoting | 173 } // namespace remoting |
151 | 174 |
152 #endif // REMOTING_HOST_HOST_MOCK_OBJECTS_H_ | 175 #endif // REMOTING_HOST_HOST_MOCK_OBJECTS_H_ |
OLD | NEW |