| 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 "chrome/test/base/render_view_test.h" | 5 #include "chrome/test/base/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/extensions/extension.h" | 8 #include "chrome/common/extensions/extension.h" |
| 9 #include "chrome/common/print_messages.h" | 9 #include "chrome/common/print_messages.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "grit/renderer_resources.h" | 24 #include "grit/renderer_resources.h" |
| 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
| 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h
" | 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h
" |
| 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" | 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" |
| 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" |
| 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 32 #include "webkit/glue/webkit_glue.h" | 32 #include "webkit/glue/webkit_glue.h" |
| 33 | 33 |
| 34 #if defined(OS_LINUX) | 34 #if defined(OS_LINUX) && !defined(USE_AURA) |
| 35 #include "ui/base/gtk/event_synthesis_gtk.h" | 35 #include "ui/base/gtk/event_synthesis_gtk.h" |
| 36 #endif | 36 #endif |
| 37 | 37 |
| 38 using WebKit::WebFrame; | 38 using WebKit::WebFrame; |
| 39 using WebKit::WebInputEvent; | 39 using WebKit::WebInputEvent; |
| 40 using WebKit::WebMouseEvent; | 40 using WebKit::WebMouseEvent; |
| 41 using WebKit::WebScriptController; | 41 using WebKit::WebScriptController; |
| 42 using WebKit::WebScriptSource; | 42 using WebKit::WebScriptSource; |
| 43 using WebKit::WebString; | 43 using WebKit::WebString; |
| 44 using WebKit::WebURLRequest; | 44 using WebKit::WebURLRequest; |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 NativeWebKeyboardEvent keydown_event(NULL, WM_KEYDOWN, key_code, 0); | 210 NativeWebKeyboardEvent keydown_event(NULL, WM_KEYDOWN, key_code, 0); |
| 211 SendNativeKeyEvent(keydown_event); | 211 SendNativeKeyEvent(keydown_event); |
| 212 | 212 |
| 213 NativeWebKeyboardEvent char_event(NULL, WM_CHAR, (*output)[0], 0); | 213 NativeWebKeyboardEvent char_event(NULL, WM_CHAR, (*output)[0], 0); |
| 214 SendNativeKeyEvent(char_event); | 214 SendNativeKeyEvent(char_event); |
| 215 | 215 |
| 216 NativeWebKeyboardEvent keyup_event(NULL, WM_KEYUP, key_code, 0); | 216 NativeWebKeyboardEvent keyup_event(NULL, WM_KEYUP, key_code, 0); |
| 217 SendNativeKeyEvent(keyup_event); | 217 SendNativeKeyEvent(keyup_event); |
| 218 | 218 |
| 219 return length; | 219 return length; |
| 220 #elif defined(OS_LINUX) | 220 #elif defined(OS_LINUX) && !defined(USE_AURA) |
| 221 // We ignore |layout|, which means we are only testing the layout of the | 221 // We ignore |layout|, which means we are only testing the layout of the |
| 222 // current locale. TODO(estade): fix this to respect |layout|. | 222 // current locale. TODO(estade): fix this to respect |layout|. |
| 223 std::vector<GdkEvent*> events; | 223 std::vector<GdkEvent*> events; |
| 224 ui::SynthesizeKeyPressEvents( | 224 ui::SynthesizeKeyPressEvents( |
| 225 NULL, static_cast<ui::KeyboardCode>(key_code), | 225 NULL, static_cast<ui::KeyboardCode>(key_code), |
| 226 modifiers & (MockKeyboard::LEFT_CONTROL | MockKeyboard::RIGHT_CONTROL), | 226 modifiers & (MockKeyboard::LEFT_CONTROL | MockKeyboard::RIGHT_CONTROL), |
| 227 modifiers & (MockKeyboard::LEFT_SHIFT | MockKeyboard::RIGHT_SHIFT), | 227 modifiers & (MockKeyboard::LEFT_SHIFT | MockKeyboard::RIGHT_SHIFT), |
| 228 modifiers & (MockKeyboard::LEFT_ALT | MockKeyboard::RIGHT_ALT), | 228 modifiers & (MockKeyboard::LEFT_ALT | MockKeyboard::RIGHT_ALT), |
| 229 &events); | 229 &events); |
| 230 | 230 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 view_->OnMessageReceived(*input_message); | 326 view_->OnMessageReceived(*input_message); |
| 327 return true; | 327 return true; |
| 328 } | 328 } |
| 329 | 329 |
| 330 void RenderViewTest::ClearHistory() { | 330 void RenderViewTest::ClearHistory() { |
| 331 view_->page_id_ = -1; | 331 view_->page_id_ = -1; |
| 332 view_->history_list_offset_ = -1; | 332 view_->history_list_offset_ = -1; |
| 333 view_->history_list_length_ = 0; | 333 view_->history_list_length_ = 0; |
| 334 view_->history_page_ids_.clear(); | 334 view_->history_page_ids_.clear(); |
| 335 } | 335 } |
| OLD | NEW |