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

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

Issue 2026213002: Refactor CertificateReportSender (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/report_sender_unittest.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 "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 TestURLRequestContextWithProxy(const std::string& proxy, 652 TestURLRequestContextWithProxy(const std::string& proxy,
653 NetworkDelegate* delegate) 653 NetworkDelegate* delegate)
654 : TestURLRequestContext(true) { 654 : TestURLRequestContext(true) {
655 context_storage_.set_proxy_service(ProxyService::CreateFixed(proxy)); 655 context_storage_.set_proxy_service(ProxyService::CreateFixed(proxy));
656 set_network_delegate(delegate); 656 set_network_delegate(delegate);
657 Init(); 657 Init();
658 } 658 }
659 ~TestURLRequestContextWithProxy() override {} 659 ~TestURLRequestContextWithProxy() override {}
660 }; 660 };
661 661
662 // A mock ReportSender that just remembers the latest report 662 // A mock ReportSenderInterface that just remembers the latest report
663 // URI and report to be sent. 663 // URI and report to be sent.
664 class MockCertificateReportSender 664 class MockCertificateReportSender
665 : public TransportSecurityState::ReportSender { 665 : public TransportSecurityState::ReportSenderInterface {
666 public: 666 public:
667 MockCertificateReportSender() {} 667 MockCertificateReportSender() {}
668 ~MockCertificateReportSender() override {} 668 ~MockCertificateReportSender() override {}
669 669
670 void Send(const GURL& report_uri, const std::string& report) override { 670 void Send(const GURL& report_uri, const std::string& report) override {
671 latest_report_uri_ = report_uri; 671 latest_report_uri_ = report_uri;
672 latest_report_ = report; 672 latest_report_ = report;
673 } 673 }
674 674
675 void SetErrorCallback( 675 void SetErrorCallback(
(...skipping 9365 matching lines...) Expand 10 before | Expand all | Expand 10 after
10041 AddTestInterceptor()->set_main_intercept_job(std::move(job)); 10041 AddTestInterceptor()->set_main_intercept_job(std::move(job));
10042 10042
10043 req->Start(); 10043 req->Start();
10044 req->Cancel(); 10044 req->Cancel();
10045 base::RunLoop().RunUntilIdle(); 10045 base::RunLoop().RunUntilIdle();
10046 EXPECT_EQ(URLRequestStatus::CANCELED, req->status().status()); 10046 EXPECT_EQ(URLRequestStatus::CANCELED, req->status().status());
10047 EXPECT_EQ(0, d.received_redirect_count()); 10047 EXPECT_EQ(0, d.received_redirect_count());
10048 } 10048 }
10049 10049
10050 } // namespace net 10050 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/report_sender_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698