| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/test_render_view_host.h" | 5 #include "content/browser/renderer_host/test_render_view_host.h" |
| 6 | 6 |
| 7 #include "content/browser/dom_storage/dom_storage_context_impl.h" | 7 #include "content/browser/dom_storage/dom_storage_context_impl.h" |
| 8 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 8 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
| 9 #include "content/browser/renderer_host/test_backing_store.h" | 9 #include "content/browser/renderer_host/test_backing_store.h" |
| 10 #include "content/browser/site_instance_impl.h" | 10 #include "content/browser/site_instance_impl.h" |
| 11 #include "content/common/view_messages.h" | 11 #include "content/common/view_messages.h" |
| 12 #include "content/public/browser/browser_context.h" | 12 #include "content/public/browser/browser_context.h" |
| 13 #include "content/public/browser/navigation_controller.h" | 13 #include "content/public/browser/navigation_controller.h" |
| 14 #include "content/public/browser/storage_partition.h" | 14 #include "content/public/browser/storage_partition.h" |
| 15 #include "content/public/common/content_client.h" | 15 #include "content/public/common/content_client.h" |
| 16 #include "content/public/common/page_state.h" | 16 #include "content/public/common/page_state.h" |
| 17 #include "content/public/common/password_form.h" | |
| 18 #include "content/test/test_web_contents.h" | 17 #include "content/test/test_web_contents.h" |
| 19 #include "media/base/video_frame.h" | 18 #include "media/base/video_frame.h" |
| 20 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
| 21 #include "webkit/common/dom_storage/dom_storage_types.h" | 20 #include "webkit/common/dom_storage/dom_storage_types.h" |
| 22 #include "webkit/common/webpreferences.h" | 21 #include "webkit/common/webpreferences.h" |
| 23 | 22 |
| 24 namespace content { | 23 namespace content { |
| 25 | 24 |
| 26 namespace { | 25 namespace { |
| 27 | 26 |
| 28 const int64 kFrameId = 13UL; | 27 const int64 kFrameId = 13UL; |
| 29 | 28 |
| 30 } // namespace | 29 } // namespace |
| 31 | 30 |
| 32 | 31 |
| 33 void InitNavigateParams(ViewHostMsg_FrameNavigate_Params* params, | 32 void InitNavigateParams(ViewHostMsg_FrameNavigate_Params* params, |
| 34 int page_id, | 33 int page_id, |
| 35 const GURL& url, | 34 const GURL& url, |
| 36 PageTransition transition) { | 35 PageTransition transition) { |
| 37 params->page_id = page_id; | 36 params->page_id = page_id; |
| 38 params->url = url; | 37 params->url = url; |
| 39 params->referrer = Referrer(); | 38 params->referrer = Referrer(); |
| 40 params->transition = transition; | 39 params->transition = transition; |
| 41 params->redirects = std::vector<GURL>(); | 40 params->redirects = std::vector<GURL>(); |
| 42 params->should_update_history = false; | 41 params->should_update_history = false; |
| 43 params->searchable_form_url = GURL(); | 42 params->searchable_form_url = GURL(); |
| 44 params->searchable_form_encoding = std::string(); | 43 params->searchable_form_encoding = std::string(); |
| 45 params->password_form = PasswordForm(); | |
| 46 params->security_info = std::string(); | 44 params->security_info = std::string(); |
| 47 params->gesture = NavigationGestureUser; | 45 params->gesture = NavigationGestureUser; |
| 48 params->was_within_same_page = false; | 46 params->was_within_same_page = false; |
| 49 params->is_post = false; | 47 params->is_post = false; |
| 50 params->page_state = PageState::CreateFromURL(url); | 48 params->page_state = PageState::CreateFromURL(url); |
| 51 } | 49 } |
| 52 | 50 |
| 53 TestRenderWidgetHostView::TestRenderWidgetHostView(RenderWidgetHost* rwh) | 51 TestRenderWidgetHostView::TestRenderWidgetHostView(RenderWidgetHost* rwh) |
| 54 : rwh_(RenderWidgetHostImpl::From(rwh)), | 52 : rwh_(RenderWidgetHostImpl::From(rwh)), |
| 55 is_showing_(false), | 53 is_showing_(false), |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 ViewHostMsg_FrameNavigate_Params params; | 318 ViewHostMsg_FrameNavigate_Params params; |
| 321 params.page_id = page_id; | 319 params.page_id = page_id; |
| 322 params.frame_id = kFrameId; | 320 params.frame_id = kFrameId; |
| 323 params.url = url; | 321 params.url = url; |
| 324 params.referrer = Referrer(); | 322 params.referrer = Referrer(); |
| 325 params.transition = transition; | 323 params.transition = transition; |
| 326 params.redirects = std::vector<GURL>(); | 324 params.redirects = std::vector<GURL>(); |
| 327 params.should_update_history = true; | 325 params.should_update_history = true; |
| 328 params.searchable_form_url = GURL(); | 326 params.searchable_form_url = GURL(); |
| 329 params.searchable_form_encoding = std::string(); | 327 params.searchable_form_encoding = std::string(); |
| 330 params.password_form = PasswordForm(); | |
| 331 params.security_info = std::string(); | 328 params.security_info = std::string(); |
| 332 params.gesture = NavigationGestureUser; | 329 params.gesture = NavigationGestureUser; |
| 333 params.contents_mime_type = contents_mime_type_; | 330 params.contents_mime_type = contents_mime_type_; |
| 334 params.is_post = false; | 331 params.is_post = false; |
| 335 params.was_within_same_page = false; | 332 params.was_within_same_page = false; |
| 336 params.http_status_code = response_code; | 333 params.http_status_code = response_code; |
| 337 params.socket_address.set_host("2001:db8::1"); | 334 params.socket_address.set_host("2001:db8::1"); |
| 338 params.socket_address.set_port(80); | 335 params.socket_address.set_port(80); |
| 339 params.was_fetched_via_proxy = simulate_fetch_via_proxy_; | 336 params.was_fetched_via_proxy = simulate_fetch_via_proxy_; |
| 340 params.history_list_was_cleared = simulate_history_list_was_cleared_; | 337 params.history_list_was_cleared = simulate_history_list_was_cleared_; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 | 410 |
| 414 TestRenderViewHost* RenderViewHostImplTestHarness::active_test_rvh() { | 411 TestRenderViewHost* RenderViewHostImplTestHarness::active_test_rvh() { |
| 415 return static_cast<TestRenderViewHost*>(active_rvh()); | 412 return static_cast<TestRenderViewHost*>(active_rvh()); |
| 416 } | 413 } |
| 417 | 414 |
| 418 TestWebContents* RenderViewHostImplTestHarness::contents() { | 415 TestWebContents* RenderViewHostImplTestHarness::contents() { |
| 419 return static_cast<TestWebContents*>(web_contents()); | 416 return static_cast<TestWebContents*>(web_contents()); |
| 420 } | 417 } |
| 421 | 418 |
| 422 } // namespace content | 419 } // namespace content |
| OLD | NEW |