diff options
author | dfalcantara@chromium.org <dfalcantara@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-04 02:38:23 +0000 |
---|---|---|
committer | dfalcantara@chromium.org <dfalcantara@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-04 02:38:23 +0000 |
commit | 7c16976ce7a48a9cd9715c1ed87696386a743ad6 (patch) | |
tree | 0c6c6bd3f90da70c71ba2f9b23a6ff1719f09339 /content/browser/renderer_host/test_render_view_host.cc | |
parent | 9486104d19c92fd4b91d2cf358800009859f24c6 (diff) | |
download | chromium_src-7c16976ce7a48a9cd9715c1ed87696386a743ad6.zip chromium_src-7c16976ce7a48a9cd9715c1ed87696386a743ad6.tar.gz chromium_src-7c16976ce7a48a9cd9715c1ed87696386a743ad6.tar.bz2 |
[RDS] Reloads a page using the original request URL
When toggling between different versions of a website by changing user agents,
we often need to reload using an earlier URL in a redirect chain to avoid
redirects caused by user-agent detection.
* Adds a new type of reload that hooks into WebFrame::reloadWithOverrideURL,
added in https://bugs.webkit.org/show_bug.cgi?id=89788
* Changes the original request URL we were saving before to be the URL sent
back as part of WebKit's original request. This URL often differs from
the URL stored at the beginning at the redirect chain. It's sent back as
a new field when the renderer navigates.
Part of upstreaming Chrome for Android.
Internal BUG=6272286
BUG=112923
TEST=
Review URL: https://chromiumcodereview.appspot.com/10704048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150003 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/test_render_view_host.cc')
-rw-r--r-- | content/browser/renderer_host/test_render_view_host.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/content/browser/renderer_host/test_render_view_host.cc b/content/browser/renderer_host/test_render_view_host.cc index 12422e9..7545a74 100644 --- a/content/browser/renderer_host/test_render_view_host.cc +++ b/content/browser/renderer_host/test_render_view_host.cc @@ -263,7 +263,19 @@ void TestRenderViewHost::SendNavigate(int page_id, const GURL& url) { void TestRenderViewHost::SendNavigateWithTransition( int page_id, const GURL& url, PageTransition transition) { OnMsgDidStartProvisionalLoadForFrame(0, true, GURL(), url); + SendNavigateWithParameters(page_id, url, transition, url); +} + +void TestRenderViewHost::SendNavigateWithOriginalRequestURL( + int page_id, const GURL& url, const GURL& original_request_url) { + OnMsgDidStartProvisionalLoadForFrame(0, true, GURL(), 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; @@ -286,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); |