| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "net/http/http_network_layer.h" | 34 #include "net/http/http_network_layer.h" |
| 35 #include "net/proxy/proxy_service.h" | 35 #include "net/proxy/proxy_service.h" |
| 36 #include "net/url_request/url_request.h" | 36 #include "net/url_request/url_request.h" |
| 37 #include "net/url_request/url_request_context.h" | 37 #include "net/url_request/url_request_context.h" |
| 38 #include "net/url_request/url_request_context_getter.h" | 38 #include "net/url_request/url_request_context_getter.h" |
| 39 #include "net/url_request/url_request_context_storage.h" | 39 #include "net/url_request/url_request_context_storage.h" |
| 40 #include "net/url_request/url_request_job_factory.h" | 40 #include "net/url_request/url_request_job_factory.h" |
| 41 | 41 |
| 42 using base::TimeDelta; | 42 using base::TimeDelta; |
| 43 | 43 |
| 44 namespace net { | |
| 45 | |
| 46 //----------------------------------------------------------------------------- | 44 //----------------------------------------------------------------------------- |
| 47 | 45 |
| 48 class TestURLRequestContext : public URLRequestContext { | 46 class TestURLRequestContext : public net::URLRequestContext { |
| 49 public: | 47 public: |
| 50 TestURLRequestContext(); | 48 TestURLRequestContext(); |
| 51 // Default constructor like TestURLRequestContext() but does not call | 49 // Default constructor like TestURLRequestContext() but does not call |
| 52 // Init() in case |delay_initialization| is true. This allows modifying the | 50 // Init() in case |delay_initialization| is true. This allows modifying the |
| 53 // URLRequestContext before it is constructed completely. If | 51 // URLRequestContext before it is constructed completely. If |
| 54 // |delay_initialization| is true, Init() needs be be called manually. | 52 // |delay_initialization| is true, Init() needs be be called manually. |
| 55 explicit TestURLRequestContext(bool delay_initialization); | 53 explicit TestURLRequestContext(bool delay_initialization); |
| 56 virtual ~TestURLRequestContext(); | 54 virtual ~TestURLRequestContext(); |
| 57 | 55 |
| 58 void Init(); | 56 void Init(); |
| 59 | 57 |
| 60 private: | 58 private: |
| 61 bool initialized_; | 59 bool initialized_; |
| 62 | 60 |
| 63 protected: | 61 protected: |
| 64 URLRequestContextStorage context_storage_; | 62 net::URLRequestContextStorage context_storage_; |
| 65 }; | 63 }; |
| 66 | 64 |
| 67 //----------------------------------------------------------------------------- | 65 //----------------------------------------------------------------------------- |
| 68 | 66 |
| 69 // Used to return a dummy context, which lives on the message loop | 67 // Used to return a dummy context, which lives on the message loop |
| 70 // given in the constructor. | 68 // given in the constructor. |
| 71 class TestURLRequestContextGetter : public URLRequestContextGetter { | 69 class TestURLRequestContextGetter : public net::URLRequestContextGetter { |
| 72 public: | 70 public: |
| 73 // |network_task_runner| must not be NULL. | 71 // |network_task_runner| must not be NULL. |
| 74 explicit TestURLRequestContextGetter( | 72 explicit TestURLRequestContextGetter( |
| 75 const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner); | 73 const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner); |
| 76 | 74 |
| 77 // Use to pass a pre-initialized |context|. | 75 // Use to pass a pre-initialized |context|. |
| 78 TestURLRequestContextGetter( | 76 TestURLRequestContextGetter( |
| 79 const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner, | 77 const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner, |
| 80 scoped_ptr<TestURLRequestContext> context); | 78 scoped_ptr<TestURLRequestContext> context); |
| 81 | 79 |
| 82 // URLRequestContextGetter implementation. | 80 // net::URLRequestContextGetter implementation. |
| 83 virtual TestURLRequestContext* GetURLRequestContext() OVERRIDE; | 81 virtual TestURLRequestContext* GetURLRequestContext() OVERRIDE; |
| 84 virtual scoped_refptr<base::SingleThreadTaskRunner> | 82 virtual scoped_refptr<base::SingleThreadTaskRunner> |
| 85 GetNetworkTaskRunner() const OVERRIDE; | 83 GetNetworkTaskRunner() const OVERRIDE; |
| 86 | 84 |
| 87 protected: | 85 protected: |
| 88 virtual ~TestURLRequestContextGetter(); | 86 virtual ~TestURLRequestContextGetter(); |
| 89 | 87 |
| 90 private: | 88 private: |
| 91 const scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; | 89 const scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; |
| 92 scoped_ptr<TestURLRequestContext> context_; | 90 scoped_ptr<TestURLRequestContext> context_; |
| 93 }; | 91 }; |
| 94 | 92 |
| 95 //----------------------------------------------------------------------------- | 93 //----------------------------------------------------------------------------- |
| 96 | 94 |
| 97 class TestURLRequest : public URLRequest { | 95 class TestURLRequest : public net::URLRequest { |
| 98 public: | 96 public: |
| 99 TestURLRequest( | 97 TestURLRequest( |
| 100 const GURL& url, Delegate* delegate, TestURLRequestContext* context); | 98 const GURL& url, Delegate* delegate, TestURLRequestContext* context); |
| 101 virtual ~TestURLRequest(); | 99 virtual ~TestURLRequest(); |
| 102 }; | 100 }; |
| 103 | 101 |
| 104 //----------------------------------------------------------------------------- | 102 //----------------------------------------------------------------------------- |
| 105 | 103 |
| 106 class TestDelegate : public URLRequest::Delegate { | 104 class TestDelegate : public net::URLRequest::Delegate { |
| 107 public: | 105 public: |
| 108 TestDelegate(); | 106 TestDelegate(); |
| 109 virtual ~TestDelegate(); | 107 virtual ~TestDelegate(); |
| 110 | 108 |
| 111 void set_cancel_in_received_redirect(bool val) { cancel_in_rr_ = val; } | 109 void set_cancel_in_received_redirect(bool val) { cancel_in_rr_ = val; } |
| 112 void set_cancel_in_response_started(bool val) { cancel_in_rs_ = val; } | 110 void set_cancel_in_response_started(bool val) { cancel_in_rs_ = val; } |
| 113 void set_cancel_in_received_data(bool val) { cancel_in_rd_ = val; } | 111 void set_cancel_in_received_data(bool val) { cancel_in_rd_ = val; } |
| 114 void set_cancel_in_received_data_pending(bool val) { | 112 void set_cancel_in_received_data_pending(bool val) { |
| 115 cancel_in_rd_pending_ = val; | 113 cancel_in_rd_pending_ = val; |
| 116 } | 114 } |
| 117 void set_quit_on_complete(bool val) { quit_on_complete_ = val; } | 115 void set_quit_on_complete(bool val) { quit_on_complete_ = val; } |
| 118 void set_quit_on_redirect(bool val) { quit_on_redirect_ = val; } | 116 void set_quit_on_redirect(bool val) { quit_on_redirect_ = val; } |
| 119 void set_allow_certificate_errors(bool val) { | 117 void set_allow_certificate_errors(bool val) { |
| 120 allow_certificate_errors_ = val; | 118 allow_certificate_errors_ = val; |
| 121 } | 119 } |
| 122 void set_credentials(const AuthCredentials& credentials) { | 120 void set_credentials(const net::AuthCredentials& credentials) { |
| 123 credentials_ = credentials; | 121 credentials_ = credentials; |
| 124 } | 122 } |
| 125 | 123 |
| 126 // query state | 124 // query state |
| 127 const std::string& data_received() const { return data_received_; } | 125 const std::string& data_received() const { return data_received_; } |
| 128 int bytes_received() const { return static_cast<int>(data_received_.size()); } | 126 int bytes_received() const { return static_cast<int>(data_received_.size()); } |
| 129 int response_started_count() const { return response_started_count_; } | 127 int response_started_count() const { return response_started_count_; } |
| 130 int received_redirect_count() const { return received_redirect_count_; } | 128 int received_redirect_count() const { return received_redirect_count_; } |
| 131 bool received_data_before_response() const { | 129 bool received_data_before_response() const { |
| 132 return received_data_before_response_; | 130 return received_data_before_response_; |
| 133 } | 131 } |
| 134 bool request_failed() const { return request_failed_; } | 132 bool request_failed() const { return request_failed_; } |
| 135 bool have_certificate_errors() const { return have_certificate_errors_; } | 133 bool have_certificate_errors() const { return have_certificate_errors_; } |
| 136 bool certificate_errors_are_fatal() const { | 134 bool certificate_errors_are_fatal() const { |
| 137 return certificate_errors_are_fatal_; | 135 return certificate_errors_are_fatal_; |
| 138 } | 136 } |
| 139 bool auth_required_called() const { return auth_required_; } | 137 bool auth_required_called() const { return auth_required_; } |
| 140 | 138 |
| 141 // URLRequest::Delegate: | 139 // net::URLRequest::Delegate: |
| 142 virtual void OnReceivedRedirect(URLRequest* request, const GURL& new_url, | 140 virtual void OnReceivedRedirect(net::URLRequest* request, const GURL& new_url, |
| 143 bool* defer_redirect) OVERRIDE; | 141 bool* defer_redirect) OVERRIDE; |
| 144 virtual void OnAuthRequired(URLRequest* request, | 142 virtual void OnAuthRequired(net::URLRequest* request, |
| 145 AuthChallengeInfo* auth_info) OVERRIDE; | 143 net::AuthChallengeInfo* auth_info) OVERRIDE; |
| 146 // NOTE: |fatal| causes |certificate_errors_are_fatal_| to be set to true. | 144 // NOTE: |fatal| causes |certificate_errors_are_fatal_| to be set to true. |
| 147 // (Unit tests use this as a post-condition.) But for policy, this method | 145 // (Unit tests use this as a post-condition.) But for policy, this method |
| 148 // consults |allow_certificate_errors_|. | 146 // consults |allow_certificate_errors_|. |
| 149 virtual void OnSSLCertificateError(URLRequest* request, | 147 virtual void OnSSLCertificateError(net::URLRequest* request, |
| 150 const SSLInfo& ssl_info, | 148 const net::SSLInfo& ssl_info, |
| 151 bool fatal) OVERRIDE; | 149 bool fatal) OVERRIDE; |
| 152 virtual void OnResponseStarted(URLRequest* request) OVERRIDE; | 150 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; |
| 153 virtual void OnReadCompleted(URLRequest* request, | 151 virtual void OnReadCompleted(net::URLRequest* request, |
| 154 int bytes_read) OVERRIDE; | 152 int bytes_read) OVERRIDE; |
| 155 | 153 |
| 156 private: | 154 private: |
| 157 static const int kBufferSize = 4096; | 155 static const int kBufferSize = 4096; |
| 158 | 156 |
| 159 virtual void OnResponseCompleted(URLRequest* request); | 157 virtual void OnResponseCompleted(net::URLRequest* request); |
| 160 | 158 |
| 161 // options for controlling behavior | 159 // options for controlling behavior |
| 162 bool cancel_in_rr_; | 160 bool cancel_in_rr_; |
| 163 bool cancel_in_rs_; | 161 bool cancel_in_rs_; |
| 164 bool cancel_in_rd_; | 162 bool cancel_in_rd_; |
| 165 bool cancel_in_rd_pending_; | 163 bool cancel_in_rd_pending_; |
| 166 bool quit_on_complete_; | 164 bool quit_on_complete_; |
| 167 bool quit_on_redirect_; | 165 bool quit_on_redirect_; |
| 168 bool allow_certificate_errors_; | 166 bool allow_certificate_errors_; |
| 169 AuthCredentials credentials_; | 167 net::AuthCredentials credentials_; |
| 170 | 168 |
| 171 // tracks status of callbacks | 169 // tracks status of callbacks |
| 172 int response_started_count_; | 170 int response_started_count_; |
| 173 int received_bytes_count_; | 171 int received_bytes_count_; |
| 174 int received_redirect_count_; | 172 int received_redirect_count_; |
| 175 bool received_data_before_response_; | 173 bool received_data_before_response_; |
| 176 bool request_failed_; | 174 bool request_failed_; |
| 177 bool have_certificate_errors_; | 175 bool have_certificate_errors_; |
| 178 bool certificate_errors_are_fatal_; | 176 bool certificate_errors_are_fatal_; |
| 179 bool auth_required_; | 177 bool auth_required_; |
| 180 std::string data_received_; | 178 std::string data_received_; |
| 181 | 179 |
| 182 // our read buffer | 180 // our read buffer |
| 183 scoped_refptr<IOBuffer> buf_; | 181 scoped_refptr<net::IOBuffer> buf_; |
| 184 }; | 182 }; |
| 185 | 183 |
| 186 //----------------------------------------------------------------------------- | 184 //----------------------------------------------------------------------------- |
| 187 | 185 |
| 188 class TestNetworkDelegate : public NetworkDelegate { | 186 class TestNetworkDelegate : public net::NetworkDelegate { |
| 189 public: | 187 public: |
| 190 enum Options { | 188 enum Options { |
| 191 NO_GET_COOKIES = 1 << 0, | 189 NO_GET_COOKIES = 1 << 0, |
| 192 NO_SET_COOKIE = 1 << 1, | 190 NO_SET_COOKIE = 1 << 1, |
| 193 }; | 191 }; |
| 194 | 192 |
| 195 TestNetworkDelegate(); | 193 TestNetworkDelegate(); |
| 196 virtual ~TestNetworkDelegate(); | 194 virtual ~TestNetworkDelegate(); |
| 197 | 195 |
| 198 void set_cookie_options(int o) {cookie_options_bit_mask_ = o; } | 196 void set_cookie_options(int o) {cookie_options_bit_mask_ = o; } |
| 199 | 197 |
| 200 int last_error() const { return last_error_; } | 198 int last_error() const { return last_error_; } |
| 201 int error_count() const { return error_count_; } | 199 int error_count() const { return error_count_; } |
| 202 int created_requests() const { return created_requests_; } | 200 int created_requests() const { return created_requests_; } |
| 203 int destroyed_requests() const { return destroyed_requests_; } | 201 int destroyed_requests() const { return destroyed_requests_; } |
| 204 int completed_requests() const { return completed_requests_; } | 202 int completed_requests() const { return completed_requests_; } |
| 205 int blocked_get_cookies_count() const { return blocked_get_cookies_count_; } | 203 int blocked_get_cookies_count() const { return blocked_get_cookies_count_; } |
| 206 int blocked_set_cookie_count() const { return blocked_set_cookie_count_; } | 204 int blocked_set_cookie_count() const { return blocked_set_cookie_count_; } |
| 207 int set_cookie_count() const { return set_cookie_count_; } | 205 int set_cookie_count() const { return set_cookie_count_; } |
| 208 | 206 |
| 209 protected: | 207 protected: |
| 210 // NetworkDelegate: | 208 // net::NetworkDelegate: |
| 211 virtual int OnBeforeURLRequest(URLRequest* request, | 209 virtual int OnBeforeURLRequest(net::URLRequest* request, |
| 212 const CompletionCallback& callback, | 210 const net::CompletionCallback& callback, |
| 213 GURL* new_url) OVERRIDE; | 211 GURL* new_url) OVERRIDE; |
| 214 virtual int OnBeforeSendHeaders(URLRequest* request, | 212 virtual int OnBeforeSendHeaders(net::URLRequest* request, |
| 215 const CompletionCallback& callback, | 213 const net::CompletionCallback& callback, |
| 216 HttpRequestHeaders* headers) OVERRIDE; | 214 net::HttpRequestHeaders* headers) OVERRIDE; |
| 217 virtual void OnSendHeaders(URLRequest* request, | 215 virtual void OnSendHeaders(net::URLRequest* request, |
| 218 const HttpRequestHeaders& headers) OVERRIDE; | 216 const net::HttpRequestHeaders& headers) OVERRIDE; |
| 219 virtual int OnHeadersReceived( | 217 virtual int OnHeadersReceived( |
| 220 URLRequest* request, | 218 net::URLRequest* request, |
| 221 const CompletionCallback& callback, | 219 const net::CompletionCallback& callback, |
| 222 const HttpResponseHeaders* original_response_headers, | 220 const net::HttpResponseHeaders* original_response_headers, |
| 223 scoped_refptr<HttpResponseHeaders>* override_response_headers) OVERRIDE; | 221 scoped_refptr<net::HttpResponseHeaders>* override_response_headers) |
| 224 virtual void OnBeforeRedirect(URLRequest* request, | 222 OVERRIDE; |
| 223 virtual void OnBeforeRedirect(net::URLRequest* request, |
| 225 const GURL& new_location) OVERRIDE; | 224 const GURL& new_location) OVERRIDE; |
| 226 virtual void OnResponseStarted(URLRequest* request) OVERRIDE; | 225 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; |
| 227 virtual void OnRawBytesRead(const URLRequest& request, | 226 virtual void OnRawBytesRead(const net::URLRequest& request, |
| 228 int bytes_read) OVERRIDE; | 227 int bytes_read) OVERRIDE; |
| 229 virtual void OnCompleted(URLRequest* request, bool started) OVERRIDE; | 228 virtual void OnCompleted(net::URLRequest* request, bool started) OVERRIDE; |
| 230 virtual void OnURLRequestDestroyed(URLRequest* request) OVERRIDE; | 229 virtual void OnURLRequestDestroyed(net::URLRequest* request) OVERRIDE; |
| 231 virtual void OnPACScriptError(int line_number, | 230 virtual void OnPACScriptError(int line_number, |
| 232 const string16& error) OVERRIDE; | 231 const string16& error) OVERRIDE; |
| 233 virtual NetworkDelegate::AuthRequiredResponse OnAuthRequired( | 232 virtual net::NetworkDelegate::AuthRequiredResponse OnAuthRequired( |
| 234 URLRequest* request, | 233 net::URLRequest* request, |
| 235 const AuthChallengeInfo& auth_info, | 234 const net::AuthChallengeInfo& auth_info, |
| 236 const AuthCallback& callback, | 235 const AuthCallback& callback, |
| 237 AuthCredentials* credentials) OVERRIDE; | 236 net::AuthCredentials* credentials) OVERRIDE; |
| 238 virtual bool OnCanGetCookies(const URLRequest& request, | 237 virtual bool OnCanGetCookies(const net::URLRequest& request, |
| 239 const CookieList& cookie_list) OVERRIDE; | 238 const net::CookieList& cookie_list) OVERRIDE; |
| 240 virtual bool OnCanSetCookie(const URLRequest& request, | 239 virtual bool OnCanSetCookie(const net::URLRequest& request, |
| 241 const std::string& cookie_line, | 240 const std::string& cookie_line, |
| 242 CookieOptions* options) OVERRIDE; | 241 net::CookieOptions* options) OVERRIDE; |
| 243 virtual bool OnCanAccessFile(const URLRequest& request, | 242 virtual bool OnCanAccessFile(const net::URLRequest& request, |
| 244 const FilePath& path) const OVERRIDE; | 243 const FilePath& path) const OVERRIDE; |
| 245 virtual bool OnCanThrottleRequest( | 244 virtual bool OnCanThrottleRequest( |
| 246 const URLRequest& request) const OVERRIDE; | 245 const net::URLRequest& request) const OVERRIDE; |
| 247 virtual int OnBeforeSocketStreamConnect( | 246 virtual int OnBeforeSocketStreamConnect( |
| 248 SocketStream* stream, | 247 net::SocketStream* stream, |
| 249 const CompletionCallback& callback) OVERRIDE; | 248 const net::CompletionCallback& callback) OVERRIDE; |
| 250 virtual void OnRequestWaitStateChange(const URLRequest& request, | 249 virtual void OnRequestWaitStateChange(const net::URLRequest& request, |
| 251 RequestWaitState state) OVERRIDE; | 250 RequestWaitState state) OVERRIDE; |
| 252 | 251 |
| 253 void InitRequestStatesIfNew(int request_id); | 252 void InitRequestStatesIfNew(int request_id); |
| 254 | 253 |
| 255 int last_error_; | 254 int last_error_; |
| 256 int error_count_; | 255 int error_count_; |
| 257 int created_requests_; | 256 int created_requests_; |
| 258 int destroyed_requests_; | 257 int destroyed_requests_; |
| 259 int completed_requests_; | 258 int completed_requests_; |
| 260 int cookie_options_bit_mask_; | 259 int cookie_options_bit_mask_; |
| 261 int blocked_get_cookies_count_; | 260 int blocked_get_cookies_count_; |
| 262 int blocked_set_cookie_count_; | 261 int blocked_set_cookie_count_; |
| 263 int set_cookie_count_; | 262 int set_cookie_count_; |
| 264 | 263 |
| 265 // NetworkDelegate callbacks happen in a particular order (e.g. | 264 // net::NetworkDelegate callbacks happen in a particular order (e.g. |
| 266 // OnBeforeURLRequest is always called before OnBeforeSendHeaders). | 265 // OnBeforeURLRequest is always called before OnBeforeSendHeaders). |
| 267 // This bit-set indicates for each request id (key) what events may be sent | 266 // This bit-set indicates for each request id (key) what events may be sent |
| 268 // next. | 267 // next. |
| 269 std::map<int, int> next_states_; | 268 std::map<int, int> next_states_; |
| 270 | 269 |
| 271 // A log that records for each request id (key) the order in which On... | 270 // A log that records for each request id (key) the order in which On... |
| 272 // functions were called. | 271 // functions were called. |
| 273 std::map<int, std::string> event_order_; | 272 std::map<int, std::string> event_order_; |
| 274 }; | 273 }; |
| 275 | 274 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 294 static std::string value_; | 293 static std::string value_; |
| 295 const std::string old_value_; | 294 const std::string old_value_; |
| 296 const std::string new_value_; | 295 const std::string new_value_; |
| 297 | 296 |
| 298 DISALLOW_COPY_AND_ASSIGN(ScopedCustomUrlRequestTestHttpHost); | 297 DISALLOW_COPY_AND_ASSIGN(ScopedCustomUrlRequestTestHttpHost); |
| 299 }; | 298 }; |
| 300 | 299 |
| 301 //----------------------------------------------------------------------------- | 300 //----------------------------------------------------------------------------- |
| 302 | 301 |
| 303 // A simple Interceptor that returns a pre-built URLRequestJob only once. | 302 // A simple Interceptor that returns a pre-built URLRequestJob only once. |
| 304 class TestJobInterceptor : public URLRequestJobFactory::Interceptor { | 303 class TestJobInterceptor : public net::URLRequestJobFactory::Interceptor { |
| 305 public: | 304 public: |
| 306 TestJobInterceptor(); | 305 TestJobInterceptor(); |
| 307 | 306 |
| 308 virtual URLRequestJob* MaybeIntercept( | 307 virtual net::URLRequestJob* MaybeIntercept( |
| 309 URLRequest* request, | 308 net::URLRequest* request, |
| 310 NetworkDelegate* network_delegate) const OVERRIDE; | 309 net::NetworkDelegate* network_delegate) const OVERRIDE; |
| 311 virtual URLRequestJob* MaybeInterceptRedirect( | 310 virtual net::URLRequestJob* MaybeInterceptRedirect( |
| 312 const GURL& location, | 311 const GURL& location, |
| 313 URLRequest* request, | 312 net::URLRequest* request, |
| 314 NetworkDelegate* network_delegate) const OVERRIDE; | 313 net::NetworkDelegate* network_delegate) const OVERRIDE; |
| 315 virtual URLRequestJob* MaybeInterceptResponse( | 314 virtual net::URLRequestJob* MaybeInterceptResponse( |
| 316 URLRequest* request, | 315 net::URLRequest* request, |
| 317 NetworkDelegate* network_delegate) const OVERRIDE; | 316 net::NetworkDelegate* network_delegate) const OVERRIDE; |
| 318 void set_main_intercept_job(URLRequestJob* job); | 317 void set_main_intercept_job(net::URLRequestJob* job); |
| 319 | 318 |
| 320 private: | 319 private: |
| 321 mutable URLRequestJob* main_intercept_job_; | 320 mutable net::URLRequestJob* main_intercept_job_; |
| 322 }; | 321 }; |
| 323 | 322 |
| 324 } // namespace net | |
| 325 | |
| 326 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ | 323 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
| OLD | NEW |