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 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "remoting/base/auto_thread_task_runner.h" | 8 #include "remoting/base/auto_thread_task_runner.h" |
9 #include "remoting/host/audio_capturer.h" | 9 #include "remoting/host/audio_capturer.h" |
10 #include "remoting/host/chromoting_host.h" | 10 #include "remoting/host/chromoting_host.h" |
11 #include "remoting/host/chromoting_host_context.h" | 11 #include "remoting/host/chromoting_host_context.h" |
12 #include "remoting/host/desktop_environment.h" | 12 #include "remoting/host/desktop_environment.h" |
13 #include "remoting/host/fake_desktop_capturer.h" | |
14 #include "remoting/host/fake_mouse_cursor_monitor.h" | 13 #include "remoting/host/fake_mouse_cursor_monitor.h" |
15 #include "remoting/host/host_mock_objects.h" | 14 #include "remoting/host/host_mock_objects.h" |
16 #include "remoting/proto/video.pb.h" | 15 #include "remoting/proto/video.pb.h" |
17 #include "remoting/protocol/errors.h" | 16 #include "remoting/protocol/errors.h" |
| 17 #include "remoting/protocol/fake_desktop_capturer.h" |
18 #include "remoting/protocol/protocol_mock_objects.h" | 18 #include "remoting/protocol/protocol_mock_objects.h" |
19 #include "remoting/protocol/session_config.h" | 19 #include "remoting/protocol/session_config.h" |
20 #include "remoting/signaling/mock_signal_strategy.h" | 20 #include "remoting/signaling/mock_signal_strategy.h" |
21 #include "testing/gmock/include/gmock/gmock.h" | 21 #include "testing/gmock/include/gmock/gmock.h" |
22 #include "testing/gmock_mutant.h" | 22 #include "testing/gmock_mutant.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
24 | 24 |
25 using ::remoting::protocol::MockClientStub; | 25 using ::remoting::protocol::MockClientStub; |
26 using ::remoting::protocol::MockConnectionToClient; | 26 using ::remoting::protocol::MockConnectionToClient; |
27 using ::remoting::protocol::MockConnectionToClientEventHandler; | 27 using ::remoting::protocol::MockConnectionToClientEventHandler; |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 // DesktopEnvironment::CreateInputInjector(). | 245 // DesktopEnvironment::CreateInputInjector(). |
246 InputInjector* CreateInputInjector() { | 246 InputInjector* CreateInputInjector() { |
247 MockInputInjector* input_injector = new MockInputInjector(); | 247 MockInputInjector* input_injector = new MockInputInjector(); |
248 EXPECT_CALL(*input_injector, StartPtr(_)); | 248 EXPECT_CALL(*input_injector, StartPtr(_)); |
249 return input_injector; | 249 return input_injector; |
250 } | 250 } |
251 | 251 |
252 // Creates a fake webrtc::DesktopCapturer, to mock | 252 // Creates a fake webrtc::DesktopCapturer, to mock |
253 // DesktopEnvironment::CreateVideoCapturer(). | 253 // DesktopEnvironment::CreateVideoCapturer(). |
254 webrtc::DesktopCapturer* CreateVideoCapturer() { | 254 webrtc::DesktopCapturer* CreateVideoCapturer() { |
255 return new FakeDesktopCapturer(); | 255 return new protocol::FakeDesktopCapturer(); |
256 } | 256 } |
257 | 257 |
258 // Creates a MockMouseCursorMonitor, to mock | 258 // Creates a MockMouseCursorMonitor, to mock |
259 // DesktopEnvironment::CreateMouseCursorMonitor(). | 259 // DesktopEnvironment::CreateMouseCursorMonitor(). |
260 webrtc::MouseCursorMonitor* CreateMouseCursorMonitor() { | 260 webrtc::MouseCursorMonitor* CreateMouseCursorMonitor() { |
261 return new FakeMouseCursorMonitor(); | 261 return new FakeMouseCursorMonitor(); |
262 } | 262 } |
263 | 263 |
264 void DisconnectAllClients() { | 264 void DisconnectAllClients() { |
265 host_->DisconnectAllClients(); | 265 host_->DisconnectAllClients(); |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 ExpectClientDisconnected(0, true, video_packet_sent, | 658 ExpectClientDisconnected(0, true, video_packet_sent, |
659 InvokeWithoutArgs(this, &ChromotingHostTest::ShutdownHost)); | 659 InvokeWithoutArgs(this, &ChromotingHostTest::ShutdownHost)); |
660 EXPECT_CALL(host_status_observer_, OnShutdown()); | 660 EXPECT_CALL(host_status_observer_, OnShutdown()); |
661 | 661 |
662 host_->Start(xmpp_login_); | 662 host_->Start(xmpp_login_); |
663 SimulateClientConnection(0, true, false); | 663 SimulateClientConnection(0, true, false); |
664 message_loop_.Run(); | 664 message_loop_.Run(); |
665 } | 665 } |
666 | 666 |
667 } // namespace remoting | 667 } // namespace remoting |
OLD | NEW |