Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Side by Side Diff: net/url_request/url_request_unittest.cc

Issue 2633663003: Implements strict secure cookies as the default behavior in //net (Closed)
Patch Set: Rebase on ToT Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/url_request/url_request_test_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <memory> 5 #include <memory>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 731
732 private: 732 private:
733 GURL latest_report_uri_; 733 GURL latest_report_uri_;
734 std::string latest_report_; 734 std::string latest_report_;
735 std::string latest_content_type_; 735 std::string latest_content_type_;
736 }; 736 };
737 737
738 class TestExperimentalFeaturesNetworkDelegate : public TestNetworkDelegate { 738 class TestExperimentalFeaturesNetworkDelegate : public TestNetworkDelegate {
739 public: 739 public:
740 bool OnAreExperimentalCookieFeaturesEnabled() const override { return true; } 740 bool OnAreExperimentalCookieFeaturesEnabled() const override { return true; }
741 bool OnAreStrictSecureCookiesEnabled() const override { return true; }
742 }; 741 };
743 742
744 // OCSPErrorTestDelegate caches the SSLInfo passed to OnSSLCertificateError. 743 // OCSPErrorTestDelegate caches the SSLInfo passed to OnSSLCertificateError.
745 // This is needed because after the certificate failure, the URLRequest will 744 // This is needed because after the certificate failure, the URLRequest will
746 // retry the connection, and return a partial SSLInfo with a cached cert status. 745 // retry the connection, and return a partial SSLInfo with a cached cert status.
747 // The partial SSLInfo does not have the OCSP information filled out. 746 // The partial SSLInfo does not have the OCSP information filled out.
748 class OCSPErrorTestDelegate : public TestDelegate { 747 class OCSPErrorTestDelegate : public TestDelegate {
749 public: 748 public:
750 void OnSSLCertificateError(URLRequest* request, 749 void OnSSLCertificateError(URLRequest* request,
751 const SSLInfo& ssl_info, 750 const SSLInfo& ssl_info,
(...skipping 9975 matching lines...) Expand 10 before | Expand all | Expand 10 after
10727 AddTestInterceptor()->set_main_intercept_job(std::move(job)); 10726 AddTestInterceptor()->set_main_intercept_job(std::move(job));
10728 10727
10729 req->Start(); 10728 req->Start();
10730 req->Cancel(); 10729 req->Cancel();
10731 base::RunLoop().RunUntilIdle(); 10730 base::RunLoop().RunUntilIdle();
10732 EXPECT_EQ(ERR_ABORTED, d.request_status()); 10731 EXPECT_EQ(ERR_ABORTED, d.request_status());
10733 EXPECT_EQ(0, d.received_redirect_count()); 10732 EXPECT_EQ(0, d.received_redirect_count());
10734 } 10733 }
10735 10734
10736 } // namespace net 10735 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_test_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698