Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: content/browser/renderer_host/test_render_view_host.cc

Issue 21913003: Ensure that renderer-initiated pending entries can be replaced when a new (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Avoid memory error when replacing pending entry. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/web_contents/navigation_controller_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 OnDidStartProvisionalLoadForFrame(kFrameId, -1, true, url); 314 // DidStartProvisionalLoad may delete the pending entry that holds |url|,
315 SendNavigateWithParameters(page_id, url, transition, url, response_code, 0); 315 // so we keep a copy of it to use in SendNavigateWithParameters.
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);
316 } 320 }
317 321
318 void TestRenderViewHost::SendNavigateWithParameters( 322 void TestRenderViewHost::SendNavigateWithParameters(
319 int page_id, const GURL& url, PageTransition transition, 323 int page_id, const GURL& url, PageTransition transition,
320 const GURL& original_request_url, int response_code, 324 const GURL& original_request_url, int response_code,
321 const base::FilePath* file_path_for_history_item) { 325 const base::FilePath* file_path_for_history_item) {
322 ViewHostMsg_FrameNavigate_Params params; 326 ViewHostMsg_FrameNavigate_Params params;
323 params.page_id = page_id; 327 params.page_id = page_id;
324 params.frame_id = kFrameId; 328 params.frame_id = kFrameId;
325 params.url = url; 329 params.url = url;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 419
416 TestRenderViewHost* RenderViewHostImplTestHarness::active_test_rvh() { 420 TestRenderViewHost* RenderViewHostImplTestHarness::active_test_rvh() {
417 return static_cast<TestRenderViewHost*>(active_rvh()); 421 return static_cast<TestRenderViewHost*>(active_rvh());
418 } 422 }
419 423
420 TestWebContents* RenderViewHostImplTestHarness::contents() { 424 TestWebContents* RenderViewHostImplTestHarness::contents() {
421 return static_cast<TestWebContents*>(web_contents()); 425 return static_cast<TestWebContents*>(web_contents());
422 } 426 }
423 427
424 } // namespace content 428 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/web_contents/navigation_controller_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698