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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
7 #include "ui/events/event.h" | 7 #include "ui/events/event.h" |
8 | 8 |
9 #if defined(USE_X11) | 9 #if defined(USE_X11) |
10 #include <X11/Xlib.h> | 10 #include <X11/Xlib.h> |
11 #include "ui/base/x/x11_util.h" | 11 #include "ui/events/x/events_x_utils.h" |
| 12 #include "ui/gfx/x/x11_types.h" |
12 #endif | 13 #endif |
13 | 14 |
14 namespace ui { | 15 namespace ui { |
15 | 16 |
16 TEST(EventTest, NoNativeEvent) { | 17 TEST(EventTest, NoNativeEvent) { |
17 KeyEvent keyev(ET_KEY_PRESSED, VKEY_SPACE, 0, false); | 18 KeyEvent keyev(ET_KEY_PRESSED, VKEY_SPACE, 0, false); |
18 EXPECT_FALSE(keyev.HasNativeEvent()); | 19 EXPECT_FALSE(keyev.HasNativeEvent()); |
19 } | 20 } |
20 | 21 |
21 TEST(EventTest, NativeEvent) { | 22 TEST(EventTest, NativeEvent) { |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 } | 286 } |
286 { | 287 { |
287 KeyEvent keyev(ET_KEY_RELEASED, VKEY_MENU, EF_ALT_DOWN, false); | 288 KeyEvent keyev(ET_KEY_RELEASED, VKEY_MENU, EF_ALT_DOWN, false); |
288 EXPECT_EQ(EF_ALT_DOWN, keyev.flags()); | 289 EXPECT_EQ(EF_ALT_DOWN, keyev.flags()); |
289 keyev.NormalizeFlags(); | 290 keyev.NormalizeFlags(); |
290 EXPECT_EQ(EF_NONE, keyev.flags()); | 291 EXPECT_EQ(EF_NONE, keyev.flags()); |
291 } | 292 } |
292 } | 293 } |
293 | 294 |
294 } // namespace ui | 295 } // namespace ui |
OLD | NEW |