| 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" |
| 11 #include "chrome/common/render_messages.h" | 11 #include "chrome/common/render_messages.h" |
| 12 #include "chrome/common/render_messages_params.h" | 12 #include "chrome/common/render_messages_params.h" |
| 13 #include "chrome/common/renderer_preferences.h" | 13 #include "chrome/common/renderer_preferences.h" |
| 14 #include "chrome/renderer/autofill_helper.h" | 14 #include "chrome/renderer/autofill/autofill_agent.h" |
| 15 #include "chrome/renderer/autofill/password_autofill_manager.h" |
| 15 #include "chrome/renderer/extensions/event_bindings.h" | 16 #include "chrome/renderer/extensions/event_bindings.h" |
| 16 #include "chrome/renderer/extensions/extension_process_bindings.h" | 17 #include "chrome/renderer/extensions/extension_process_bindings.h" |
| 17 #include "chrome/renderer/extensions/js_only_v8_extensions.h" | 18 #include "chrome/renderer/extensions/js_only_v8_extensions.h" |
| 18 #include "chrome/renderer/extensions/renderer_extension_bindings.h" | 19 #include "chrome/renderer/extensions/renderer_extension_bindings.h" |
| 19 #include "chrome/renderer/mock_render_process.h" | 20 #include "chrome/renderer/mock_render_process.h" |
| 20 #include "chrome/renderer/password_autocomplete_manager.h" | |
| 21 #include "chrome/renderer/renderer_main_platform_delegate.h" | 21 #include "chrome/renderer/renderer_main_platform_delegate.h" |
| 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
| 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h
" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h
" |
| 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" |
| 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" |
| 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 29 #include "webkit/glue/webkit_glue.h" | 29 #include "webkit/glue/webkit_glue.h" |
| 30 | 30 |
| 31 #if defined(OS_LINUX) | 31 #if defined(OS_LINUX) |
| 32 #include "ui/base/gtk/event_synthesis_gtk.h" | 32 #include "ui/base/gtk/event_synthesis_gtk.h" |
| 33 #endif | 33 #endif |
| 34 | 34 |
| 35 using WebKit::WebFrame; | 35 using WebKit::WebFrame; |
| 36 using WebKit::WebInputEvent; | 36 using WebKit::WebInputEvent; |
| 37 using WebKit::WebMouseEvent; | 37 using WebKit::WebMouseEvent; |
| 38 using WebKit::WebScriptController; | 38 using WebKit::WebScriptController; |
| 39 using WebKit::WebScriptSource; | 39 using WebKit::WebScriptSource; |
| 40 using WebKit::WebString; | 40 using WebKit::WebString; |
| 41 using WebKit::WebURLRequest; | 41 using WebKit::WebURLRequest; |
| 42 using autofill::AutoFillAgent; |
| 43 using autofill::PasswordAutoFillManager; |
| 42 | 44 |
| 43 namespace { | 45 namespace { |
| 44 const int32 kRouteId = 5; | 46 const int32 kRouteId = 5; |
| 45 const int32 kOpenerId = 7; | 47 const int32 kOpenerId = 7; |
| 46 } // namespace | 48 } // namespace |
| 47 | 49 |
| 48 RenderViewTest::RenderViewTest() { | 50 RenderViewTest::RenderViewTest() { |
| 49 } | 51 } |
| 50 | 52 |
| 51 RenderViewTest::~RenderViewTest() { | 53 RenderViewTest::~RenderViewTest() { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 RendererPreferences(), | 133 RendererPreferences(), |
| 132 WebPreferences(), | 134 WebPreferences(), |
| 133 new SharedRenderViewCounter(0), | 135 new SharedRenderViewCounter(0), |
| 134 kRouteId, | 136 kRouteId, |
| 135 kInvalidSessionStorageNamespaceId, | 137 kInvalidSessionStorageNamespaceId, |
| 136 string16()); | 138 string16()); |
| 137 | 139 |
| 138 // Attach a pseudo keyboard device to this object. | 140 // Attach a pseudo keyboard device to this object. |
| 139 mock_keyboard_.reset(new MockKeyboard()); | 141 mock_keyboard_.reset(new MockKeyboard()); |
| 140 | 142 |
| 141 // RenderView doesn't expose it's PasswordAutocompleteManager or | 143 // RenderView doesn't expose it's PasswordAutoFillManager or |
| 142 // AutoFillHelper objects, because it has no need to store them directly | 144 // AutoFillHelper objects, because it has no need to store them directly |
| 143 // (they're stored as RenderViewObserver*). So just create another set. | 145 // (they're stored as RenderViewObserver*). So just create another set. |
| 144 password_autocomplete_ = new PasswordAutocompleteManager(view_); | 146 password_autofill_ = new PasswordAutoFillManager(view_); |
| 145 autofill_helper_ = new AutoFillHelper(view_, password_autocomplete_); | 147 autofill_agent_ = new AutoFillAgent(view_, password_autofill_); |
| 146 } | 148 } |
| 147 | 149 |
| 148 void RenderViewTest::TearDown() { | 150 void RenderViewTest::TearDown() { |
| 149 // Try very hard to collect garbage before shutting down. | 151 // Try very hard to collect garbage before shutting down. |
| 150 GetMainFrame()->collectGarbage(); | 152 GetMainFrame()->collectGarbage(); |
| 151 GetMainFrame()->collectGarbage(); | 153 GetMainFrame()->collectGarbage(); |
| 152 | 154 |
| 153 render_thread_.SendCloseMessage(); | 155 render_thread_.SendCloseMessage(); |
| 154 | 156 |
| 155 // Run the loop so the release task from the renderwidget executes. | 157 // Run the loop so the release task from the renderwidget executes. |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 mouse_event.x = bounds.CenterPoint().x(); | 347 mouse_event.x = bounds.CenterPoint().x(); |
| 346 mouse_event.y = bounds.CenterPoint().y(); | 348 mouse_event.y = bounds.CenterPoint().y(); |
| 347 mouse_event.clickCount = 1; | 349 mouse_event.clickCount = 1; |
| 348 ViewMsg_HandleInputEvent input_event(0); | 350 ViewMsg_HandleInputEvent input_event(0); |
| 349 scoped_ptr<IPC::Message> input_message(new ViewMsg_HandleInputEvent(0)); | 351 scoped_ptr<IPC::Message> input_message(new ViewMsg_HandleInputEvent(0)); |
| 350 input_message->WriteData(reinterpret_cast<const char*>(&mouse_event), | 352 input_message->WriteData(reinterpret_cast<const char*>(&mouse_event), |
| 351 sizeof(WebMouseEvent)); | 353 sizeof(WebMouseEvent)); |
| 352 view_->OnMessageReceived(*input_message); | 354 view_->OnMessageReceived(*input_message); |
| 353 return true; | 355 return true; |
| 354 } | 356 } |
| OLD | NEW |