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" |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 | 304 |
305 void TestRenderViewHost::SendNavigateWithFile( | 305 void TestRenderViewHost::SendNavigateWithFile( |
306 int page_id, const GURL& url, const base::FilePath& file_path) { | 306 int page_id, const GURL& url, const base::FilePath& file_path) { |
307 SendNavigateWithParameters(page_id, url, PAGE_TRANSITION_LINK, | 307 SendNavigateWithParameters(page_id, url, PAGE_TRANSITION_LINK, |
308 url, 200, &file_path); | 308 url, 200, &file_path); |
309 } | 309 } |
310 | 310 |
311 void TestRenderViewHost::SendNavigateWithTransitionAndResponseCode( | 311 void TestRenderViewHost::SendNavigateWithTransitionAndResponseCode( |
312 int page_id, const GURL& url, PageTransition transition, | 312 int page_id, const GURL& url, PageTransition transition, |
313 int response_code) { | 313 int response_code) { |
314 // DidStartProvisionalLoad may delete the pending entry that holds |url|, | 314 OnDidStartProvisionalLoadForFrame(kFrameId, -1, true, url); |
315 // so we keep a copy of it to use in SendNavigateWithParameters. | 315 SendNavigateWithParameters(page_id, url, transition, url, response_code, 0); |
316 GURL url_copy(url); | |
317 OnDidStartProvisionalLoadForFrame(kFrameId, -1, true, url_copy); | |
318 SendNavigateWithParameters(page_id, url_copy, transition, url_copy, | |
319 response_code, 0); | |
320 } | 316 } |
321 | 317 |
322 void TestRenderViewHost::SendNavigateWithParameters( | 318 void TestRenderViewHost::SendNavigateWithParameters( |
323 int page_id, const GURL& url, PageTransition transition, | 319 int page_id, const GURL& url, PageTransition transition, |
324 const GURL& original_request_url, int response_code, | 320 const GURL& original_request_url, int response_code, |
325 const base::FilePath* file_path_for_history_item) { | 321 const base::FilePath* file_path_for_history_item) { |
326 ViewHostMsg_FrameNavigate_Params params; | 322 ViewHostMsg_FrameNavigate_Params params; |
327 params.page_id = page_id; | 323 params.page_id = page_id; |
328 params.frame_id = kFrameId; | 324 params.frame_id = kFrameId; |
329 params.url = url; | 325 params.url = url; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 | 415 |
420 TestRenderViewHost* RenderViewHostImplTestHarness::active_test_rvh() { | 416 TestRenderViewHost* RenderViewHostImplTestHarness::active_test_rvh() { |
421 return static_cast<TestRenderViewHost*>(active_rvh()); | 417 return static_cast<TestRenderViewHost*>(active_rvh()); |
422 } | 418 } |
423 | 419 |
424 TestWebContents* RenderViewHostImplTestHarness::contents() { | 420 TestWebContents* RenderViewHostImplTestHarness::contents() { |
425 return static_cast<TestWebContents*>(web_contents()); | 421 return static_cast<TestWebContents*>(web_contents()); |
426 } | 422 } |
427 | 423 |
428 } // namespace content | 424 } // namespace content |
OLD | NEW |