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

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

Issue 1022673006: Remove support for type A touchscreens from TouchEventConverterEvdev (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 ev1 = dispatched_event(8); 441 ev1 = dispatched_event(8);
442 442
443 EXPECT_EQ(ui::ET_TOUCH_RELEASED, ev1.type); 443 EXPECT_EQ(ui::ET_TOUCH_RELEASED, ev1.type);
444 EXPECT_EQ(base::TimeDelta::FromMicroseconds(0), ev1.timestamp); 444 EXPECT_EQ(base::TimeDelta::FromMicroseconds(0), ev1.timestamp);
445 EXPECT_EQ(38, ev1.location.x()); 445 EXPECT_EQ(38, ev1.location.x());
446 EXPECT_EQ(102, ev1.location.y()); 446 EXPECT_EQ(102, ev1.location.y());
447 EXPECT_EQ(1, ev1.touch_id); 447 EXPECT_EQ(1, ev1.touch_id);
448 EXPECT_FLOAT_EQ(.5f, ev1.pressure); 448 EXPECT_FLOAT_EQ(.5f, ev1.pressure);
449 } 449 }
450 450
451 TEST_F(TouchEventConverterEvdevTest, TypeA) {
452 ui::MockTouchEventConverterEvdev* dev = device();
453
454 struct input_event mock_kernel_queue_press0[] = {
455 {{0, 0}, EV_ABS, ABS_MT_TOUCH_MAJOR, 3},
456 {{0, 0}, EV_ABS, ABS_MT_PRESSURE, 45},
457 {{0, 0}, EV_ABS, ABS_MT_POSITION_X, 42},
458 {{0, 0}, EV_ABS, ABS_MT_POSITION_Y, 51},
459 {{0, 0}, EV_SYN, SYN_MT_REPORT, 0},
460 {{0, 0}, EV_ABS, ABS_MT_PRESSURE, 45},
461 {{0, 0}, EV_ABS, ABS_MT_POSITION_X, 61},
462 {{0, 0}, EV_ABS, ABS_MT_POSITION_Y, 71},
463 {{0, 0}, EV_SYN, SYN_MT_REPORT, 0},
464 {{0, 0}, EV_SYN, SYN_REPORT, 0}
465 };
466
467 // Check that two events are generated.
468 dev->ConfigureReadMock(mock_kernel_queue_press0, 10, 0);
469 dev->ReadNow();
470 EXPECT_EQ(2u, size());
471 }
472
473 TEST_F(TouchEventConverterEvdevTest, Unsync) { 451 TEST_F(TouchEventConverterEvdevTest, Unsync) {
474 ui::MockTouchEventConverterEvdev* dev = device(); 452 ui::MockTouchEventConverterEvdev* dev = device();
475 453
476 struct input_event mock_kernel_queue_press0[] = { 454 struct input_event mock_kernel_queue_press0[] = {
477 {{0, 0}, EV_ABS, ABS_MT_TRACKING_ID, 684}, 455 {{0, 0}, EV_ABS, ABS_MT_TRACKING_ID, 684},
478 {{0, 0}, EV_ABS, ABS_MT_TOUCH_MAJOR, 3}, 456 {{0, 0}, EV_ABS, ABS_MT_TOUCH_MAJOR, 3},
479 {{0, 0}, EV_ABS, ABS_MT_PRESSURE, 45}, 457 {{0, 0}, EV_ABS, ABS_MT_PRESSURE, 45},
480 {{0, 0}, EV_ABS, ABS_MT_POSITION_X, 42}, 458 {{0, 0}, EV_ABS, ABS_MT_POSITION_X, 42},
481 {{0, 0}, EV_ABS, ABS_MT_POSITION_Y, 51}, {{0, 0}, EV_SYN, SYN_REPORT, 0} 459 {{0, 0}, EV_ABS, ABS_MT_POSITION_Y, 51}, {{0, 0}, EV_SYN, SYN_REPORT, 0}
482 }; 460 };
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 {{0, 0}, EV_ABS, ABS_MT_POSITION_X, 777}, 543 {{0, 0}, EV_ABS, ABS_MT_POSITION_X, 777},
566 {{0, 0}, EV_ABS, ABS_MT_POSITION_Y, 666}, 544 {{0, 0}, EV_ABS, ABS_MT_POSITION_Y, 666},
567 {{0, 0}, EV_SYN, SYN_REPORT, 0}, 545 {{0, 0}, EV_SYN, SYN_REPORT, 0},
568 }; 546 };
569 547
570 // Check that one 1 event is generated 548 // Check that one 1 event is generated
571 dev->ConfigureReadMock(mock_kernel_queue, arraysize(mock_kernel_queue), 0); 549 dev->ConfigureReadMock(mock_kernel_queue, arraysize(mock_kernel_queue), 0);
572 dev->ReadNow(); 550 dev->ReadNow();
573 EXPECT_EQ(1u, size()); 551 EXPECT_EQ(1u, size());
574 } 552 }
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