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 "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
9 #include "remoting/base/auto_thread_task_runner.h" | 9 #include "remoting/base/auto_thread_task_runner.h" |
10 #include "remoting/host/audio_capturer.h" | 10 #include "remoting/host/audio_capturer.h" |
11 #include "remoting/host/chromoting_host.h" | 11 #include "remoting/host/chromoting_host.h" |
12 #include "remoting/host/chromoting_host_context.h" | 12 #include "remoting/host/chromoting_host_context.h" |
13 #include "remoting/host/desktop_environment.h" | 13 #include "remoting/host/desktop_environment.h" |
| 14 #include "remoting/host/fake_screen_capturer.h" |
14 #include "remoting/host/host_mock_objects.h" | 15 #include "remoting/host/host_mock_objects.h" |
15 #include "remoting/host/screen_capturer_fake.h" | |
16 #include "remoting/proto/video.pb.h" | 16 #include "remoting/proto/video.pb.h" |
17 #include "remoting/protocol/errors.h" | 17 #include "remoting/protocol/errors.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; |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 // DesktopEnvironment::CreateInputInjector(). | 260 // DesktopEnvironment::CreateInputInjector(). |
261 InputInjector* CreateInputInjector() { | 261 InputInjector* CreateInputInjector() { |
262 MockInputInjector* input_injector = new MockInputInjector(); | 262 MockInputInjector* input_injector = new MockInputInjector(); |
263 EXPECT_CALL(*input_injector, StartPtr(_)); | 263 EXPECT_CALL(*input_injector, StartPtr(_)); |
264 return input_injector; | 264 return input_injector; |
265 } | 265 } |
266 | 266 |
267 // Creates a fake webrtc::ScreenCapturer, to mock | 267 // Creates a fake webrtc::ScreenCapturer, to mock |
268 // DesktopEnvironment::CreateVideoCapturer(). | 268 // DesktopEnvironment::CreateVideoCapturer(). |
269 webrtc::ScreenCapturer* CreateVideoCapturer() { | 269 webrtc::ScreenCapturer* CreateVideoCapturer() { |
270 return new ScreenCapturerFake(); | 270 return new FakeScreenCapturer(); |
271 } | 271 } |
272 | 272 |
273 void DisconnectAllClients() { | 273 void DisconnectAllClients() { |
274 host_->DisconnectAllClients(); | 274 host_->DisconnectAllClients(); |
275 } | 275 } |
276 | 276 |
277 // Helper method to disconnect client 1 from the host. | 277 // Helper method to disconnect client 1 from the host. |
278 void DisconnectClient1() { | 278 void DisconnectClient1() { |
279 NotifyClientSessionClosed(0); | 279 NotifyClientSessionClosed(0); |
280 } | 280 } |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 ExpectClientDisconnected(0, true, video_packet_sent, | 700 ExpectClientDisconnected(0, true, video_packet_sent, |
701 InvokeWithoutArgs(this, &ChromotingHostTest::ShutdownHost)); | 701 InvokeWithoutArgs(this, &ChromotingHostTest::ShutdownHost)); |
702 EXPECT_CALL(host_status_observer_, OnShutdown()); | 702 EXPECT_CALL(host_status_observer_, OnShutdown()); |
703 | 703 |
704 host_->Start(xmpp_login_); | 704 host_->Start(xmpp_login_); |
705 SimulateClientConnection(0, true, false); | 705 SimulateClientConnection(0, true, false); |
706 message_loop_.Run(); | 706 message_loop_.Run(); |
707 } | 707 } |
708 | 708 |
709 } // namespace remoting | 709 } // namespace remoting |
OLD | NEW |