Chromium Code Reviews| Index: content/browser/loader/test_url_loader_client.h |
| diff --git a/content/browser/loader/test_url_loader_client.h b/content/browser/loader/test_url_loader_client.h |
| index 31790781f9c94a3a3962f18c9c7532ca810a5e91..9e18742e18ac66b67414afd311e54a94917ef76d 100644 |
| --- a/content/browser/loader/test_url_loader_client.h |
| +++ b/content/browser/loader/test_url_loader_client.h |
| @@ -15,6 +15,7 @@ |
| #include "content/public/common/resource_response.h" |
| #include "mojo/public/c/system/data_pipe.h" |
| #include "mojo/public/cpp/bindings/associated_binding.h" |
| +#include "net/url_request/redirect_info.h" |
| namespace content { |
| @@ -28,15 +29,19 @@ class TestURLLoaderClient final : public mojom::URLLoaderClient { |
| ~TestURLLoaderClient() override; |
| void OnReceiveResponse(const ResourceResponseHead& response_head) override; |
| + void OnReceiveRedirect(const net::RedirectInfo& redirect_info, |
| + const ResourceResponseHead& response_head) override; |
| void OnDataDownloaded(int64_t data_length, int64_t encoded_length) override; |
| void OnStartLoadingResponseBody( |
| mojo::ScopedDataPipeConsumerHandle body) override; |
| void OnComplete(const ResourceRequestCompletionStatus& status) override; |
| bool has_received_response() const { return has_received_response_; } |
| + bool has_received_redirect() const { return has_received_redirect_; } |
|
mmenke
2016/11/10 21:42:41
Can we count the number of redirects or something,
yhirano
2016/11/11 09:47:04
I added EXPECT_FALSE(has_received_redirect_) in th
|
| bool has_data_downloaded() const { return has_data_downloaded_; } |
| bool has_received_completion() const { return has_received_completion_; } |
| const ResourceResponseHead& response_head() const { return response_head_; } |
| + const net::RedirectInfo& redirect_info() const { return redirect_info_; } |
| mojo::DataPipeConsumerHandle response_body() { return response_body_.get(); } |
| const ResourceRequestCompletionStatus& completion_status() const { |
| return completion_status_; |
| @@ -55,6 +60,7 @@ class TestURLLoaderClient final : public mojom::URLLoaderClient { |
| void Unbind(); |
| void RunUntilResponseReceived(); |
| + void RunUntilRedirectReceived(); |
| void RunUntilDataDownloaded(); |
| void RunUntilResponseBodyArrived(); |
| void RunUntilComplete(); |
| @@ -62,12 +68,15 @@ class TestURLLoaderClient final : public mojom::URLLoaderClient { |
| private: |
| mojo::AssociatedBinding<mojom::URLLoaderClient> binding_; |
| ResourceResponseHead response_head_; |
| + net::RedirectInfo redirect_info_; |
| mojo::ScopedDataPipeConsumerHandle response_body_; |
| ResourceRequestCompletionStatus completion_status_; |
| bool has_received_response_ = false; |
| + bool has_received_redirect_ = false; |
| bool has_data_downloaded_ = false; |
| bool has_received_completion_ = false; |
| - base::Closure quit_closure_for_on_received_response_; |
| + base::Closure quit_closure_for_on_receive_response_; |
| + base::Closure quit_closure_for_on_receive_redirect_; |
| base::Closure quit_closure_for_on_data_downloaded_; |
| base::Closure quit_closure_for_on_start_loading_response_body_; |
| base::Closure quit_closure_for_on_complete_; |