| 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/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/message_loop_proxy.h" | 7 #include "base/message_loop_proxy.h" |
| 8 #include "remoting/jingle_glue/mock_objects.h" | 8 #include "remoting/jingle_glue/mock_objects.h" |
| 9 #include "remoting/host/audio_capturer.h" | 9 #include "remoting/host/audio_capturer.h" |
| 10 #include "remoting/host/capturer_fake.h" | 10 #include "remoting/host/chromoting_host_context.h" |
| 11 #include "remoting/host/chromoting_host.h" | 11 #include "remoting/host/chromoting_host.h" |
| 12 #include "remoting/host/chromoting_host_context.h" | |
| 13 #include "remoting/host/host_mock_objects.h" | 12 #include "remoting/host/host_mock_objects.h" |
| 14 #include "remoting/host/it2me_host_user_interface.h" | 13 #include "remoting/host/it2me_host_user_interface.h" |
| 14 #include "remoting/host/video_frame_capturer_fake.h" |
| 15 #include "remoting/proto/video.pb.h" | 15 #include "remoting/proto/video.pb.h" |
| 16 #include "remoting/protocol/errors.h" | 16 #include "remoting/protocol/errors.h" |
| 17 #include "remoting/protocol/protocol_mock_objects.h" | 17 #include "remoting/protocol/protocol_mock_objects.h" |
| 18 #include "remoting/protocol/session_config.h" | 18 #include "remoting/protocol/session_config.h" |
| 19 #include "testing/gmock_mutant.h" | 19 #include "testing/gmock_mutant.h" |
| 20 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 22 | 22 |
| 23 using ::remoting::protocol::MockClientStub; | 23 using ::remoting::protocol::MockClientStub; |
| 24 using ::remoting::protocol::MockConnectionToClient; | 24 using ::remoting::protocol::MockConnectionToClient; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 EXPECT_CALL(context_, capture_task_runner()) | 76 EXPECT_CALL(context_, capture_task_runner()) |
| 77 .Times(AnyNumber()) | 77 .Times(AnyNumber()) |
| 78 .WillRepeatedly(Return(message_loop_proxy_.get())); | 78 .WillRepeatedly(Return(message_loop_proxy_.get())); |
| 79 EXPECT_CALL(context_, encode_task_runner()) | 79 EXPECT_CALL(context_, encode_task_runner()) |
| 80 .Times(AnyNumber()) | 80 .Times(AnyNumber()) |
| 81 .WillRepeatedly(Return(message_loop_proxy_.get())); | 81 .WillRepeatedly(Return(message_loop_proxy_.get())); |
| 82 EXPECT_CALL(context_, network_task_runner()) | 82 EXPECT_CALL(context_, network_task_runner()) |
| 83 .Times(AnyNumber()) | 83 .Times(AnyNumber()) |
| 84 .WillRepeatedly(Return(message_loop_proxy_.get())); | 84 .WillRepeatedly(Return(message_loop_proxy_.get())); |
| 85 | 85 |
| 86 scoped_ptr<Capturer> capturer(new CapturerFake()); | 86 scoped_ptr<VideoFrameCapturer> capturer(new VideoFrameCapturerFake()); |
| 87 scoped_ptr<AudioCapturer> audio_capturer(NULL); | 87 scoped_ptr<AudioCapturer> audio_capturer(NULL); |
| 88 event_executor_ = new MockEventExecutor(); | 88 event_executor_ = new MockEventExecutor(); |
| 89 desktop_environment_ = DesktopEnvironment::CreateFake( | 89 desktop_environment_ = DesktopEnvironment::CreateFake( |
| 90 &context_, | 90 &context_, |
| 91 capturer.Pass(), | 91 capturer.Pass(), |
| 92 scoped_ptr<EventExecutor>(event_executor_), | 92 scoped_ptr<EventExecutor>(event_executor_), |
| 93 audio_capturer.Pass()); | 93 audio_capturer.Pass()); |
| 94 session_manager_ = new protocol::MockSessionManager(); | 94 session_manager_ = new protocol::MockSessionManager(); |
| 95 | 95 |
| 96 host_ = new ChromotingHost( | 96 host_ = new ChromotingHost( |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 ExpectClientDisconnected(0, true, video_packet_sent, | 625 ExpectClientDisconnected(0, true, video_packet_sent, |
| 626 InvokeWithoutArgs(this, &ChromotingHostTest::ShutdownHost)); | 626 InvokeWithoutArgs(this, &ChromotingHostTest::ShutdownHost)); |
| 627 EXPECT_CALL(host_status_observer_, OnShutdown()); | 627 EXPECT_CALL(host_status_observer_, OnShutdown()); |
| 628 | 628 |
| 629 host_->Start(); | 629 host_->Start(); |
| 630 SimulateClientConnection(0, true, false); | 630 SimulateClientConnection(0, true, false); |
| 631 message_loop_.Run(); | 631 message_loop_.Run(); |
| 632 } | 632 } |
| 633 | 633 |
| 634 } // namespace remoting | 634 } // namespace remoting |
| OLD | NEW |