| 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.h" | 10 #include "base/message_loop.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 70 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 71 | 71 |
| 72 MOCK_METHOD1(OnDesktopAttached, void(IPC::PlatformFileForTransit)); | 72 MOCK_METHOD1(OnDesktopAttached, void(IPC::PlatformFileForTransit)); |
| 73 MOCK_METHOD1(OnChannelConnected, void(int32)); | 73 MOCK_METHOD1(OnChannelConnected, void(int32)); |
| 74 MOCK_METHOD0(OnChannelError, void()); | 74 MOCK_METHOD0(OnChannelError, void()); |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 DISALLOW_COPY_AND_ASSIGN(MockDaemonListener); | 77 DISALLOW_COPY_AND_ASSIGN(MockDaemonListener); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 class MockClientSessionControl : public ClientSessionControl { | |
| 81 public: | |
| 82 MockClientSessionControl() {} | |
| 83 virtual ~MockClientSessionControl() {} | |
| 84 | |
| 85 MOCK_CONST_METHOD0(client_jid, const std::string&()); | |
| 86 MOCK_METHOD0(DisconnectSession, void()); | |
| 87 MOCK_METHOD1(OnLocalMouseMoved, void(const SkIPoint&)); | |
| 88 MOCK_METHOD1(SetDisableInputs, void(bool)); | |
| 89 | |
| 90 private: | |
| 91 DISALLOW_COPY_AND_ASSIGN(MockClientSessionControl); | |
| 92 }; | |
| 93 | |
| 94 bool FakeDaemonSender::Send(IPC::Message* message) { | 80 bool FakeDaemonSender::Send(IPC::Message* message) { |
| 95 OnMessageReceived(*message); | 81 OnMessageReceived(*message); |
| 96 delete message; | 82 delete message; |
| 97 return true; | 83 return true; |
| 98 } | 84 } |
| 99 | 85 |
| 100 void FakeDaemonSender::OnMessageReceived(const IPC::Message& message) { | 86 void FakeDaemonSender::OnMessageReceived(const IPC::Message& message) { |
| 101 bool handled = true; | 87 bool handled = true; |
| 102 IPC_BEGIN_MESSAGE_MAP(FakeDaemonSender, message) | 88 IPC_BEGIN_MESSAGE_MAP(FakeDaemonSender, message) |
| 103 IPC_MESSAGE_HANDLER(ChromotingNetworkHostMsg_ConnectTerminal, | 89 IPC_MESSAGE_HANDLER(ChromotingNetworkHostMsg_ConnectTerminal, |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 event.set_x(0); | 657 event.set_x(0); |
| 672 event.set_y(0); | 658 event.set_y(0); |
| 673 event_executor_->InjectMouseEvent(event); | 659 event_executor_->InjectMouseEvent(event); |
| 674 | 660 |
| 675 task_runner_ = NULL; | 661 task_runner_ = NULL; |
| 676 io_task_runner_ = NULL; | 662 io_task_runner_ = NULL; |
| 677 main_run_loop_.Run(); | 663 main_run_loop_.Run(); |
| 678 } | 664 } |
| 679 | 665 |
| 680 } // namespace remoting | 666 } // namespace remoting |
| OLD | NEW |