| 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/test/test_render_view_host.h" | 5 #include "content/test/test_render_view_host.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 8 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
| 9 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 9 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
| 10 #include "content/browser/site_instance_impl.h" | 10 #include "content/browser/site_instance_impl.h" |
| 11 #include "content/common/dom_storage/dom_storage_types.h" | 11 #include "content/common/dom_storage/dom_storage_types.h" |
| 12 #include "content/common/frame_messages.h" | 12 #include "content/common/frame_messages.h" |
| 13 #include "content/common/view_messages.h" | 13 #include "content/common/view_messages.h" |
| 14 #include "content/public/browser/browser_context.h" | 14 #include "content/public/browser/browser_context.h" |
| 15 #include "content/public/browser/navigation_controller.h" | 15 #include "content/public/browser/navigation_controller.h" |
| 16 #include "content/public/browser/storage_partition.h" | 16 #include "content/public/browser/storage_partition.h" |
| 17 #include "content/public/common/content_client.h" | 17 #include "content/public/common/content_client.h" |
| 18 #include "content/public/common/page_state.h" | 18 #include "content/public/common/page_state.h" |
| 19 #include "content/public/common/web_preferences.h" | 19 #include "content/public/common/web_preferences.h" |
| 20 #include "content/test/test_render_frame_host.h" | 20 #include "content/test/test_render_frame_host.h" |
| 21 #include "content/test/test_web_contents.h" | 21 #include "content/test/test_web_contents.h" |
| 22 #include "media/base/video_frame.h" | 22 #include "media/base/video_frame.h" |
| 23 #include "ui/gfx/rect.h" | 23 #include "ui/gfx/rect.h" |
| 24 | 24 |
| 25 namespace content { | 25 namespace content { |
| 26 | 26 |
| 27 void InitNavigateParams(FrameHostMsg_DidCommitProvisionalLoad_Params* params, | 27 void InitNavigateParams(FrameHostMsg_DidCommitProvisionalLoad_Params* params, |
| 28 int page_id, | 28 int page_id, |
| 29 const GURL& url, | 29 const GURL& url, |
| 30 PageTransition transition) { | 30 ui::PageTransition transition) { |
| 31 params->page_id = page_id; | 31 params->page_id = page_id; |
| 32 params->url = url; | 32 params->url = url; |
| 33 params->referrer = Referrer(); | 33 params->referrer = Referrer(); |
| 34 params->transition = transition; | 34 params->transition = transition; |
| 35 params->redirects = std::vector<GURL>(); | 35 params->redirects = std::vector<GURL>(); |
| 36 params->should_update_history = false; | 36 params->should_update_history = false; |
| 37 params->searchable_form_url = GURL(); | 37 params->searchable_form_url = GURL(); |
| 38 params->searchable_form_encoding = std::string(); | 38 params->searchable_form_encoding = std::string(); |
| 39 params->security_info = std::string(); | 39 params->security_info = std::string(); |
| 40 params->gesture = NavigationGestureUser; | 40 params->gesture = NavigationGestureUser; |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 main_render_frame_host_->SendNavigate(page_id, url); | 265 main_render_frame_host_->SendNavigate(page_id, url); |
| 266 } | 266 } |
| 267 | 267 |
| 268 void TestRenderViewHost::SendFailedNavigate(int page_id, const GURL& url) { | 268 void TestRenderViewHost::SendFailedNavigate(int page_id, const GURL& url) { |
| 269 main_render_frame_host_->SendFailedNavigate(page_id, url); | 269 main_render_frame_host_->SendFailedNavigate(page_id, url); |
| 270 } | 270 } |
| 271 | 271 |
| 272 void TestRenderViewHost::SendNavigateWithTransition( | 272 void TestRenderViewHost::SendNavigateWithTransition( |
| 273 int page_id, | 273 int page_id, |
| 274 const GURL& url, | 274 const GURL& url, |
| 275 PageTransition transition) { | 275 ui::PageTransition transition) { |
| 276 main_render_frame_host_->SendNavigateWithTransition(page_id, url, transition); | 276 main_render_frame_host_->SendNavigateWithTransition(page_id, url, transition); |
| 277 } | 277 } |
| 278 | 278 |
| 279 void TestRenderViewHost::SendNavigateWithOriginalRequestURL( | 279 void TestRenderViewHost::SendNavigateWithOriginalRequestURL( |
| 280 int page_id, | 280 int page_id, |
| 281 const GURL& url, | 281 const GURL& url, |
| 282 const GURL& original_request_url) { | 282 const GURL& original_request_url) { |
| 283 main_render_frame_host_->SendNavigateWithOriginalRequestURL( | 283 main_render_frame_host_->SendNavigateWithOriginalRequestURL( |
| 284 page_id, url, original_request_url); | 284 page_id, url, original_request_url); |
| 285 } | 285 } |
| 286 | 286 |
| 287 void TestRenderViewHost::SendNavigateWithFile( | 287 void TestRenderViewHost::SendNavigateWithFile( |
| 288 int page_id, | 288 int page_id, |
| 289 const GURL& url, | 289 const GURL& url, |
| 290 const base::FilePath& file_path) { | 290 const base::FilePath& file_path) { |
| 291 main_render_frame_host_->SendNavigateWithFile(page_id, url, file_path); | 291 main_render_frame_host_->SendNavigateWithFile(page_id, url, file_path); |
| 292 } | 292 } |
| 293 | 293 |
| 294 void TestRenderViewHost::SendNavigateWithParams( | 294 void TestRenderViewHost::SendNavigateWithParams( |
| 295 FrameHostMsg_DidCommitProvisionalLoad_Params* params) { | 295 FrameHostMsg_DidCommitProvisionalLoad_Params* params) { |
| 296 main_render_frame_host_->SendNavigateWithParams(params); | 296 main_render_frame_host_->SendNavigateWithParams(params); |
| 297 } | 297 } |
| 298 | 298 |
| 299 void TestRenderViewHost::SendNavigateWithTransitionAndResponseCode( | 299 void TestRenderViewHost::SendNavigateWithTransitionAndResponseCode( |
| 300 int page_id, | 300 int page_id, |
| 301 const GURL& url, | 301 const GURL& url, |
| 302 PageTransition transition, | 302 ui::PageTransition transition, |
| 303 int response_code) { | 303 int response_code) { |
| 304 main_render_frame_host_->SendNavigateWithTransitionAndResponseCode( | 304 main_render_frame_host_->SendNavigateWithTransitionAndResponseCode( |
| 305 page_id, url, transition, response_code); | 305 page_id, url, transition, response_code); |
| 306 } | 306 } |
| 307 | 307 |
| 308 void TestRenderViewHost::SendNavigateWithParameters( | 308 void TestRenderViewHost::SendNavigateWithParameters( |
| 309 int page_id, | 309 int page_id, |
| 310 const GURL& url, | 310 const GURL& url, |
| 311 PageTransition transition, | 311 ui::PageTransition transition, |
| 312 const GURL& original_request_url, | 312 const GURL& original_request_url, |
| 313 int response_code, | 313 int response_code, |
| 314 const base::FilePath* file_path_for_history_item) { | 314 const base::FilePath* file_path_for_history_item) { |
| 315 | 315 |
| 316 main_render_frame_host_->SendNavigateWithParameters( | 316 main_render_frame_host_->SendNavigateWithParameters( |
| 317 page_id, url, transition, original_request_url, response_code, | 317 page_id, url, transition, original_request_url, response_code, |
| 318 file_path_for_history_item, std::vector<GURL>()); | 318 file_path_for_history_item, std::vector<GURL>()); |
| 319 } | 319 } |
| 320 | 320 |
| 321 void TestRenderViewHost::SendBeforeUnloadACK(bool proceed) { | 321 void TestRenderViewHost::SendBeforeUnloadACK(bool proceed) { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 | 394 |
| 395 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { | 395 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { |
| 396 return contents()->GetMainFrame(); | 396 return contents()->GetMainFrame(); |
| 397 } | 397 } |
| 398 | 398 |
| 399 TestWebContents* RenderViewHostImplTestHarness::contents() { | 399 TestWebContents* RenderViewHostImplTestHarness::contents() { |
| 400 return static_cast<TestWebContents*>(web_contents()); | 400 return static_cast<TestWebContents*>(web_contents()); |
| 401 } | 401 } |
| 402 | 402 |
| 403 } // namespace content | 403 } // namespace content |
| OLD | NEW |