| 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 int destroyed_requests() const { return destroyed_requests_; } | 258 int destroyed_requests() const { return destroyed_requests_; } |
| 259 int completed_requests() const { return completed_requests_; } | 259 int completed_requests() const { return completed_requests_; } |
| 260 int canceled_requests() const { return canceled_requests_; } | 260 int canceled_requests() const { return canceled_requests_; } |
| 261 int blocked_get_cookies_count() const { return blocked_get_cookies_count_; } | 261 int blocked_get_cookies_count() const { return blocked_get_cookies_count_; } |
| 262 int blocked_set_cookie_count() const { return blocked_set_cookie_count_; } | 262 int blocked_set_cookie_count() const { return blocked_set_cookie_count_; } |
| 263 int set_cookie_count() const { return set_cookie_count_; } | 263 int set_cookie_count() const { return set_cookie_count_; } |
| 264 | 264 |
| 265 void set_can_access_files(bool val) { can_access_files_ = val; } | 265 void set_can_access_files(bool val) { can_access_files_ = val; } |
| 266 bool can_access_files() const { return can_access_files_; } | 266 bool can_access_files() const { return can_access_files_; } |
| 267 | 267 |
| 268 void set_first_party_only_cookies_enabled(bool val) { |
| 269 first_party_only_cookies_enabled_ = val; |
| 270 } |
| 271 |
| 268 void set_can_throttle_requests(bool val) { can_throttle_requests_ = val; } | 272 void set_can_throttle_requests(bool val) { can_throttle_requests_ = val; } |
| 269 bool can_throttle_requests() const { return can_throttle_requests_; } | 273 bool can_throttle_requests() const { return can_throttle_requests_; } |
| 270 | 274 |
| 271 void set_cancel_request_with_policy_violating_referrer(bool val) { | 275 void set_cancel_request_with_policy_violating_referrer(bool val) { |
| 272 cancel_request_with_policy_violating_referrer_ = val; | 276 cancel_request_with_policy_violating_referrer_ = val; |
| 273 } | 277 } |
| 274 | 278 |
| 275 int observed_before_proxy_headers_sent_callbacks() const { | 279 int observed_before_proxy_headers_sent_callbacks() const { |
| 276 return observed_before_proxy_headers_sent_callbacks_; | 280 return observed_before_proxy_headers_sent_callbacks_; |
| 277 } | 281 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 const AuthCallback& callback, | 322 const AuthCallback& callback, |
| 319 AuthCredentials* credentials) override; | 323 AuthCredentials* credentials) override; |
| 320 bool OnCanGetCookies(const URLRequest& request, | 324 bool OnCanGetCookies(const URLRequest& request, |
| 321 const CookieList& cookie_list) override; | 325 const CookieList& cookie_list) override; |
| 322 bool OnCanSetCookie(const URLRequest& request, | 326 bool OnCanSetCookie(const URLRequest& request, |
| 323 const std::string& cookie_line, | 327 const std::string& cookie_line, |
| 324 CookieOptions* options) override; | 328 CookieOptions* options) override; |
| 325 bool OnCanAccessFile(const URLRequest& request, | 329 bool OnCanAccessFile(const URLRequest& request, |
| 326 const base::FilePath& path) const override; | 330 const base::FilePath& path) const override; |
| 327 bool OnCanThrottleRequest(const URLRequest& request) const override; | 331 bool OnCanThrottleRequest(const URLRequest& request) const override; |
| 332 bool OnFirstPartyOnlyCookieExperimentEnabled() const override; |
| 328 bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 333 bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( |
| 329 const URLRequest& request, | 334 const URLRequest& request, |
| 330 const GURL& target_url, | 335 const GURL& target_url, |
| 331 const GURL& referrer_url) const override; | 336 const GURL& referrer_url) const override; |
| 332 | 337 |
| 333 void InitRequestStatesIfNew(int request_id); | 338 void InitRequestStatesIfNew(int request_id); |
| 334 | 339 |
| 335 GURL redirect_on_headers_received_url_; | 340 GURL redirect_on_headers_received_url_; |
| 336 // URL marked as safe for redirection at the onHeadersReceived stage. | 341 // URL marked as safe for redirection at the onHeadersReceived stage. |
| 337 GURL allowed_unsafe_redirect_url_; | 342 GURL allowed_unsafe_redirect_url_; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 363 std::map<int, std::string> event_order_; | 368 std::map<int, std::string> event_order_; |
| 364 | 369 |
| 365 LoadTimingInfo load_timing_info_before_redirect_; | 370 LoadTimingInfo load_timing_info_before_redirect_; |
| 366 bool has_load_timing_info_before_redirect_; | 371 bool has_load_timing_info_before_redirect_; |
| 367 | 372 |
| 368 LoadTimingInfo load_timing_info_before_auth_; | 373 LoadTimingInfo load_timing_info_before_auth_; |
| 369 bool has_load_timing_info_before_auth_; | 374 bool has_load_timing_info_before_auth_; |
| 370 | 375 |
| 371 bool can_access_files_; // true by default | 376 bool can_access_files_; // true by default |
| 372 bool can_throttle_requests_; // true by default | 377 bool can_throttle_requests_; // true by default |
| 378 bool first_party_only_cookies_enabled_; // false by default |
| 373 bool cancel_request_with_policy_violating_referrer_; // false by default | 379 bool cancel_request_with_policy_violating_referrer_; // false by default |
| 374 bool will_be_intercepted_on_next_error_; | 380 bool will_be_intercepted_on_next_error_; |
| 375 }; | 381 }; |
| 376 | 382 |
| 377 // Overrides the host used by the LocalHttpTestServer in | 383 // Overrides the host used by the LocalHttpTestServer in |
| 378 // url_request_unittest.cc . This is used by the chrome_frame_net_tests due to | 384 // url_request_unittest.cc . This is used by the chrome_frame_net_tests due to |
| 379 // a mysterious bug when tests execute over the loopback adapter. See | 385 // a mysterious bug when tests execute over the loopback adapter. See |
| 380 // http://crbug.com/114369 . | 386 // http://crbug.com/114369 . |
| 381 class ScopedCustomUrlRequestTestHttpHost { | 387 class ScopedCustomUrlRequestTestHttpHost { |
| 382 public: | 388 public: |
| (...skipping 28 matching lines...) Expand all Loading... |
| 411 NetworkDelegate* network_delegate) const override; | 417 NetworkDelegate* network_delegate) const override; |
| 412 void set_main_intercept_job(URLRequestJob* job); | 418 void set_main_intercept_job(URLRequestJob* job); |
| 413 | 419 |
| 414 private: | 420 private: |
| 415 mutable URLRequestJob* main_intercept_job_; | 421 mutable URLRequestJob* main_intercept_job_; |
| 416 }; | 422 }; |
| 417 | 423 |
| 418 } // namespace net | 424 } // namespace net |
| 419 | 425 |
| 420 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ | 426 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
| OLD | NEW |