diff options
author | davidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-15 20:49:59 +0000 |
---|---|---|
committer | davidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-15 20:51:41 +0000 |
commit | cba246463b2bda73877fc53da6d7eff97448d93d (patch) | |
tree | c8a77dfaff426ea06667b3714e4af2d9ed3b7d94 /content/child/resource_dispatcher_unittest.cc | |
parent | 7d0a0cac7c1233e6beeaf7ca8092f89f81e950ef (diff) | |
download | chromium_src-cba246463b2bda73877fc53da6d7eff97448d93d.zip chromium_src-cba246463b2bda73877fc53da6d7eff97448d93d.tar.gz chromium_src-cba246463b2bda73877fc53da6d7eff97448d93d.tar.bz2 |
Plumb redirect info out of net, through content, and into child processes.
This saves the logic in PluginURLFetcher and WebURLLoader that has to replicate
the method-munging, referrer-munging, and first-party-URL-munging logic that is
already done in net/.
BUG=384609
Review URL: https://codereview.chromium.org/398903002
Cr-Commit-Position: refs/heads/master@{#290005}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290005 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/child/resource_dispatcher_unittest.cc')
-rw-r--r-- | content/child/resource_dispatcher_unittest.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/content/child/resource_dispatcher_unittest.cc b/content/child/resource_dispatcher_unittest.cc index 4e95428..d878e37 100644 --- a/content/child/resource_dispatcher_unittest.cc +++ b/content/child/resource_dispatcher_unittest.cc @@ -59,8 +59,7 @@ class TestRequestPeer : public RequestPeer { virtual void OnUploadProgress(uint64 position, uint64 size) OVERRIDE { } - virtual bool OnReceivedRedirect(const GURL& new_url, - const GURL& new_first_party_for_cookies, + virtual bool OnReceivedRedirect(const net::RedirectInfo& redirect_info, const ResourceResponseInfo& info) OVERRIDE { ++seen_redirects_; if (defer_on_redirect_) @@ -252,9 +251,13 @@ class ResourceDispatcherTest : public testing::Test, public IPC::Sender { std::replace(raw_headers.begin(), raw_headers.end(), '\n', '\0'); head.headers = new net::HttpResponseHeaders(raw_headers); head.error_code = net::OK; + net::RedirectInfo redirect_info; + redirect_info.status_code = 302; + redirect_info.new_method = "GET"; + redirect_info.new_url = GURL(kTestPageUrl); + redirect_info.new_first_party_for_cookies = GURL(kTestPageUrl); EXPECT_EQ(true, dispatcher_.OnMessageReceived( - ResourceMsg_ReceivedRedirect(request_id, GURL(kTestPageUrl), - GURL(kTestPageUrl), head))); + ResourceMsg_ReceivedRedirect(request_id, redirect_info, head))); } void NotifyReceivedResponse(int request_id) { @@ -722,8 +725,7 @@ class TimeConversionTest : public ResourceDispatcherTest, virtual void OnUploadProgress(uint64 position, uint64 size) OVERRIDE { } - virtual bool OnReceivedRedirect(const GURL& new_url, - const GURL& new_first_party_for_cookies, + virtual bool OnReceivedRedirect(const net::RedirectInfo& redirect_info, const ResourceResponseInfo& info) OVERRIDE { return true; } |