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/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "remoting/base/auto_thread_task_runner.h" | 6 #include "remoting/base/auto_thread_task_runner.h" |
7 #include "remoting/base/constants.h" | 7 #include "remoting/base/constants.h" |
8 #include "remoting/host/audio_capturer.h" | 8 #include "remoting/host/audio_capturer.h" |
9 #include "remoting/host/client_session.h" | 9 #include "remoting/host/client_session.h" |
10 #include "remoting/host/desktop_environment.h" | 10 #include "remoting/host/desktop_environment.h" |
11 #include "remoting/host/host_mock_objects.h" | 11 #include "remoting/host/host_mock_objects.h" |
12 #include "remoting/host/screen_capturer_fake.h" | 12 #include "remoting/host/screen_capturer_fake.h" |
13 #include "remoting/protocol/protocol_mock_objects.h" | 13 #include "remoting/protocol/protocol_mock_objects.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
15 #include "third_party/webrtc/modules/desktop_capture/desktop_region.h" | 16 #include "third_party/webrtc/modules/desktop_capture/desktop_region.h" |
16 #include "third_party/webrtc/modules/desktop_capture/screen_capturer_mock_object
s.h" | 17 #include "third_party/webrtc/modules/desktop_capture/screen_capturer_mock_object
s.h" |
17 | 18 |
18 namespace remoting { | 19 namespace remoting { |
19 | 20 |
20 using protocol::MockConnectionToClient; | 21 using protocol::MockConnectionToClient; |
21 using protocol::MockClientStub; | 22 using protocol::MockClientStub; |
22 using protocol::MockHostStub; | 23 using protocol::MockHostStub; |
23 using protocol::MockInputStub; | 24 using protocol::MockInputStub; |
24 using protocol::MockSession; | 25 using protocol::MockSession; |
(...skipping 18 matching lines...) Expand all Loading... |
43 | 44 |
44 ACTION_P2(InjectKeyEvent, connection, event) { | 45 ACTION_P2(InjectKeyEvent, connection, event) { |
45 connection->input_stub()->InjectKeyEvent(event); | 46 connection->input_stub()->InjectKeyEvent(event); |
46 } | 47 } |
47 | 48 |
48 ACTION_P2(InjectMouseEvent, connection, event) { | 49 ACTION_P2(InjectMouseEvent, connection, event) { |
49 connection->input_stub()->InjectMouseEvent(event); | 50 connection->input_stub()->InjectMouseEvent(event); |
50 } | 51 } |
51 | 52 |
52 ACTION_P2(LocalMouseMoved, client_session, event) { | 53 ACTION_P2(LocalMouseMoved, client_session, event) { |
53 client_session->OnLocalMouseMoved(SkIPoint::Make(event.x(), event.y())); | 54 client_session->OnLocalMouseMoved( |
| 55 webrtc::DesktopVector(event.x(), event.y())); |
54 } | 56 } |
55 | 57 |
56 } // namespace | 58 } // namespace |
57 | 59 |
58 class ClientSessionTest : public testing::Test { | 60 class ClientSessionTest : public testing::Test { |
59 public: | 61 public: |
60 ClientSessionTest() : client_jid_("user@domain/rest-of-jid") {} | 62 ClientSessionTest() : client_jid_("user@domain/rest-of-jid") {} |
61 | 63 |
62 virtual void SetUp() OVERRIDE; | 64 virtual void SetUp() OVERRIDE; |
63 virtual void TearDown() OVERRIDE; | 65 virtual void TearDown() OVERRIDE; |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 .After(connected) | 533 .After(connected) |
532 .WillOnce(DoAll( | 534 .WillOnce(DoAll( |
533 InvokeWithoutArgs(this, &ClientSessionTest::DisconnectClientSession), | 535 InvokeWithoutArgs(this, &ClientSessionTest::DisconnectClientSession), |
534 InvokeWithoutArgs(this, &ClientSessionTest::StopClientSession))); | 536 InvokeWithoutArgs(this, &ClientSessionTest::StopClientSession))); |
535 | 537 |
536 ConnectClientSession(); | 538 ConnectClientSession(); |
537 message_loop_.Run(); | 539 message_loop_.Run(); |
538 } | 540 } |
539 | 541 |
540 } // namespace remoting | 542 } // namespace remoting |
OLD | NEW |