Index: chrome/browser/safe_browsing/certificate_reporting_service_test_utils.cc |
diff --git a/chrome/browser/safe_browsing/certificate_reporting_service_test_utils.cc b/chrome/browser/safe_browsing/certificate_reporting_service_test_utils.cc |
index f3c9d4c81f42d958541279ff02823d3c0c1454ca..be457569892b5c15b870c1a14ac68dd2b461de8d 100644 |
--- a/chrome/browser/safe_browsing/certificate_reporting_service_test_utils.cc |
+++ b/chrome/browser/safe_browsing/certificate_reporting_service_test_utils.cc |
@@ -443,4 +443,42 @@ void CertificateReportingServiceTestHelper::ExpectNoRequests( |
} |
} |
+EventHistogramTester::EventHistogramTester() {} |
+ |
+EventHistogramTester::~EventHistogramTester() { |
+ if (submitted_) { |
estark
2017/05/05 16:21:13
Do you need these conditionals? Seems like the buc
meacer
2017/05/05 19:24:19
Unfortunately yes, base::HistogramTester complains
|
+ histogram_tester_.ExpectBucketCount( |
+ CertificateReportingService::kReportEventHistogram, |
+ CertificateReportingService::REPORT_SUBMITTED, submitted_); |
+ } |
+ if (failed_) { |
+ histogram_tester_.ExpectBucketCount( |
+ CertificateReportingService::kReportEventHistogram, |
+ CertificateReportingService::REPORT_FAILED, failed_); |
+ } |
+ if (successful_) { |
+ histogram_tester_.ExpectBucketCount( |
+ CertificateReportingService::kReportEventHistogram, |
+ CertificateReportingService::REPORT_SUCCESSFUL, successful_); |
+ } |
+ if (dropped_) { |
+ histogram_tester_.ExpectBucketCount( |
+ CertificateReportingService::kReportEventHistogram, |
+ CertificateReportingService::REPORT_DROPPED_OR_IGNORED, dropped_); |
+ } |
+ histogram_tester_.ExpectTotalCount( |
+ CertificateReportingService::kReportEventHistogram, |
+ submitted_ + failed_ + successful_ + dropped_); |
+} |
+ |
+void EventHistogramTester::SetExpectedValues(int submitted, |
+ int failed, |
+ int successful, |
+ int dropped) { |
+ submitted_ = submitted; |
+ failed_ = failed; |
+ successful_ = successful; |
+ dropped_ = dropped; |
+} |
+ |
} // namespace certificate_reporting_test_utils |