| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 bool down, | 81 bool down, |
| 82 bool allow_remap) override {} | 82 bool allow_remap) override {} |
| 83 void DispatchMouseWheelEvent(int device_id, | 83 void DispatchMouseWheelEvent(int device_id, |
| 84 const gfx::PointF& location, | 84 const gfx::PointF& location, |
| 85 const gfx::Vector2d& delta) override {} | 85 const gfx::Vector2d& delta) override {} |
| 86 void DispatchScrollEvent(const ScrollEventParams& params) override {} | 86 void DispatchScrollEvent(const ScrollEventParams& params) override {} |
| 87 void DispatchTouchEvent(const TouchEventParams& params) override { | 87 void DispatchTouchEvent(const TouchEventParams& params) override { |
| 88 callback_.Run(params); | 88 callback_.Run(params); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void DispatchKeyboardDevicesUpdated( |
| 92 const std::vector<KeyboardDevice>& devices) override {} |
| 93 void DispatchTouchscreenDevicesUpdated( |
| 94 const std::vector<TouchscreenDevice>& devices) override {} |
| 95 void DispatchMouseDevicesUpdated( |
| 96 const std::vector<InputDevice>& devices) override {} |
| 97 void DispatchTouchpadDevicesUpdated( |
| 98 const std::vector<InputDevice>& devices) override {} |
| 99 |
| 91 private: | 100 private: |
| 92 base::Callback<void(const TouchEventParams& params)> callback_; | 101 base::Callback<void(const TouchEventParams& params)> callback_; |
| 93 }; | 102 }; |
| 94 | 103 |
| 95 MockTouchEventConverterEvdev::MockTouchEventConverterEvdev( | 104 MockTouchEventConverterEvdev::MockTouchEventConverterEvdev( |
| 96 int fd, | 105 int fd, |
| 97 base::FilePath path, | 106 base::FilePath path, |
| 98 DeviceEventDispatcherEvdev* dispatcher) | 107 DeviceEventDispatcherEvdev* dispatcher) |
| 99 : TouchEventConverterEvdev(fd, path, 1, INPUT_DEVICE_UNKNOWN, dispatcher) { | 108 : TouchEventConverterEvdev(fd, path, 1, INPUT_DEVICE_UNKNOWN, dispatcher) { |
| 100 pressure_min_ = 30; | 109 pressure_min_ = 30; |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 {{0, 0}, EV_ABS, ABS_MT_POSITION_X, 777}, | 570 {{0, 0}, EV_ABS, ABS_MT_POSITION_X, 777}, |
| 562 {{0, 0}, EV_ABS, ABS_MT_POSITION_Y, 666}, | 571 {{0, 0}, EV_ABS, ABS_MT_POSITION_Y, 666}, |
| 563 {{0, 0}, EV_SYN, SYN_REPORT, 0}, | 572 {{0, 0}, EV_SYN, SYN_REPORT, 0}, |
| 564 }; | 573 }; |
| 565 | 574 |
| 566 // Check that one 1 event is generated | 575 // Check that one 1 event is generated |
| 567 dev->ConfigureReadMock(mock_kernel_queue, arraysize(mock_kernel_queue), 0); | 576 dev->ConfigureReadMock(mock_kernel_queue, arraysize(mock_kernel_queue), 0); |
| 568 dev->ReadNow(); | 577 dev->ReadNow(); |
| 569 EXPECT_EQ(1u, size()); | 578 EXPECT_EQ(1u, size()); |
| 570 } | 579 } |
| OLD | NEW |