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 #include "net/url_request/url_request_test_util.h" | 5 #include "net/url_request/url_request_test_util.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 blocked_get_cookies_count_(0), | 315 blocked_get_cookies_count_(0), |
316 blocked_set_cookie_count_(0), | 316 blocked_set_cookie_count_(0), |
317 set_cookie_count_(0), | 317 set_cookie_count_(0), |
318 observed_before_proxy_headers_sent_callbacks_(0), | 318 observed_before_proxy_headers_sent_callbacks_(0), |
319 before_send_headers_count_(0), | 319 before_send_headers_count_(0), |
320 headers_received_count_(0), | 320 headers_received_count_(0), |
321 has_load_timing_info_before_redirect_(false), | 321 has_load_timing_info_before_redirect_(false), |
322 has_load_timing_info_before_auth_(false), | 322 has_load_timing_info_before_auth_(false), |
323 can_access_files_(true), | 323 can_access_files_(true), |
324 can_throttle_requests_(true), | 324 can_throttle_requests_(true), |
325 first_party_only_cookies_enabled_(false), | |
326 cancel_request_with_policy_violating_referrer_(false), | 325 cancel_request_with_policy_violating_referrer_(false), |
327 will_be_intercepted_on_next_error_(false) { | 326 will_be_intercepted_on_next_error_(false) { |
328 } | 327 } |
329 | 328 |
330 TestNetworkDelegate::~TestNetworkDelegate() { | 329 TestNetworkDelegate::~TestNetworkDelegate() { |
331 for (std::map<int, int>::iterator i = next_states_.begin(); | 330 for (std::map<int, int>::iterator i = next_states_.begin(); |
332 i != next_states_.end(); ++i) { | 331 i != next_states_.end(); ++i) { |
333 event_order_[i->first] += "~TestNetworkDelegate\n"; | 332 event_order_[i->first] += "~TestNetworkDelegate\n"; |
334 EXPECT_TRUE(i->second & kStageDestruction) << event_order_[i->first]; | 333 EXPECT_TRUE(i->second & kStageDestruction) << event_order_[i->first]; |
335 } | 334 } |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 bool TestNetworkDelegate::OnCanAccessFile(const URLRequest& request, | 596 bool TestNetworkDelegate::OnCanAccessFile(const URLRequest& request, |
598 const base::FilePath& path) const { | 597 const base::FilePath& path) const { |
599 return can_access_files_; | 598 return can_access_files_; |
600 } | 599 } |
601 | 600 |
602 bool TestNetworkDelegate::OnCanThrottleRequest( | 601 bool TestNetworkDelegate::OnCanThrottleRequest( |
603 const URLRequest& request) const { | 602 const URLRequest& request) const { |
604 return can_throttle_requests_; | 603 return can_throttle_requests_; |
605 } | 604 } |
606 | 605 |
607 bool TestNetworkDelegate::OnFirstPartyOnlyCookieExperimentEnabled() const { | |
608 return first_party_only_cookies_enabled_; | |
609 } | |
610 | |
611 bool TestNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 606 bool TestNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader( |
612 const URLRequest& request, | 607 const URLRequest& request, |
613 const GURL& target_url, | 608 const GURL& target_url, |
614 const GURL& referrer_url) const { | 609 const GURL& referrer_url) const { |
615 return cancel_request_with_policy_violating_referrer_; | 610 return cancel_request_with_policy_violating_referrer_; |
616 } | 611 } |
617 | 612 |
618 // static | 613 // static |
619 std::string ScopedCustomUrlRequestTestHttpHost::value_("127.0.0.1"); | 614 std::string ScopedCustomUrlRequestTestHttpHost::value_("127.0.0.1"); |
620 | 615 |
(...skipping 23 matching lines...) Expand all Loading... |
644 URLRequestJob* job = main_intercept_job_; | 639 URLRequestJob* job = main_intercept_job_; |
645 main_intercept_job_ = NULL; | 640 main_intercept_job_ = NULL; |
646 return job; | 641 return job; |
647 } | 642 } |
648 | 643 |
649 void TestJobInterceptor::set_main_intercept_job(URLRequestJob* job) { | 644 void TestJobInterceptor::set_main_intercept_job(URLRequestJob* job) { |
650 main_intercept_job_ = job; | 645 main_intercept_job_ = job; |
651 } | 646 } |
652 | 647 |
653 } // namespace net | 648 } // namespace net |
OLD | NEW |