| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void DispatchKeyboardDevicesUpdated( |
| 86 const std::vector<KeyboardDevice>& devices) override {} |
| 87 void DispatchTouchscreenDevicesUpdated( |
| 88 const std::vector<TouchscreenDevice>& devices) override {} |
| 89 void DispatchMouseDevicesUpdated( |
| 90 const std::vector<InputDevice>& devices) override {} |
| 91 void DispatchTouchpadDevicesUpdated( |
| 92 const std::vector<InputDevice>& devices) override {} |
| 93 |
| 85 private: | 94 private: |
| 86 base::Callback<void(const TouchEventParams& params)> callback_; | 95 base::Callback<void(const TouchEventParams& params)> callback_; |
| 87 }; | 96 }; |
| 88 | 97 |
| 89 MockTouchEventConverterEvdev::MockTouchEventConverterEvdev( | 98 MockTouchEventConverterEvdev::MockTouchEventConverterEvdev( |
| 90 int fd, | 99 int fd, |
| 91 base::FilePath path, | 100 base::FilePath path, |
| 92 DeviceEventDispatcherEvdev* dispatcher) | 101 DeviceEventDispatcherEvdev* dispatcher) |
| 93 : TouchEventConverterEvdev(fd, path, 1, INPUT_DEVICE_UNKNOWN, dispatcher) { | 102 : TouchEventConverterEvdev(fd, path, 1, INPUT_DEVICE_UNKNOWN, dispatcher) { |
| 94 pressure_min_ = 30; | 103 pressure_min_ = 30; |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 {{0, 0}, EV_ABS, ABS_MT_POSITION_X, 777}, | 564 {{0, 0}, EV_ABS, ABS_MT_POSITION_X, 777}, |
| 556 {{0, 0}, EV_ABS, ABS_MT_POSITION_Y, 666}, | 565 {{0, 0}, EV_ABS, ABS_MT_POSITION_Y, 666}, |
| 557 {{0, 0}, EV_SYN, SYN_REPORT, 0}, | 566 {{0, 0}, EV_SYN, SYN_REPORT, 0}, |
| 558 }; | 567 }; |
| 559 | 568 |
| 560 // Check that one 1 event is generated | 569 // Check that one 1 event is generated |
| 561 dev->ConfigureReadMock(mock_kernel_queue, arraysize(mock_kernel_queue), 0); | 570 dev->ConfigureReadMock(mock_kernel_queue, arraysize(mock_kernel_queue), 0); |
| 562 dev->ReadNow(); | 571 dev->ReadNow(); |
| 563 EXPECT_EQ(1u, size()); | 572 EXPECT_EQ(1u, size()); |
| 564 } | 573 } |
| OLD | NEW |