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

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

Issue 2933353003: Mark the ET_MOUSE_MOVED created from a pointer grab as synthesized. (Closed)
Patch Set: Clarify comment. Created 3 years, 5 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/platform/x11/x11_event_source_libevent.cc ('k') | ui/events/x/events_x_utils.cc » ('j') | 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 <X11/XKBlib.h> 5 #include <X11/XKBlib.h>
6 #include <X11/Xlib.h> 6 #include <X11/Xlib.h>
7 #include <X11/Xutil.h> 7 #include <X11/Xutil.h>
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 event.xcrossing.type = EnterNotify; 182 event.xcrossing.type = EnterNotify;
183 event.xcrossing.x = 10; 183 event.xcrossing.x = 10;
184 event.xcrossing.y = 20; 184 event.xcrossing.y = 20;
185 event.xcrossing.x_root = 110; 185 event.xcrossing.x_root = 110;
186 event.xcrossing.y_root = 120; 186 event.xcrossing.y_root = 120;
187 187
188 // Mouse enter events are converted to mouse move events to be consistent with 188 // Mouse enter events are converted to mouse move events to be consistent with
189 // the way views handle mouse enter. See comments for EnterNotify case in 189 // the way views handle mouse enter. See comments for EnterNotify case in
190 // ui::EventTypeFromNative for more details. 190 // ui::EventTypeFromNative for more details.
191 EXPECT_EQ(ui::ET_MOUSE_MOVED, ui::EventTypeFromNative(&event)); 191 EXPECT_EQ(ui::ET_MOUSE_MOVED, ui::EventTypeFromNative(&event));
192 EXPECT_TRUE(ui::EventFlagsFromNative(&event) & ui::EF_IS_SYNTHESIZED);
192 EXPECT_EQ( 193 EXPECT_EQ(
193 "10,20", 194 "10,20",
194 gfx::ToFlooredPoint(ui::EventLocationFromNative(&event)).ToString()); 195 gfx::ToFlooredPoint(ui::EventLocationFromNative(&event)).ToString());
195 EXPECT_EQ("110,120", ui::EventSystemLocationFromNative(&event).ToString()); 196 EXPECT_EQ("110,120", ui::EventSystemLocationFromNative(&event).ToString());
196 197
197 event.xcrossing.type = LeaveNotify; 198 event.xcrossing.type = LeaveNotify;
198 event.xcrossing.x = 30; 199 event.xcrossing.x = 30;
199 event.xcrossing.y = 40; 200 event.xcrossing.y = 40;
200 event.xcrossing.x_root = 230; 201 event.xcrossing.x_root = 230;
201 event.xcrossing.y_root = 240; 202 event.xcrossing.y_root = 240;
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 586
586 ResetTimestampRolloverCountersForTesting( 587 ResetTimestampRolloverCountersForTesting(
587 base::MakeUnique<MockTickClock>(0x100000005)); 588 base::MakeUnique<MockTickClock>(0x100000005));
588 589
589 event.xbutton.time = 0xFFFFFFFF; 590 event.xbutton.time = 0xFFFFFFFF;
590 EXPECT_EQ(base::TimeDelta::FromMilliseconds(0xFFFFFFFF).ToInternalValue(), 591 EXPECT_EQ(base::TimeDelta::FromMilliseconds(0xFFFFFFFF).ToInternalValue(),
591 ui::EventTimeFromNative(&event).ToInternalValue()); 592 ui::EventTimeFromNative(&event).ToInternalValue());
592 } 593 }
593 594
594 } // namespace ui 595 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/platform/x11/x11_event_source_libevent.cc ('k') | ui/events/x/events_x_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698