| 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/chromoting_host_context.h" | 9 #include "remoting/host/chromoting_host_context.h" |
| 10 #include "remoting/host/client_session.h" | 10 #include "remoting/host/client_session.h" |
| 11 #include "remoting/host/continue_window.h" | 11 #include "remoting/host/continue_window.h" |
| 12 #include "remoting/host/desktop_environment.h" | 12 #include "remoting/host/desktop_environment.h" |
| 13 #include "remoting/host/desktop_environment_factory.h" | 13 #include "remoting/host/desktop_environment_factory.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/host_status_observer.h" | 16 #include "remoting/host/host_status_observer.h" |
| 17 #include "remoting/host/local_input_monitor.h" | 17 #include "remoting/host/local_input_monitor.h" |
| 18 #include "remoting/host/ui_strings.h" | 18 #include "remoting/host/ui_strings.h" |
| 19 #include "remoting/proto/control.pb.h" | 19 #include "remoting/proto/control.pb.h" |
| 20 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
| 21 | 21 |
| 22 namespace remoting { | 22 namespace remoting { |
| 23 | 23 |
| 24 class MockDesktopEnvironment : public DesktopEnvironment { |
| 25 public: |
| 26 MockDesktopEnvironment(); |
| 27 virtual ~MockDesktopEnvironment(); |
| 28 |
| 29 // protocol::ClipboardStub implementation. |
| 30 MOCK_METHOD1(InjectClipboardEvent, void(const protocol::ClipboardEvent&)); |
| 31 |
| 32 // protocol::InputStub implementation. |
| 33 MOCK_METHOD1(InjectKeyEvent, void(const protocol::KeyEvent&)); |
| 34 MOCK_METHOD1(InjectMouseEvent, void(const protocol::MouseEvent&)); |
| 35 |
| 36 // DesktopEnvironment implementation. |
| 37 MOCK_METHOD3(StartAudioPtr, void( |
| 38 scoped_refptr<base::SingleThreadTaskRunner>, |
| 39 AudioEncoder*, |
| 40 protocol::AudioStub*)); |
| 41 MOCK_METHOD1(PauseAudio, void(bool)); |
| 42 MOCK_METHOD3(StartInput, void( |
| 43 scoped_refptr<base::SingleThreadTaskRunner>, |
| 44 scoped_refptr<base::SingleThreadTaskRunner>, |
| 45 protocol::ClipboardStub*)); |
| 46 MOCK_METHOD5(StartVideoPtr, void( |
| 47 scoped_refptr<base::SingleThreadTaskRunner>, |
| 48 scoped_refptr<base::SingleThreadTaskRunner>, |
| 49 VideoEncoder*, |
| 50 protocol::CursorShapeStub*, |
| 51 protocol::VideoStub*)); |
| 52 MOCK_CONST_METHOD0(GetScreenSize, SkISize()); |
| 53 MOCK_METHOD1(PauseVideo, void(bool)); |
| 54 MOCK_METHOD1(UpdateSequenceNumber, void(int64)); |
| 55 |
| 56 virtual void StartAudio( |
| 57 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, |
| 58 scoped_ptr<AudioEncoder> audio_encoder, |
| 59 protocol::AudioStub* audio_stub) OVERRIDE; |
| 60 virtual void StartVideo( |
| 61 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, |
| 62 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner, |
| 63 scoped_ptr<VideoEncoder> video_encoder, |
| 64 protocol::CursorShapeStub* cursor_shape_stub, |
| 65 protocol::VideoStub* video_stub) OVERRIDE; |
| 66 }; |
| 67 |
| 24 class MockDisconnectWindow : public DisconnectWindow { | 68 class MockDisconnectWindow : public DisconnectWindow { |
| 25 public: | 69 public: |
| 26 MockDisconnectWindow(); | 70 MockDisconnectWindow(); |
| 27 virtual ~MockDisconnectWindow(); | 71 virtual ~MockDisconnectWindow(); |
| 28 | 72 |
| 29 MOCK_METHOD3(Show, bool(const UiStrings& ui_strings, | 73 MOCK_METHOD3(Show, bool(const UiStrings& ui_strings, |
| 30 const base::Closure& disconnect_callback, | 74 const base::Closure& disconnect_callback, |
| 31 const std::string& username)); | 75 const std::string& username)); |
| 32 MOCK_METHOD0(Hide, void()); | 76 MOCK_METHOD0(Hide, void()); |
| 33 }; | 77 }; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 const protocol::TransportRoute& route)); | 114 const protocol::TransportRoute& route)); |
| 71 MOCK_METHOD2(OnClientDimensionsChanged, void(ClientSession* client, | 115 MOCK_METHOD2(OnClientDimensionsChanged, void(ClientSession* client, |
| 72 const SkISize& size)); | 116 const SkISize& size)); |
| 73 | 117 |
| 74 private: | 118 private: |
| 75 DISALLOW_COPY_AND_ASSIGN(MockClientSessionEventHandler); | 119 DISALLOW_COPY_AND_ASSIGN(MockClientSessionEventHandler); |
| 76 }; | 120 }; |
| 77 | 121 |
| 78 class MockDesktopEnvironmentFactory : public DesktopEnvironmentFactory { | 122 class MockDesktopEnvironmentFactory : public DesktopEnvironmentFactory { |
| 79 public: | 123 public: |
| 80 MockDesktopEnvironmentFactory(); | 124 explicit MockDesktopEnvironmentFactory( |
| 125 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner); |
| 81 virtual ~MockDesktopEnvironmentFactory(); | 126 virtual ~MockDesktopEnvironmentFactory(); |
| 82 | 127 |
| 83 MOCK_METHOD0(CreatePtr, DesktopEnvironment*()); | 128 MOCK_METHOD0(CreatePtr, DesktopEnvironment*()); |
| 84 | 129 |
| 85 virtual scoped_ptr<DesktopEnvironment> Create() OVERRIDE; | 130 virtual scoped_ptr<DesktopEnvironment> Create( |
| 131 const std::string& client_jid, |
| 132 const base::Closure& disconnect_callback) OVERRIDE; |
| 86 | 133 |
| 87 private: | 134 private: |
| 88 DISALLOW_COPY_AND_ASSIGN(MockDesktopEnvironmentFactory); | 135 DISALLOW_COPY_AND_ASSIGN(MockDesktopEnvironmentFactory); |
| 89 }; | 136 }; |
| 90 | 137 |
| 91 class MockEventExecutor : public EventExecutor { | 138 class MockEventExecutor : public EventExecutor { |
| 92 public: | 139 public: |
| 93 MockEventExecutor(); | 140 MockEventExecutor(); |
| 94 virtual ~MockEventExecutor(); | 141 virtual ~MockEventExecutor(); |
| 95 | 142 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 119 void(const std::string& jid, | 166 void(const std::string& jid, |
| 120 const std::string& channel_name, | 167 const std::string& channel_name, |
| 121 const protocol::TransportRoute& route)); | 168 const protocol::TransportRoute& route)); |
| 122 MOCK_METHOD1(OnStart, void(const std::string& xmpp_login)); | 169 MOCK_METHOD1(OnStart, void(const std::string& xmpp_login)); |
| 123 MOCK_METHOD0(OnShutdown, void()); | 170 MOCK_METHOD0(OnShutdown, void()); |
| 124 }; | 171 }; |
| 125 | 172 |
| 126 } // namespace remoting | 173 } // namespace remoting |
| 127 | 174 |
| 128 #endif // REMOTING_HOST_HOST_MOCK_OBJECTS_H_ | 175 #endif // REMOTING_HOST_HOST_MOCK_OBJECTS_H_ |
| OLD | NEW |