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

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

Issue 509713002: ozone: evdev: Fix TouchEvent radius (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add test Created 6 years, 3 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
« 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 EXPECT_EQ(1u, dev->size()); 173 EXPECT_EQ(1u, dev->size());
174 174
175 ui::TouchEvent* event = dev->event(0); 175 ui::TouchEvent* event = dev->event(0);
176 EXPECT_FALSE(event == NULL); 176 EXPECT_FALSE(event == NULL);
177 177
178 EXPECT_EQ(ui::ET_TOUCH_PRESSED, event->type()); 178 EXPECT_EQ(ui::ET_TOUCH_PRESSED, event->type());
179 EXPECT_EQ(base::TimeDelta::FromMicroseconds(0), event->time_stamp()); 179 EXPECT_EQ(base::TimeDelta::FromMicroseconds(0), event->time_stamp());
180 EXPECT_EQ(42, event->x()); 180 EXPECT_EQ(42, event->x());
181 EXPECT_EQ(51, event->y()); 181 EXPECT_EQ(51, event->y());
182 EXPECT_EQ(684, event->touch_id()); 182 EXPECT_EQ(684, event->touch_id());
183 EXPECT_FLOAT_EQ(1.5f, event->radius_x());
183 EXPECT_FLOAT_EQ(.5f, event->force()); 184 EXPECT_FLOAT_EQ(.5f, event->force());
184 EXPECT_FLOAT_EQ(0.f, event->rotation_angle()); 185 EXPECT_FLOAT_EQ(0.f, event->rotation_angle());
185 } 186 }
186 187
187 TEST_F(TouchEventConverterEvdevTest, NoEvents) { 188 TEST_F(TouchEventConverterEvdevTest, NoEvents) {
188 ui::MockTouchEventConverterEvdev* dev = device(); 189 ui::MockTouchEventConverterEvdev* dev = device();
189 dev->ConfigureReadMock(NULL, 0, 0); 190 dev->ConfigureReadMock(NULL, 0, 0);
190 EXPECT_EQ(0u, dev->size()); 191 EXPECT_EQ(0u, dev->size());
191 } 192 }
192 193
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 EXPECT_EQ(100, ev0->touch_id()); 518 EXPECT_EQ(100, ev0->touch_id());
518 EXPECT_EQ(999, ev0->x()); 519 EXPECT_EQ(999, ev0->x());
519 EXPECT_EQ(888, ev0->y()); 520 EXPECT_EQ(888, ev0->y());
520 EXPECT_FLOAT_EQ(0.8333333f, ev0->force()); 521 EXPECT_FLOAT_EQ(0.8333333f, ev0->force());
521 522
522 EXPECT_EQ(200, ev1->touch_id()); 523 EXPECT_EQ(200, ev1->touch_id());
523 EXPECT_EQ(777, ev1->x()); 524 EXPECT_EQ(777, ev1->x());
524 EXPECT_EQ(666, ev1->y()); 525 EXPECT_EQ(666, ev1->y());
525 EXPECT_FLOAT_EQ(0.4666666f, ev1->force()); 526 EXPECT_FLOAT_EQ(0.4666666f, ev1->force());
526 } 527 }
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