OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <errno.h> | 5 #include <errno.h> |
6 #include <fcntl.h> | 6 #include <fcntl.h> |
7 #include <linux/input.h> | 7 #include <linux/input.h> |
8 #include <unistd.h> | 8 #include <unistd.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 int write_pipe_; | 62 int write_pipe_; |
63 | 63 |
64 DISALLOW_COPY_AND_ASSIGN(MockTouchEventConverterEvdev); | 64 DISALLOW_COPY_AND_ASSIGN(MockTouchEventConverterEvdev); |
65 }; | 65 }; |
66 | 66 |
67 class MockDeviceEventDispatcherEvdev : public DeviceEventDispatcherEvdev { | 67 class MockDeviceEventDispatcherEvdev : public DeviceEventDispatcherEvdev { |
68 public: | 68 public: |
69 MockDeviceEventDispatcherEvdev( | 69 MockDeviceEventDispatcherEvdev( |
70 const base::Callback<void(const TouchEventParams& params)>& callback) | 70 const base::Callback<void(const TouchEventParams& params)>& callback) |
71 : callback_(callback) {} | 71 : callback_(callback) {} |
72 ~MockDeviceEventDispatcherEvdev() {} | 72 ~MockDeviceEventDispatcherEvdev() override {} |
73 | 73 |
74 // DeviceEventDispatcherEvdev: | 74 // DeviceEventDispatcherEvdev: |
75 void DispatchKeyEvent(const KeyEventParams& params) override {} | 75 void DispatchKeyEvent(const KeyEventParams& params) override {} |
76 void DispatchMouseMoveEvent(const MouseMoveEventParams& params) override {} | 76 void DispatchMouseMoveEvent(const MouseMoveEventParams& params) override {} |
77 void DispatchMouseButtonEvent(const MouseButtonEventParams& params) override { | 77 void DispatchMouseButtonEvent(const MouseButtonEventParams& params) override { |
78 } | 78 } |
79 void DispatchMouseWheelEvent(const MouseWheelEventParams& params) override {} | 79 void DispatchMouseWheelEvent(const MouseWheelEventParams& params) override {} |
80 void DispatchScrollEvent(const ScrollEventParams& params) override {} | 80 void DispatchScrollEvent(const ScrollEventParams& params) override {} |
81 void DispatchTouchEvent(const TouchEventParams& params) override { | 81 void DispatchTouchEvent(const TouchEventParams& params) override { |
82 callback_.Run(params); | 82 callback_.Run(params); |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 {{0, 0}, EV_ABS, ABS_MT_POSITION_X, 777}, | 555 {{0, 0}, EV_ABS, ABS_MT_POSITION_X, 777}, |
556 {{0, 0}, EV_ABS, ABS_MT_POSITION_Y, 666}, | 556 {{0, 0}, EV_ABS, ABS_MT_POSITION_Y, 666}, |
557 {{0, 0}, EV_SYN, SYN_REPORT, 0}, | 557 {{0, 0}, EV_SYN, SYN_REPORT, 0}, |
558 }; | 558 }; |
559 | 559 |
560 // Check that one 1 event is generated | 560 // Check that one 1 event is generated |
561 dev->ConfigureReadMock(mock_kernel_queue, arraysize(mock_kernel_queue), 0); | 561 dev->ConfigureReadMock(mock_kernel_queue, arraysize(mock_kernel_queue), 0); |
562 dev->ReadNow(); | 562 dev->ReadNow(); |
563 EXPECT_EQ(1u, size()); | 563 EXPECT_EQ(1u, size()); |
564 } | 564 } |
OLD | NEW |