| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 MockTabletEventConverterEvdev::MockTabletEventConverterEvdev( | 102 MockTabletEventConverterEvdev::MockTabletEventConverterEvdev( |
| 103 int fd, | 103 int fd, |
| 104 base::FilePath path, | 104 base::FilePath path, |
| 105 EventModifiersEvdev* modifiers, | 105 EventModifiersEvdev* modifiers, |
| 106 CursorDelegateEvdev* cursor) | 106 CursorDelegateEvdev* cursor) |
| 107 : TabletEventConverterEvdev( | 107 : TabletEventConverterEvdev( |
| 108 fd, | 108 fd, |
| 109 path, | 109 path, |
| 110 1, | 110 1, |
| 111 INPUT_DEVICE_UNKNOWN, |
| 111 modifiers, | 112 modifiers, |
| 112 cursor, | 113 cursor, |
| 113 EventDeviceInfo(), | 114 EventDeviceInfo(), |
| 114 base::Bind(&MockTabletEventConverterEvdev::DispatchCallback, | 115 base::Bind(&MockTabletEventConverterEvdev::DispatchCallback, |
| 115 base::Unretained(this))) { | 116 base::Unretained(this))) { |
| 116 // Real values taken from Wacom Intuos 4 | 117 // Real values taken from Wacom Intuos 4 |
| 117 x_abs_min_ = 0; | 118 x_abs_min_ = 0; |
| 118 x_abs_range_ = 65024; | 119 x_abs_range_ = 65024; |
| 119 y_abs_min_ = 0; | 120 y_abs_min_ = 0; |
| 120 y_abs_range_ = 40640; | 121 y_abs_range_ = 40640; |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 | 428 |
| 428 struct input_event mock_kernel_queue[] = { | 429 struct input_event mock_kernel_queue[] = { |
| 429 {{0, 0}, EV_ABS, ABS_X, 0}, | 430 {{0, 0}, EV_ABS, ABS_X, 0}, |
| 430 {{0, 0}, EV_ABS, ABS_Y, 0}, | 431 {{0, 0}, EV_ABS, ABS_Y, 0}, |
| 431 {{0, 0}, EV_SYN, SYN_REPORT, 0}, | 432 {{0, 0}, EV_SYN, SYN_REPORT, 0}, |
| 432 }; | 433 }; |
| 433 | 434 |
| 434 dev->ProcessEvents(mock_kernel_queue, arraysize(mock_kernel_queue)); | 435 dev->ProcessEvents(mock_kernel_queue, arraysize(mock_kernel_queue)); |
| 435 EXPECT_EQ(0u, dev->size()); | 436 EXPECT_EQ(0u, dev->size()); |
| 436 } | 437 } |
| OLD | NEW |