| 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 "content/test/render_view_test.h" | 5 #include "content/test/render_view_test.h" |
| 6 | 6 |
| 7 #include "content/common/dom_storage_common.h" | 7 #include "content/common/dom_storage_common.h" |
| 8 #include "content/common/view_messages.h" | 8 #include "content/common/view_messages.h" |
| 9 #include "content/public/browser/native_web_keyboard_event.h" | 9 #include "content/public/browser/native_web_keyboard_event.h" |
| 10 #include "content/public/common/renderer_preferences.h" | 10 #include "content/public/common/renderer_preferences.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 *output = std::wstring(1, unicode_key); | 223 *output = std::wstring(1, unicode_key); |
| 224 return 1; | 224 return 1; |
| 225 #else | 225 #else |
| 226 NOTIMPLEMENTED(); | 226 NOTIMPLEMENTED(); |
| 227 return L'\0'; | 227 return L'\0'; |
| 228 #endif | 228 #endif |
| 229 } | 229 } |
| 230 | 230 |
| 231 void RenderViewTest::SendNativeKeyEvent( | 231 void RenderViewTest::SendNativeKeyEvent( |
| 232 const NativeWebKeyboardEvent& key_event) { | 232 const NativeWebKeyboardEvent& key_event) { |
| 233 SendWebKeyboardEvent(key_event); |
| 234 } |
| 235 |
| 236 void RenderViewTest::SendWebKeyboardEvent( |
| 237 const WebKit::WebKeyboardEvent& key_event) { |
| 233 scoped_ptr<IPC::Message> input_message(new ViewMsg_HandleInputEvent(0)); | 238 scoped_ptr<IPC::Message> input_message(new ViewMsg_HandleInputEvent(0)); |
| 234 input_message->WriteData(reinterpret_cast<const char*>(&key_event), | 239 input_message->WriteData(reinterpret_cast<const char*>(&key_event), |
| 235 sizeof(WebKit::WebKeyboardEvent)); | 240 sizeof(WebKit::WebKeyboardEvent)); |
| 236 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 241 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
| 237 impl->OnMessageReceived(*input_message); | 242 impl->OnMessageReceived(*input_message); |
| 238 } | 243 } |
| 239 | 244 |
| 240 const char* const kGetCoordinatesScript = | 245 const char* const kGetCoordinatesScript = |
| 241 "(function() {" | 246 "(function() {" |
| 242 " function GetCoordinates(elem) {" | 247 " function GetCoordinates(elem) {" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 341 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
| 337 impl->set_send_content_state_immediately(true); | 342 impl->set_send_content_state_immediately(true); |
| 338 } | 343 } |
| 339 | 344 |
| 340 WebKit::WebWidget* RenderViewTest::GetWebWidget() { | 345 WebKit::WebWidget* RenderViewTest::GetWebWidget() { |
| 341 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 346 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
| 342 return impl->webwidget(); | 347 return impl->webwidget(); |
| 343 } | 348 } |
| 344 | 349 |
| 345 } // namespace content | 350 } // namespace content |
| OLD | NEW |