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

Unified 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, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/web_contents/navigation_controller_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/test_render_view_host.cc
diff --git a/content/browser/renderer_host/test_render_view_host.cc b/content/browser/renderer_host/test_render_view_host.cc
index a3950930f8d81242f4b9fb968b4c6547c4ae43db..0e345298c898976a7fe5ee533c45ed7464962b4f 100644
--- a/content/browser/renderer_host/test_render_view_host.cc
+++ b/content/browser/renderer_host/test_render_view_host.cc
@@ -311,8 +311,12 @@ void TestRenderViewHost::SendNavigateWithFile(
void TestRenderViewHost::SendNavigateWithTransitionAndResponseCode(
int page_id, const GURL& url, PageTransition transition,
int response_code) {
- OnDidStartProvisionalLoadForFrame(kFrameId, -1, true, url);
- SendNavigateWithParameters(page_id, url, transition, url, response_code, 0);
+ // DidStartProvisionalLoad may delete the pending entry that holds |url|,
+ // so we keep a copy of it to use in SendNavigateWithParameters.
+ GURL url_copy(url);
+ OnDidStartProvisionalLoadForFrame(kFrameId, -1, true, url_copy);
+ SendNavigateWithParameters(page_id, url_copy, transition, url_copy,
+ response_code, 0);
}
void TestRenderViewHost::SendNavigateWithParameters(
« 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