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 <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> |
11 #include <X11/XKBlib.h> | 11 #include <X11/XKBlib.h> |
12 | 12 |
13 // Generically-named #defines from Xlib that conflict with symbols in GTest. | 13 // Generically-named #defines from Xlib that conflict with symbols in GTest. |
14 #undef Bool | 14 #undef Bool |
15 #undef None | 15 #undef None |
16 | 16 |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 #include "ui/events/event.h" | 19 #include "ui/events/event.h" |
20 #include "ui/events/event_constants.h" | 20 #include "ui/events/event_constants.h" |
21 #include "ui/events/event_utils.h" | 21 #include "ui/events/event_utils.h" |
22 #include "ui/events/test/events_test_utils_x11.h" | 22 #include "ui/events/test/events_test_utils_x11.h" |
23 #include "ui/events/x/device_data_manager_x11.h" | 23 #include "ui/events/x/device_data_manager_x11.h" |
24 #include "ui/events/x/touch_factory_x11.h" | 24 #include "ui/events/x/touch_factory_x11.h" |
25 #include "ui/gfx/point.h" | 25 #include "ui/gfx/geometry/point.h" |
26 | 26 |
27 namespace ui { | 27 namespace ui { |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
31 // Initializes the passed-in Xlib event. | 31 // Initializes the passed-in Xlib event. |
32 void InitButtonEvent(XEvent* event, | 32 void InitButtonEvent(XEvent* event, |
33 bool is_press, | 33 bool is_press, |
34 const gfx::Point& location, | 34 const gfx::Point& location, |
35 int button, | 35 int button, |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 XEvent x_event; | 533 XEvent x_event; |
534 InitKeyEvent(display, &x_event, true, 0, state); | 534 InitKeyEvent(display, &x_event, true, 0, state); |
535 ui::KeyEvent key_event(&x_event, is_char); | 535 ui::KeyEvent key_event(&x_event, is_char); |
536 EXPECT_FALSE(key_event.flags() & ui::EF_IME_FABRICATED_KEY); | 536 EXPECT_FALSE(key_event.flags() & ui::EF_IME_FABRICATED_KEY); |
537 } | 537 } |
538 } | 538 } |
539 } | 539 } |
540 #endif | 540 #endif |
541 | 541 |
542 } // namespace ui | 542 } // namespace ui |
OLD | NEW |