OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <gdk/gdkkeysyms.h> | 5 #include <gdk/gdkkeysyms.h> |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "ui/base/models/accelerator.h" | 8 #include "ui/base/models/accelerator.h" |
9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
10 #include "ui/views/focus/accelerator_handler.h" | 10 #include "ui/views/focus/accelerator_handler.h" |
11 #include "ui/views/focus/focus_manager.h" | 11 #include "ui/views/focus/focus_manager.h" |
| 12 #include "ui/views/widget/widget.h" |
| 13 #include "ui/views/widget/widget_delegate.h" |
12 #include "views/view.h" | 14 #include "views/view.h" |
13 #include "views/widget/widget.h" | |
14 #include "views/widget/widget_delegate.h" | |
15 | 15 |
16 namespace views { | 16 namespace views { |
17 | 17 |
18 class AcceleratorHandlerGtkTest | 18 class AcceleratorHandlerGtkTest |
19 : public testing::Test, | 19 : public testing::Test, |
20 public WidgetDelegate, | 20 public WidgetDelegate, |
21 public ui::AcceleratorTarget { | 21 public ui::AcceleratorTarget { |
22 public: | 22 public: |
23 AcceleratorHandlerGtkTest() | 23 AcceleratorHandlerGtkTest() |
24 : kMenuAccelerator(ui::VKEY_MENU, false, false, false), | 24 : kMenuAccelerator(ui::VKEY_MENU, false, false, false), |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 // Release Alt - now this should trigger the menu shortcut. | 191 // Release Alt - now this should trigger the menu shortcut. |
192 evt = CreateKeyEvent(GDK_KEY_RELEASE, GDK_Alt_L, 0); | 192 evt = CreateKeyEvent(GDK_KEY_RELEASE, GDK_Alt_L, 0); |
193 evt.hardware_keycode = 0x40; | 193 evt.hardware_keycode = 0x40; |
194 EXPECT_TRUE(handler.Dispatch(reinterpret_cast<GdkEvent*>(&evt))); | 194 EXPECT_TRUE(handler.Dispatch(reinterpret_cast<GdkEvent*>(&evt))); |
195 | 195 |
196 ASSERT_TRUE(menu_pressed_); | 196 ASSERT_TRUE(menu_pressed_); |
197 } | 197 } |
198 | 198 |
199 } // namespace views | 199 } // namespace views |
OLD | NEW |