Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc

Issue 790153005: ozone: evdev: Add property to identify internal or external devices (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/events/ozone/evdev/touch_event_converter_evdev.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
75 75
76 DISALLOW_COPY_AND_ASSIGN(MockTouchEventConverterEvdev); 76 DISALLOW_COPY_AND_ASSIGN(MockTouchEventConverterEvdev);
77 }; 77 };
78 78
79 MockTouchEventConverterEvdev::MockTouchEventConverterEvdev(int fd, 79 MockTouchEventConverterEvdev::MockTouchEventConverterEvdev(int fd,
80 base::FilePath path) 80 base::FilePath path)
81 : TouchEventConverterEvdev( 81 : TouchEventConverterEvdev(
82 fd, 82 fd,
83 path, 83 path,
84 1, 84 1,
85 INPUT_DEVICE_UNKNOWN,
85 base::Bind(&MockTouchEventConverterEvdev::DispatchCallback, 86 base::Bind(&MockTouchEventConverterEvdev::DispatchCallback,
86 base::Unretained(this))) { 87 base::Unretained(this))) {
87 pressure_min_ = 30; 88 pressure_min_ = 30;
88 pressure_max_ = 60; 89 pressure_max_ = 60;
89 90
90 // TODO(rjkroege): Check test axes. 91 // TODO(rjkroege): Check test axes.
91 x_min_tuxels_ = 0; 92 x_min_tuxels_ = 0;
92 x_num_tuxels_ = std::numeric_limits<int>::max(); 93 x_num_tuxels_ = std::numeric_limits<int>::max();
93 y_min_tuxels_ = 0; 94 y_min_tuxels_ = 0;
94 y_num_tuxels_ = std::numeric_limits<int>::max(); 95 y_num_tuxels_ = std::numeric_limits<int>::max();
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 EXPECT_EQ(0, ev0->touch_id()); 531 EXPECT_EQ(0, ev0->touch_id());
531 EXPECT_EQ(999, ev0->x()); 532 EXPECT_EQ(999, ev0->x());
532 EXPECT_EQ(888, ev0->y()); 533 EXPECT_EQ(888, ev0->y());
533 EXPECT_FLOAT_EQ(0.8333333f, ev0->force()); 534 EXPECT_FLOAT_EQ(0.8333333f, ev0->force());
534 535
535 EXPECT_EQ(1, ev1->touch_id()); 536 EXPECT_EQ(1, ev1->touch_id());
536 EXPECT_EQ(777, ev1->x()); 537 EXPECT_EQ(777, ev1->x());
537 EXPECT_EQ(666, ev1->y()); 538 EXPECT_EQ(666, ev1->y());
538 EXPECT_FLOAT_EQ(0.4666666f, ev1->force()); 539 EXPECT_FLOAT_EQ(0.4666666f, ev1->force());
539 } 540 }
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/touch_event_converter_evdev.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698