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/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "media/video/capture/screen/screen_capturer_fake.h" | 6 #include "media/video/capture/screen/screen_capturer_fake.h" |
7 #include "media/video/capture/screen/screen_capturer_mock_objects.h" | 7 #include "media/video/capture/screen/screen_capturer_mock_objects.h" |
8 #include "remoting/base/auto_thread_task_runner.h" | 8 #include "remoting/base/auto_thread_task_runner.h" |
9 #include "remoting/base/constants.h" | 9 #include "remoting/base/constants.h" |
10 #include "remoting/host/audio_capturer.h" | 10 #include "remoting/host/audio_capturer.h" |
11 #include "remoting/host/client_session.h" | 11 #include "remoting/host/client_session.h" |
12 #include "remoting/host/desktop_environment.h" | 12 #include "remoting/host/desktop_environment.h" |
13 #include "remoting/host/host_mock_objects.h" | 13 #include "remoting/host/host_mock_objects.h" |
14 #include "remoting/protocol/protocol_mock_objects.h" | 14 #include "remoting/protocol/protocol_mock_objects.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 namespace remoting { | 17 namespace remoting { |
18 | 18 |
19 using protocol::MockConnectionToClient; | 19 using protocol::MockConnectionToClient; |
20 using protocol::MockClientStub; | 20 using protocol::MockClientStub; |
21 using protocol::MockHostStub; | 21 using protocol::MockHostStub; |
22 using protocol::MockInputStub; | 22 using protocol::MockInputStub; |
23 using protocol::MockSession; | 23 using protocol::MockSession; |
24 using protocol::MockVideoStub; | 24 using protocol::MockVideoStub; |
25 using protocol::SessionConfig; | 25 using protocol::SessionConfig; |
26 | 26 |
27 using testing::_; | 27 using testing::_; |
28 using testing::AnyNumber; | 28 using testing::AnyNumber; |
| 29 using testing::AtMost; |
29 using testing::DeleteArg; | 30 using testing::DeleteArg; |
30 using testing::DoAll; | 31 using testing::DoAll; |
31 using testing::Expectation; | 32 using testing::Expectation; |
32 using testing::Return; | 33 using testing::Return; |
33 using testing::ReturnRef; | 34 using testing::ReturnRef; |
34 using testing::Sequence; | 35 using testing::Sequence; |
35 | 36 |
36 namespace { | 37 namespace { |
37 | 38 |
38 ACTION_P2(InjectClipboardEvent, connection, event) { | 39 ACTION_P2(InjectClipboardEvent, connection, event) { |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 desktop_environment_factory_.reset(); | 184 desktop_environment_factory_.reset(); |
184 } | 185 } |
185 | 186 |
186 DesktopEnvironment* ClientSessionTest::CreateDesktopEnvironment() { | 187 DesktopEnvironment* ClientSessionTest::CreateDesktopEnvironment() { |
187 MockDesktopEnvironment* desktop_environment = new MockDesktopEnvironment(); | 188 MockDesktopEnvironment* desktop_environment = new MockDesktopEnvironment(); |
188 EXPECT_CALL(*desktop_environment, CreateAudioCapturerPtr()) | 189 EXPECT_CALL(*desktop_environment, CreateAudioCapturerPtr()) |
189 .Times(0); | 190 .Times(0); |
190 EXPECT_CALL(*desktop_environment, CreateInputInjectorPtr()) | 191 EXPECT_CALL(*desktop_environment, CreateInputInjectorPtr()) |
191 .WillOnce(Invoke(this, &ClientSessionTest::CreateInputInjector)); | 192 .WillOnce(Invoke(this, &ClientSessionTest::CreateInputInjector)); |
192 EXPECT_CALL(*desktop_environment, CreateScreenControlsPtr()) | 193 EXPECT_CALL(*desktop_environment, CreateScreenControlsPtr()) |
193 .Times(1); | 194 .Times(AtMost(1)); |
194 EXPECT_CALL(*desktop_environment, CreateVideoCapturerPtr()) | 195 EXPECT_CALL(*desktop_environment, CreateVideoCapturerPtr()) |
195 .WillOnce(Invoke(this, &ClientSessionTest::CreateVideoCapturer)); | 196 .WillOnce(Invoke(this, &ClientSessionTest::CreateVideoCapturer)); |
| 197 EXPECT_CALL(*desktop_environment, GetCapabilities()) |
| 198 .Times(AtMost(1)); |
| 199 EXPECT_CALL(*desktop_environment, SetCapabilities(_)) |
| 200 .Times(AtMost(1)); |
196 | 201 |
197 return desktop_environment; | 202 return desktop_environment; |
198 } | 203 } |
199 | 204 |
200 InputInjector* ClientSessionTest::CreateInputInjector() { | 205 InputInjector* ClientSessionTest::CreateInputInjector() { |
201 EXPECT_TRUE(input_injector_); | 206 EXPECT_TRUE(input_injector_); |
202 return input_injector_.release(); | 207 return input_injector_.release(); |
203 } | 208 } |
204 | 209 |
205 media::ScreenCapturer* ClientSessionTest::CreateVideoCapturer() { | 210 media::ScreenCapturer* ClientSessionTest::CreateVideoCapturer() { |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 .After(connected) | 520 .After(connected) |
516 .WillOnce(DoAll( | 521 .WillOnce(DoAll( |
517 InvokeWithoutArgs(this, &ClientSessionTest::DisconnectClientSession), | 522 InvokeWithoutArgs(this, &ClientSessionTest::DisconnectClientSession), |
518 InvokeWithoutArgs(this, &ClientSessionTest::StopClientSession))); | 523 InvokeWithoutArgs(this, &ClientSessionTest::StopClientSession))); |
519 | 524 |
520 ConnectClientSession(); | 525 ConnectClientSession(); |
521 message_loop_.Run(); | 526 message_loop_.Run(); |
522 } | 527 } |
523 | 528 |
524 } // namespace remoting | 529 } // namespace remoting |
OLD | NEW |