| 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 30 matching lines...) Expand all Loading... |
| 41 using testing::AtLeast; | 41 using testing::AtLeast; |
| 42 using testing::AtMost; | 42 using testing::AtMost; |
| 43 using testing::DeleteArg; | 43 using testing::DeleteArg; |
| 44 using testing::DoAll; | 44 using testing::DoAll; |
| 45 using testing::InSequence; | 45 using testing::InSequence; |
| 46 using testing::Return; | 46 using testing::Return; |
| 47 using testing::ReturnRef; | 47 using testing::ReturnRef; |
| 48 | 48 |
| 49 namespace remoting { | 49 namespace remoting { |
| 50 | 50 |
| 51 using protocol::test::EqualsTouchEvent; |
| 52 using protocol::test::EqualsTouchEventTypeAndId; |
| 53 |
| 51 namespace { | 54 namespace { |
| 52 | 55 |
| 53 // Receives messages sent from the network process to the daemon. | 56 // Receives messages sent from the network process to the daemon. |
| 54 class FakeDaemonSender : public IPC::Sender { | 57 class FakeDaemonSender : public IPC::Sender { |
| 55 public: | 58 public: |
| 56 FakeDaemonSender() {} | 59 FakeDaemonSender() {} |
| 57 virtual ~FakeDaemonSender() {} | 60 virtual ~FakeDaemonSender() {} |
| 58 | 61 |
| 59 // IPC::Sender implementation. | 62 // IPC::Sender implementation. |
| 60 virtual bool Send(IPC::Message* message) override; | 63 virtual bool Send(IPC::Message* message) override; |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 point->set_pressure(0.0f); | 670 point->set_pressure(0.0f); |
| 668 | 671 |
| 669 ON_CALL(*remote_input_injector_, InjectTouchEvent(_)) | 672 ON_CALL(*remote_input_injector_, InjectTouchEvent(_)) |
| 670 .WillByDefault(InvokeWithoutArgs( | 673 .WillByDefault(InvokeWithoutArgs( |
| 671 this, &IpcDesktopEnvironmentTest::DeleteDesktopEnvironment)); | 674 this, &IpcDesktopEnvironmentTest::DeleteDesktopEnvironment)); |
| 672 | 675 |
| 673 InSequence s; | 676 InSequence s; |
| 674 // Expect that the event gets propagated to remote_input_injector_. | 677 // Expect that the event gets propagated to remote_input_injector_. |
| 675 // And one more call for ReleaseAll(). | 678 // And one more call for ReleaseAll(). |
| 676 EXPECT_CALL(*remote_input_injector_, | 679 EXPECT_CALL(*remote_input_injector_, |
| 677 InjectTouchEvent(protocol::TouchEventEqual(event))); | 680 InjectTouchEvent(EqualsTouchEvent(event))); |
| 678 EXPECT_CALL(*remote_input_injector_, | 681 EXPECT_CALL(*remote_input_injector_, |
| 679 InjectTouchEvent(protocol::IsTouchCancelEvent())); | 682 InjectTouchEvent(EqualsTouchEventTypeAndId( |
| 683 protocol::TouchEvent::TOUCH_POINT_CANCEL, 0u))); |
| 680 | 684 |
| 681 // Send the touch event. | 685 // Send the touch event. |
| 682 input_injector_->InjectTouchEvent(event); | 686 input_injector_->InjectTouchEvent(event); |
| 683 | 687 |
| 684 task_runner_ = nullptr; | 688 task_runner_ = nullptr; |
| 685 io_task_runner_ = nullptr; | 689 io_task_runner_ = nullptr; |
| 686 main_run_loop_.Run(); | 690 main_run_loop_.Run(); |
| 687 } | 691 } |
| 688 | 692 |
| 689 // Tests that setting the desktop resolution works. | 693 // Tests that setting the desktop resolution works. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 709 screen_controls_->SetScreenResolution(ScreenResolution( | 713 screen_controls_->SetScreenResolution(ScreenResolution( |
| 710 webrtc::DesktopSize(100, 100), | 714 webrtc::DesktopSize(100, 100), |
| 711 webrtc::DesktopVector(96, 96))); | 715 webrtc::DesktopVector(96, 96))); |
| 712 | 716 |
| 713 task_runner_ = nullptr; | 717 task_runner_ = nullptr; |
| 714 io_task_runner_ = nullptr; | 718 io_task_runner_ = nullptr; |
| 715 main_run_loop_.Run(); | 719 main_run_loop_.Run(); |
| 716 } | 720 } |
| 717 | 721 |
| 718 } // namespace remoting | 722 } // namespace remoting |
| OLD | NEW |