Chromium Code Reviews| Index: components/navigation_interception/intercept_navigation_resource_throttle_unittest.cc |
| diff --git a/components/navigation_interception/intercept_navigation_resource_throttle_unittest.cc b/components/navigation_interception/intercept_navigation_resource_throttle_unittest.cc |
| index bb1e26aefe0ab0d36d7bee52b614d20f0449f6a5..02a90611223ed56b66768c01139fd771bcec5b17 100644 |
| --- a/components/navigation_interception/intercept_navigation_resource_throttle_unittest.cc |
| +++ b/components/navigation_interception/intercept_navigation_resource_throttle_unittest.cc |
| @@ -25,6 +25,7 @@ |
| #include "net/base/request_priority.h" |
| #include "net/http/http_response_headers.h" |
| #include "net/http/http_response_info.h" |
| +#include "net/url_request/redirect_info.h" |
| #include "net/url_request/url_request.h" |
| #include "net/url_request/url_request_test_util.h" |
| #include "testing/gmock/include/gmock/gmock.h" |
| @@ -154,9 +155,14 @@ class TestIOThreadState { |
| throttle_->WillStartRequest(defer); |
| } |
| - void ThrottleWillRedirectRequest(const GURL& new_url, bool* defer) { |
| + void ThrottleWillRedirectRequest(const GURL& new_url, |
| + const std::string& new_method, |
| + bool* defer) { |
| DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
| - throttle_->WillRedirectRequest(new_url, defer); |
| + net::RedirectInfo redirect_info; |
| + redirect_info.new_url = new_url; |
| + redirect_info.new_method = new_method; |
|
davidben
2015/02/05 20:44:06
Nit: Maybe assemble the net::RedirectInfo in the c
mmenke
2015/02/05 21:20:53
Done.
|
| + throttle_->WillRedirectRequest(redirect_info, defer); |
| } |
| bool request_resumed() const { |
| @@ -218,10 +224,12 @@ class InterceptNavigationResourceThrottleTest |
| SetIOThreadState(io_thread_state); |
| - if (redirect_mode == REDIRECT_MODE_NO_REDIRECT) |
| + if (redirect_mode == REDIRECT_MODE_NO_REDIRECT) { |
| io_thread_state->ThrottleWillStartRequest(defer); |
| - else |
| - io_thread_state->ThrottleWillRedirectRequest(url, defer); |
| + } else { |
| + // 302 redirects convert POSTs to gets. |
| + io_thread_state->ThrottleWillRedirectRequest(url, "GET", defer); |
| + } |
| } |
| protected: |