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

Unified Diff: content/browser/renderer_host/test_render_view_host.cc

Issue 10704048: [RDS] Reloads a page using the original request URL (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Adding unit test & removing public function Created 8 years, 6 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
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 b9bdccf4c1ba963b0b46b7dcda6d1d02ba4afbdb..b92c24d496e24e65de495f34a81439ea968e0252 100644
--- a/content/browser/renderer_host/test_render_view_host.cc
+++ b/content/browser/renderer_host/test_render_view_host.cc
@@ -221,7 +221,8 @@ TestRenderViewHost::TestRenderViewHost(
render_view_created_(false),
delete_counter_(NULL),
simulate_fetch_via_proxy_(false),
- contents_mime_type_("text/html") {
+ contents_mime_type_("text/html"),
+ last_params_(new ViewMsg_Navigate_Params) {
// For normal RenderViewHosts, this is freed when |Shutdown()| is
// called. For TestRenderViewHost, the view is explicitly
// deleted in the destructor below, because
@@ -235,6 +236,7 @@ TestRenderViewHost::~TestRenderViewHost() {
// Since this isn't a traditional view, we have to delete it.
delete GetView();
+ delete last_params_;
}
bool TestRenderViewHost::CreateRenderView(
@@ -252,12 +254,29 @@ bool TestRenderViewHost::IsRenderViewLive() const {
return render_view_created_;
}
+void TestRenderViewHost::Navigate(const ViewMsg_Navigate_Params& params) {
+ *last_params_ = params;
jam 2012/07/03 05:50:12 i think there's a simpler way to get the url inste
gone 2012/07/03 18:24:39 Done.
+ RenderViewHostImpl::Navigate(params);
+}
+
void TestRenderViewHost::SendNavigate(int page_id, const GURL& url) {
SendNavigateWithTransition(page_id, url, PAGE_TRANSITION_LINK);
}
void TestRenderViewHost::SendNavigateWithTransition(
int page_id, const GURL& url, PageTransition transition) {
+ SendNavigateWithParameters(page_id, url, transition, url);
+}
+
+void TestRenderViewHost::SendNavigateWithOriginalRequestURL(
+ int page_id, const GURL& url, const GURL& original_request_url) {
+ SendNavigateWithParameters(page_id, url, PAGE_TRANSITION_LINK,
+ original_request_url);
+}
+
+void TestRenderViewHost::SendNavigateWithParameters(
+ int page_id, const GURL& url, PageTransition transition,
+ const GURL& original_request_url) {
ViewHostMsg_FrameNavigate_Params params;
params.page_id = page_id;
@@ -279,6 +298,7 @@ void TestRenderViewHost::SendNavigateWithTransition(
params.socket_address.set_port(80);
params.was_fetched_via_proxy = simulate_fetch_via_proxy_;
params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url));
+ params.original_request_url = original_request_url;
ViewHostMsg_FrameNavigate msg(1, params);
OnMsgNavigate(msg);

Powered by Google App Engine
This is Rietveld 408576698