| 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" | |
| 14 #include "remoting/host/disconnect_window.h" | 13 #include "remoting/host/disconnect_window.h" |
| 15 #include "remoting/host/event_executor.h" | 14 #include "remoting/host/event_executor.h" |
| 16 #include "remoting/host/host_status_observer.h" | 15 #include "remoting/host/host_status_observer.h" |
| 17 #include "remoting/host/local_input_monitor.h" | 16 #include "remoting/host/local_input_monitor.h" |
| 18 #include "remoting/host/ui_strings.h" | 17 #include "remoting/host/ui_strings.h" |
| 19 #include "remoting/proto/control.pb.h" | 18 #include "remoting/proto/control.pb.h" |
| 20 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
| 21 | 20 |
| 21 namespace base { |
| 22 class SingleThreadTaskRunner; |
| 23 } // namespace base |
| 24 |
| 22 namespace remoting { | 25 namespace remoting { |
| 23 | 26 |
| 27 class MockDesktopEnvironment : public DesktopEnvironment { |
| 28 public: |
| 29 MockDesktopEnvironment(); |
| 30 virtual ~MockDesktopEnvironment(); |
| 31 |
| 32 MOCK_METHOD1(CreateAudioCapturerPtr, |
| 33 AudioCapturer*(scoped_refptr<base::SingleThreadTaskRunner>)); |
| 34 MOCK_METHOD2(CreateEventExecutorPtr, |
| 35 EventExecutor*(scoped_refptr<base::SingleThreadTaskRunner>, |
| 36 scoped_refptr<base::SingleThreadTaskRunner>)); |
| 37 MOCK_METHOD2( |
| 38 CreateVideoCapturerPtr, |
| 39 VideoFrameCapturer*(scoped_refptr<base::SingleThreadTaskRunner>, |
| 40 scoped_refptr<base::SingleThreadTaskRunner>)); |
| 41 |
| 42 // DesktopEnvironment implementation. |
| 43 virtual scoped_ptr<AudioCapturer> CreateAudioCapturer( |
| 44 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner) OVERRIDE; |
| 45 virtual scoped_ptr<EventExecutor> CreateEventExecutor( |
| 46 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
| 47 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) OVERRIDE; |
| 48 virtual scoped_ptr<VideoFrameCapturer> CreateVideoCapturer( |
| 49 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, |
| 50 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner) OVERRIDE; |
| 51 }; |
| 52 |
| 24 class MockDisconnectWindow : public DisconnectWindow { | 53 class MockDisconnectWindow : public DisconnectWindow { |
| 25 public: | 54 public: |
| 26 MockDisconnectWindow(); | 55 MockDisconnectWindow(); |
| 27 virtual ~MockDisconnectWindow(); | 56 virtual ~MockDisconnectWindow(); |
| 28 | 57 |
| 29 MOCK_METHOD3(Show, bool(const UiStrings& ui_strings, | 58 MOCK_METHOD3(Show, bool(const UiStrings& ui_strings, |
| 30 const base::Closure& disconnect_callback, | 59 const base::Closure& disconnect_callback, |
| 31 const std::string& username)); | 60 const std::string& username)); |
| 32 MOCK_METHOD0(Hide, void()); | 61 MOCK_METHOD0(Hide, void()); |
| 33 }; | 62 }; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 private: | 103 private: |
| 75 DISALLOW_COPY_AND_ASSIGN(MockClientSessionEventHandler); | 104 DISALLOW_COPY_AND_ASSIGN(MockClientSessionEventHandler); |
| 76 }; | 105 }; |
| 77 | 106 |
| 78 class MockDesktopEnvironmentFactory : public DesktopEnvironmentFactory { | 107 class MockDesktopEnvironmentFactory : public DesktopEnvironmentFactory { |
| 79 public: | 108 public: |
| 80 MockDesktopEnvironmentFactory(); | 109 MockDesktopEnvironmentFactory(); |
| 81 virtual ~MockDesktopEnvironmentFactory(); | 110 virtual ~MockDesktopEnvironmentFactory(); |
| 82 | 111 |
| 83 MOCK_METHOD0(CreatePtr, DesktopEnvironment*()); | 112 MOCK_METHOD0(CreatePtr, DesktopEnvironment*()); |
| 113 MOCK_CONST_METHOD0(SupportsAudioCapture, bool()); |
| 84 | 114 |
| 85 virtual scoped_ptr<DesktopEnvironment> Create() OVERRIDE; | 115 virtual scoped_ptr<DesktopEnvironment> Create( |
| 116 const std::string& client_jid, |
| 117 const base::Closure& disconnect_callback) OVERRIDE; |
| 86 | 118 |
| 87 private: | 119 private: |
| 88 DISALLOW_COPY_AND_ASSIGN(MockDesktopEnvironmentFactory); | 120 DISALLOW_COPY_AND_ASSIGN(MockDesktopEnvironmentFactory); |
| 89 }; | 121 }; |
| 90 | 122 |
| 91 class MockEventExecutor : public EventExecutor { | 123 class MockEventExecutor : public EventExecutor { |
| 92 public: | 124 public: |
| 93 MockEventExecutor(); | 125 MockEventExecutor(); |
| 94 virtual ~MockEventExecutor(); | 126 virtual ~MockEventExecutor(); |
| 95 | 127 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 119 void(const std::string& jid, | 151 void(const std::string& jid, |
| 120 const std::string& channel_name, | 152 const std::string& channel_name, |
| 121 const protocol::TransportRoute& route)); | 153 const protocol::TransportRoute& route)); |
| 122 MOCK_METHOD1(OnStart, void(const std::string& xmpp_login)); | 154 MOCK_METHOD1(OnStart, void(const std::string& xmpp_login)); |
| 123 MOCK_METHOD0(OnShutdown, void()); | 155 MOCK_METHOD0(OnShutdown, void()); |
| 124 }; | 156 }; |
| 125 | 157 |
| 126 } // namespace remoting | 158 } // namespace remoting |
| 127 | 159 |
| 128 #endif // REMOTING_HOST_HOST_MOCK_OBJECTS_H_ | 160 #endif // REMOTING_HOST_HOST_MOCK_OBJECTS_H_ |
| OLD | NEW |