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

Side by Side Diff: ui/events/x/events_x_unittest.cc

Issue 1147293002: Stop dispatching mouse move events for wheel scrolling in X11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address sadrul's comments. Created 5 years, 7 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/x/events_x.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <cstring> 5 #include <cstring>
6 #include <set> 6 #include <set>
7 7
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 #include <X11/Xutil.h> 10 #include <X11/Xutil.h>
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 if (is_char) { 486 if (is_char) {
487 KeyEventTestApi test_event(&key_event); 487 KeyEventTestApi test_event(&key_event);
488 test_event.set_is_char(true); 488 test_event.set_is_char(true);
489 } 489 }
490 EXPECT_FALSE(key_event.flags() & ui::EF_IME_FABRICATED_KEY); 490 EXPECT_FALSE(key_event.flags() & ui::EF_IME_FABRICATED_KEY);
491 } 491 }
492 } 492 }
493 } 493 }
494 #endif 494 #endif
495 495
496 TEST_F(EventsXTest, IgnoresMotionEventForMouseWheelScroll) {
497 int device_id = 1;
498 std::vector<int> devices;
499 devices.push_back(device_id);
500 ui::SetUpPointerDevicesForTest(devices);
501
502 ScopedXI2Event xev;
503 xev.InitScrollEvent(device_id, 1, 2, 3, 4, 1);
504 // We shouldn't produce a mouse move event on a mouse wheel
505 // scroll. These events are only produced for some mice.
506 EXPECT_EQ(ui::ET_UNKNOWN, ui::EventTypeFromNative(xev));
507 }
508
496 } // namespace ui 509 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/x/events_x.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698