| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/renderer_host/input/web_input_event_builders_gtk.h" | 5 #include "content/browser/renderer_host/input/web_input_event_builders_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
| 8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
| 9 | 9 |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "third_party/WebKit/public/web/WebInputEvent.h" | 11 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 12 #include "ui/events/keycodes/keyboard_code_conversion_gtk.h" | 12 #include "ui/events/keycodes/keyboard_code_conversion_gtk.h" |
| 13 | 13 |
| 14 using WebKit::WebInputEvent; | 14 using blink::WebInputEvent; |
| 15 using WebKit::WebKeyboardEvent; | 15 using blink::WebKeyboardEvent; |
| 16 using WebKit::WebMouseEvent; | 16 using blink::WebMouseEvent; |
| 17 using content::WebMouseEventBuilder; | 17 using content::WebMouseEventBuilder; |
| 18 using content::WebKeyboardEventBuilder; | 18 using content::WebKeyboardEventBuilder; |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 TEST(WebMouseEventBuilderTest, DoubleClick) { | 22 TEST(WebMouseEventBuilderTest, DoubleClick) { |
| 23 GdkEventButton first_click; | 23 GdkEventButton first_click; |
| 24 first_click.type = GDK_BUTTON_PRESS; | 24 first_click.type = GDK_BUTTON_PRESS; |
| 25 first_click.window = static_cast<GdkWindow*>(GINT_TO_POINTER(1)); | 25 first_click.window = static_cast<GdkWindow*>(GINT_TO_POINTER(1)); |
| 26 first_click.x = first_click.y = first_click.x_root = first_click.y_root = 100; | 26 first_click.x = first_click.y = first_click.x_root = first_click.y_root = 100; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 gdk_event.type = GDK_KEY_PRESS; | 162 gdk_event.type = GDK_KEY_PRESS; |
| 163 gdk_event.keyval = GDK_KP_5; | 163 gdk_event.keyval = GDK_KP_5; |
| 164 gdk_event.string = five; | 164 gdk_event.string = five; |
| 165 | 165 |
| 166 // Numpad flag should be set on the WebKeyboardEvent. | 166 // Numpad flag should be set on the WebKeyboardEvent. |
| 167 WebKeyboardEvent web_event = WebKeyboardEventBuilder::Build(&gdk_event); | 167 WebKeyboardEvent web_event = WebKeyboardEventBuilder::Build(&gdk_event); |
| 168 EXPECT_TRUE(web_event.modifiers & WebInputEvent::IsKeyPad); | 168 EXPECT_TRUE(web_event.modifiers & WebInputEvent::IsKeyPad); |
| 169 } | 169 } |
| 170 | 170 |
| 171 } // anonymous namespace | 171 } // anonymous namespace |
| OLD | NEW |