| Index: chrome/browser/ssl/certificate_reporting_test_utils.cc
|
| diff --git a/chrome/browser/ssl/certificate_reporting_test_utils.cc b/chrome/browser/ssl/certificate_reporting_test_utils.cc
|
| index ba04b2bfa6e2e50ac9a9175398abe4126ded5344..63e89c123418f8865f3d89176578f9885c1c6a98 100644
|
| --- a/chrome/browser/ssl/certificate_reporting_test_utils.cc
|
| +++ b/chrome/browser/ssl/certificate_reporting_test_utils.cc
|
| @@ -32,7 +32,10 @@ namespace certificate_reporting_test_utils {
|
| class MockSSLCertReporter : public SSLCertReporter {
|
| public:
|
| MockSSLCertReporter(
|
| - const base::Callback<void(const std::string&)>& report_sent_callback,
|
| + const base::Callback<
|
| + void(const std::string&,
|
| + const certificate_reporting::CertLoggerRequest_ChromeChannel)>&
|
| + report_sent_callback,
|
| ExpectReport expect_report)
|
| : report_sent_callback_(report_sent_callback),
|
| expect_report_(expect_report),
|
| @@ -52,11 +55,14 @@ class MockSSLCertReporter : public SSLCertReporter {
|
| reported_ = true;
|
| certificate_reporting::ErrorReport report;
|
| EXPECT_TRUE(report.InitializeFromString(serialized_report));
|
| - report_sent_callback_.Run(report.hostname());
|
| + report_sent_callback_.Run(report.hostname(), report.chrome_channel());
|
| }
|
|
|
| private:
|
| - const base::Callback<void(const std::string&)> report_sent_callback_;
|
| + const base::Callback<void(
|
| + const std::string&,
|
| + const certificate_reporting::CertLoggerRequest_ChromeChannel)>
|
| + report_sent_callback_;
|
| const ExpectReport expect_report_;
|
| bool reported_;
|
|
|
| @@ -64,12 +70,18 @@ class MockSSLCertReporter : public SSLCertReporter {
|
| };
|
|
|
| SSLCertReporterCallback::SSLCertReporterCallback(base::RunLoop* run_loop)
|
| - : run_loop_(run_loop) {}
|
| + : run_loop_(run_loop),
|
| + chrome_channel_(
|
| + certificate_reporting::CertLoggerRequest::CHROME_CHANNEL_NONE) {}
|
|
|
| SSLCertReporterCallback::~SSLCertReporterCallback() {}
|
|
|
| -void SSLCertReporterCallback::ReportSent(const std::string& hostname) {
|
| +void SSLCertReporterCallback::ReportSent(
|
| + const std::string& hostname,
|
| + const certificate_reporting::CertLoggerRequest::ChromeChannel
|
| + chrome_channel) {
|
| latest_hostname_reported_ = hostname;
|
| + chrome_channel_ = chrome_channel;
|
| run_loop_->Quit();
|
| }
|
|
|
| @@ -77,13 +89,21 @@ const std::string& SSLCertReporterCallback::GetLatestHostnameReported() const {
|
| return latest_hostname_reported_;
|
| }
|
|
|
| +certificate_reporting::CertLoggerRequest::ChromeChannel
|
| +SSLCertReporterCallback::GetLatestChromeChannelReported() const {
|
| + return chrome_channel_;
|
| +}
|
| +
|
| void SetCertReportingOptIn(Browser* browser, OptIn opt_in) {
|
| safe_browsing::SetExtendedReportingPref(browser->profile()->GetPrefs(),
|
| opt_in == EXTENDED_REPORTING_OPT_IN);
|
| }
|
|
|
| std::unique_ptr<SSLCertReporter> CreateMockSSLCertReporter(
|
| - const base::Callback<void(const std::string&)>& report_sent_callback,
|
| + const base::Callback<
|
| + void(const std::string&,
|
| + const certificate_reporting::CertLoggerRequest_ChromeChannel)>&
|
| + report_sent_callback,
|
| ExpectReport expect_report) {
|
| return std::unique_ptr<SSLCertReporter>(
|
| new MockSSLCertReporter(report_sent_callback, expect_report));
|
|
|