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

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

Issue 616633002: [Ozone-Evdev] Propagate touchscreen device information to DeviceDataManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 2 months 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
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 ScopedVector<TouchEvent> dispatched_events_; 68 ScopedVector<TouchEvent> dispatched_events_;
69 69
70 DISALLOW_COPY_AND_ASSIGN(MockTouchEventConverterEvdev); 70 DISALLOW_COPY_AND_ASSIGN(MockTouchEventConverterEvdev);
71 }; 71 };
72 72
73 MockTouchEventConverterEvdev::MockTouchEventConverterEvdev(int fd, 73 MockTouchEventConverterEvdev::MockTouchEventConverterEvdev(int fd,
74 base::FilePath path) 74 base::FilePath path)
75 : TouchEventConverterEvdev( 75 : TouchEventConverterEvdev(
76 fd, 76 fd,
77 path, 77 path,
78 EventDeviceInfo(), 78 scoped_ptr<EventDeviceInfo>(new EventDeviceInfo(1)),
79 base::Bind(&MockTouchEventConverterEvdev::DispatchCallback, 79 base::Bind(&MockTouchEventConverterEvdev::DispatchCallback,
80 base::Unretained(this))) { 80 base::Unretained(this))) {
81 pressure_min_ = 30; 81 pressure_min_ = 30;
82 pressure_max_ = 60; 82 pressure_max_ = 60;
83 83
84 // TODO(rjkroege): Check test axes. 84 // TODO(rjkroege): Check test axes.
85 x_min_pixels_ = x_min_tuxels_ = 0; 85 x_min_pixels_ = x_min_tuxels_ = 0;
86 x_num_pixels_ = x_num_tuxels_ = std::numeric_limits<int>::max(); 86 x_num_pixels_ = x_num_tuxels_ = std::numeric_limits<int>::max();
87 y_min_pixels_ = y_min_tuxels_ = 0; 87 y_min_pixels_ = y_min_tuxels_ = 0;
88 y_num_pixels_ = y_num_tuxels_ = std::numeric_limits<int>::max(); 88 y_num_pixels_ = y_num_tuxels_ = std::numeric_limits<int>::max();
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 EXPECT_EQ(0, ev0->touch_id()); 519 EXPECT_EQ(0, ev0->touch_id());
520 EXPECT_EQ(999, ev0->x()); 520 EXPECT_EQ(999, ev0->x());
521 EXPECT_EQ(888, ev0->y()); 521 EXPECT_EQ(888, ev0->y());
522 EXPECT_FLOAT_EQ(0.8333333f, ev0->force()); 522 EXPECT_FLOAT_EQ(0.8333333f, ev0->force());
523 523
524 EXPECT_EQ(1, ev1->touch_id()); 524 EXPECT_EQ(1, ev1->touch_id());
525 EXPECT_EQ(777, ev1->x()); 525 EXPECT_EQ(777, ev1->x());
526 EXPECT_EQ(666, ev1->y()); 526 EXPECT_EQ(666, ev1->y());
527 EXPECT_FLOAT_EQ(0.4666666f, ev1->force()); 527 EXPECT_FLOAT_EQ(0.4666666f, ev1->force());
528 } 528 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698