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

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

Issue 1850853004: Use CertificateReportSender error callback to record HPKP UMA metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: eroman comments Created 4 years, 8 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
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 <utility> 5 #include <utility>
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <windows.h> 10 #include <windows.h>
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 : public TransportSecurityState::ReportSender { 682 : public TransportSecurityState::ReportSender {
683 public: 683 public:
684 MockCertificateReportSender() {} 684 MockCertificateReportSender() {}
685 ~MockCertificateReportSender() override {} 685 ~MockCertificateReportSender() override {}
686 686
687 void Send(const GURL& report_uri, const std::string& report) override { 687 void Send(const GURL& report_uri, const std::string& report) override {
688 latest_report_uri_ = report_uri; 688 latest_report_uri_ = report_uri;
689 latest_report_ = report; 689 latest_report_ = report;
690 } 690 }
691 691
692 void SetErrorCallback(
693 const base::Callback<void(const GURL&, int)>& error_callback) override {}
694
692 const GURL& latest_report_uri() { return latest_report_uri_; } 695 const GURL& latest_report_uri() { return latest_report_uri_; }
693 const std::string& latest_report() { return latest_report_; } 696 const std::string& latest_report() { return latest_report_; }
694 697
695 private: 698 private:
696 GURL latest_report_uri_; 699 GURL latest_report_uri_;
697 std::string latest_report_; 700 std::string latest_report_;
698 }; 701 };
699 702
700 class TestExperimentalFeaturesNetworkDelegate : public TestNetworkDelegate { 703 class TestExperimentalFeaturesNetworkDelegate : public TestNetworkDelegate {
701 public: 704 public:
(...skipping 9392 matching lines...) Expand 10 before | Expand all | Expand 10 after
10094 AddTestInterceptor()->set_main_intercept_job(std::move(job)); 10097 AddTestInterceptor()->set_main_intercept_job(std::move(job));
10095 10098
10096 req->Start(); 10099 req->Start();
10097 req->Cancel(); 10100 req->Cancel();
10098 base::RunLoop().RunUntilIdle(); 10101 base::RunLoop().RunUntilIdle();
10099 EXPECT_EQ(URLRequestStatus::CANCELED, req->status().status()); 10102 EXPECT_EQ(URLRequestStatus::CANCELED, req->status().status());
10100 EXPECT_EQ(0, d.received_redirect_count()); 10103 EXPECT_EQ(0, d.received_redirect_count());
10101 } 10104 }
10102 10105
10103 } // namespace net 10106 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/certificate_report_sender_unittest.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698