OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/test/render_view_test.h" | 5 #include "chrome/test/render_view_test.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 7 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
8 #include "chrome/common/dom_storage_common.h" | 8 #include "chrome/common/dom_storage_common.h" |
9 #include "chrome/common/extensions/extension.h" | 9 #include "chrome/common/extensions/extension.h" |
10 #include "chrome/common/native_web_keyboard_event.h" | 10 #include "chrome/common/native_web_keyboard_event.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 199 |
200 NativeWebKeyboardEvent keyup_event(NULL, WM_KEYUP, key_code, 0); | 200 NativeWebKeyboardEvent keyup_event(NULL, WM_KEYUP, key_code, 0); |
201 SendNativeKeyEvent(keyup_event); | 201 SendNativeKeyEvent(keyup_event); |
202 | 202 |
203 return length; | 203 return length; |
204 #elif defined(OS_LINUX) | 204 #elif defined(OS_LINUX) |
205 // We ignore |layout|, which means we are only testing the layout of the | 205 // We ignore |layout|, which means we are only testing the layout of the |
206 // current locale. TODO(estade): fix this to respect |layout|. | 206 // current locale. TODO(estade): fix this to respect |layout|. |
207 std::vector<GdkEvent*> events; | 207 std::vector<GdkEvent*> events; |
208 app::SynthesizeKeyPressEvents( | 208 app::SynthesizeKeyPressEvents( |
209 NULL, static_cast<app::KeyboardCode>(key_code), | 209 NULL, static_cast<ui::KeyboardCode>(key_code), |
210 modifiers & (MockKeyboard::LEFT_CONTROL | MockKeyboard::RIGHT_CONTROL), | 210 modifiers & (MockKeyboard::LEFT_CONTROL | MockKeyboard::RIGHT_CONTROL), |
211 modifiers & (MockKeyboard::LEFT_SHIFT | MockKeyboard::RIGHT_SHIFT), | 211 modifiers & (MockKeyboard::LEFT_SHIFT | MockKeyboard::RIGHT_SHIFT), |
212 modifiers & (MockKeyboard::LEFT_ALT | MockKeyboard::RIGHT_ALT), | 212 modifiers & (MockKeyboard::LEFT_ALT | MockKeyboard::RIGHT_ALT), |
213 &events); | 213 &events); |
214 | 214 |
215 guint32 unicode_key = 0; | 215 guint32 unicode_key = 0; |
216 for (size_t i = 0; i < events.size(); ++i) { | 216 for (size_t i = 0; i < events.size(); ++i) { |
217 // Only send the up/down events for key press itself (skip the up/down | 217 // Only send the up/down events for key press itself (skip the up/down |
218 // events for the modifier keys). | 218 // events for the modifier keys). |
219 if ((i + 1) == (events.size() / 2) || i == (events.size() / 2)) { | 219 if ((i + 1) == (events.size() / 2) || i == (events.size() / 2)) { |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 mouse_event.button = WebMouseEvent::ButtonLeft; | 336 mouse_event.button = WebMouseEvent::ButtonLeft; |
337 mouse_event.x = bounds.CenterPoint().x(); | 337 mouse_event.x = bounds.CenterPoint().x(); |
338 mouse_event.y = bounds.CenterPoint().y(); | 338 mouse_event.y = bounds.CenterPoint().y(); |
339 mouse_event.clickCount = 1; | 339 mouse_event.clickCount = 1; |
340 ViewMsg_HandleInputEvent input_event(0); | 340 ViewMsg_HandleInputEvent input_event(0); |
341 input_event.WriteData(reinterpret_cast<const char*>(&mouse_event), | 341 input_event.WriteData(reinterpret_cast<const char*>(&mouse_event), |
342 sizeof(WebMouseEvent)); | 342 sizeof(WebMouseEvent)); |
343 view_->OnHandleInputEvent(input_event); | 343 view_->OnHandleInputEvent(input_event); |
344 return true; | 344 return true; |
345 } | 345 } |
OLD | NEW |