| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |