| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 using protocol::test::EqualsTouchEvent; | 51 using protocol::test::EqualsTouchEvent; |
| 52 using protocol::test::EqualsTouchEventTypeAndId; | 52 using protocol::test::EqualsTouchEventTypeAndId; |
| 53 | 53 |
| 54 namespace { | 54 namespace { |
| 55 | 55 |
| 56 // Receives messages sent from the network process to the daemon. | 56 // Receives messages sent from the network process to the daemon. |
| 57 class FakeDaemonSender : public IPC::Sender { | 57 class FakeDaemonSender : public IPC::Sender { |
| 58 public: | 58 public: |
| 59 FakeDaemonSender() {} | 59 FakeDaemonSender() {} |
| 60 virtual ~FakeDaemonSender() {} | 60 ~FakeDaemonSender() override {} |
| 61 | 61 |
| 62 // IPC::Sender implementation. | 62 // IPC::Sender implementation. |
| 63 virtual bool Send(IPC::Message* message) override; | 63 bool Send(IPC::Message* message) override; |
| 64 | 64 |
| 65 MOCK_METHOD3(ConnectTerminal, void(int, const ScreenResolution&, bool)); | 65 MOCK_METHOD3(ConnectTerminal, void(int, const ScreenResolution&, bool)); |
| 66 MOCK_METHOD1(DisconnectTerminal, void(int)); | 66 MOCK_METHOD1(DisconnectTerminal, void(int)); |
| 67 MOCK_METHOD2(SetScreenResolution, void(int, const ScreenResolution&)); | 67 MOCK_METHOD2(SetScreenResolution, void(int, const ScreenResolution&)); |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 void OnMessageReceived(const IPC::Message& message); | 70 void OnMessageReceived(const IPC::Message& message); |
| 71 | 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(FakeDaemonSender); | 72 DISALLOW_COPY_AND_ASSIGN(FakeDaemonSender); |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 // Receives messages sent from the desktop process to the daemon. | 75 // Receives messages sent from the desktop process to the daemon. |
| 76 class MockDaemonListener : public IPC::Listener { | 76 class MockDaemonListener : public IPC::Listener { |
| 77 public: | 77 public: |
| 78 MockDaemonListener() {} | 78 MockDaemonListener() {} |
| 79 virtual ~MockDaemonListener() {} | 79 ~MockDaemonListener() override {} |
| 80 | 80 |
| 81 virtual bool OnMessageReceived(const IPC::Message& message) override; | 81 bool OnMessageReceived(const IPC::Message& message) override; |
| 82 | 82 |
| 83 MOCK_METHOD1(OnDesktopAttached, void(IPC::PlatformFileForTransit)); | 83 MOCK_METHOD1(OnDesktopAttached, void(IPC::PlatformFileForTransit)); |
| 84 MOCK_METHOD1(OnChannelConnected, void(int32)); | 84 MOCK_METHOD1(OnChannelConnected, void(int32)); |
| 85 MOCK_METHOD0(OnChannelError, void()); | 85 MOCK_METHOD0(OnChannelError, void()); |
| 86 | 86 |
| 87 private: | 87 private: |
| 88 DISALLOW_COPY_AND_ASSIGN(MockDaemonListener); | 88 DISALLOW_COPY_AND_ASSIGN(MockDaemonListener); |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 bool FakeDaemonSender::Send(IPC::Message* message) { | 91 bool FakeDaemonSender::Send(IPC::Message* message) { |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 screen_controls_->SetScreenResolution(ScreenResolution( | 713 screen_controls_->SetScreenResolution(ScreenResolution( |
| 714 webrtc::DesktopSize(100, 100), | 714 webrtc::DesktopSize(100, 100), |
| 715 webrtc::DesktopVector(96, 96))); | 715 webrtc::DesktopVector(96, 96))); |
| 716 | 716 |
| 717 task_runner_ = nullptr; | 717 task_runner_ = nullptr; |
| 718 io_task_runner_ = nullptr; | 718 io_task_runner_ = nullptr; |
| 719 main_run_loop_.Run(); | 719 main_run_loop_.Run(); |
| 720 } | 720 } |
| 721 | 721 |
| 722 } // namespace remoting | 722 } // namespace remoting |
| OLD | NEW |