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

Unified Diff: chrome/browser/safe_browsing/certificate_reporting_service_browsertest.cc

Issue 2861323002: Revert "Add metrics for certificate report uploads" (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/certificate_reporting_service_browsertest.cc
diff --git a/chrome/browser/safe_browsing/certificate_reporting_service_browsertest.cc b/chrome/browser/safe_browsing/certificate_reporting_service_browsertest.cc
index 184e7b4f5a244af8df4da256b25f7d46e7f370ae..dbe29ea07993c81bc20776e957c447b5c4255ade 100644
--- a/chrome/browser/safe_browsing/certificate_reporting_service_browsertest.cc
+++ b/chrome/browser/safe_browsing/certificate_reporting_service_browsertest.cc
@@ -37,7 +37,6 @@
using certificate_reporting_test_utils::CertificateReportingServiceTestHelper;
using certificate_reporting_test_utils::CertificateReportingServiceObserver;
-using certificate_reporting_test_utils::EventHistogramTester;
using certificate_reporting_test_utils::ReportExpectation;
using certificate_reporting_test_utils::RetryStatus;
@@ -85,8 +84,6 @@ class CertificateReportingServiceBrowserTest : public InProcessBrowserTest {
->SetServiceResetCallbackForTesting(
base::Bind(&CertificateReportingServiceObserver::OnServiceReset,
base::Unretained(&service_observer_)));
-
- event_histogram_tester_.reset(new EventHistogramTester());
InProcessBrowserTest::SetUpOnMainThread();
}
@@ -105,8 +102,6 @@ class CertificateReportingServiceBrowserTest : public InProcessBrowserTest {
} else {
histogram_tester_.ExpectTotalCount(kFailedReportHistogram, 0);
}
-
- event_histogram_tester_.reset();
}
void SetUpCommandLine(base::CommandLine* command_line) override {
@@ -180,10 +175,6 @@ class CertificateReportingServiceBrowserTest : public InProcessBrowserTest {
browser()->profile());
}
- EventHistogramTester* event_histogram_tester() {
- return event_histogram_tester_.get();
- }
-
private:
// Checks that the serialized reports in |received_reports| have the same
// hostnames as |expected_hostnames|.
@@ -209,11 +200,6 @@ class CertificateReportingServiceBrowserTest : public InProcessBrowserTest {
CertificateReportingServiceObserver service_observer_;
base::HistogramTester histogram_tester_;
- // Histogram tester for reporting events. This is a member instead of a local
- // so that we can check the histogram after the test teardown. At that point
- // all in flight reports should be completed or deleted because
- // of CleanUpOnIOThread().
- std::unique_ptr<EventHistogramTester> event_histogram_tester_;
DISALLOW_COPY_AND_ASSIGN(CertificateReportingServiceBrowserTest);
};
@@ -230,8 +216,6 @@ IN_PROC_BROWSER_TEST_F(CertificateReportingServiceBrowserTest,
// Send a report. Test teardown checks for created and in-flight requests. If
// a report was incorrectly sent, the test will fail.
SendReport("no-report");
-
- event_histogram_tester()->SetExpectedValues(0, 0, 0, 0);
}
// Tests that report send attempts are not cancelled when extended reporting is
@@ -252,10 +236,6 @@ IN_PROC_BROWSER_TEST_F(CertificateReportingServiceBrowserTest,
SendReport("report0");
test_helper()->WaitForRequestsDestroyed(
ReportExpectation::Successful({{"report0", RetryStatus::NOT_RETRIED}}));
-
- // report0 was successfully submitted.
- event_histogram_tester()->SetExpectedValues(
- 1 /* submitted */, 0 /* failed */, 1 /* successful */, 0 /* dropped */);
}
// Tests that report send attempts are not cancelled when extended reporting is
@@ -300,12 +280,6 @@ IN_PROC_BROWSER_TEST_F(CertificateReportingServiceBrowserTest,
// nothing should be sent this time. If any report is sent, test teardown
// will catch it.
SendPendingReports();
-
- // report0 was submitted twice, failed once, succeeded once.
- // report1 was submitted twice, failed once, succeeded once.
- // report2 was submitted once, succeeded once.
- event_histogram_tester()->SetExpectedValues(
- 5 /* submitted */, 2 /* failed */, 3 /* successful */, 0 /* dropped */);
}
// Opting in then opting out of extended reporting should clear the pending
@@ -331,10 +305,6 @@ IN_PROC_BROWSER_TEST_F(CertificateReportingServiceBrowserTest,
// Send pending reports. No reports should be observed during test teardown.
SendPendingReports();
-
- // report0 was submitted once and failed once.
- event_histogram_tester()->SetExpectedValues(
- 1 /* submitted */, 1 /* failed */, 0 /* successful */, 0 /* dropped */);
}
// Opting out, then in, then out of extended reporting should work as expected.
@@ -374,11 +344,6 @@ IN_PROC_BROWSER_TEST_F(CertificateReportingServiceBrowserTest,
// Send pending reports. Nothing should be sent since there aren't any
// pending reports. If any report is sent, test teardown will catch it.
SendPendingReports();
-
- // report0 was submitted once and failed once.
- // report1 was never submitted.
- event_histogram_tester()->SetExpectedValues(
- 1 /* submitted */, 1 /* failed */, 0 /* successful */, 0 /* dropped */);
}
// Disabling SafeBrowsing should clear pending reports queue in
@@ -393,7 +358,7 @@ IN_PROC_BROWSER_TEST_F(CertificateReportingServiceBrowserTest,
test_helper()->SetFailureMode(
certificate_reporting_test_utils::ReportSendingResult::REPORTS_FAIL);
- // Send a report.
+ // Send a delayed report.
SendReport("report0");
test_helper()->WaitForRequestsDestroyed(
ReportExpectation::Failed({{"report0", RetryStatus::NOT_RETRIED}}));
@@ -417,11 +382,6 @@ IN_PROC_BROWSER_TEST_F(CertificateReportingServiceBrowserTest,
SendPendingReports();
test_helper()->WaitForRequestsDestroyed(
ReportExpectation::Successful({{"report1", RetryStatus::RETRIED}}));
-
- // report0 was submitted once, failed once, then cleared.
- // report1 was submitted twice, failed once, succeeded once.
- event_histogram_tester()->SetExpectedValues(
- 3 /* submitted */, 2 /* failed */, 1 /* successful */, 0 /* dropped */);
}
// CertificateReportingService should ignore reports older than the report TTL.
@@ -486,12 +446,6 @@ IN_PROC_BROWSER_TEST_F(CertificateReportingServiceBrowserTest,
// Send pending reports. report2 should be discarded since it's too old. No
// other reports remain. If any report is sent, test teardown will catch it.
SendPendingReports();
-
- // report0 was submitted once, failed once, dropped once.
- // report1 was submitted twice, failed twice, dropped once.
- // report2 was submitted twice, failed twice, dropped once.
- event_histogram_tester()->SetExpectedValues(
- 5 /* submitted */, 5 /* failed */, 0 /* successful */, 3 /* dropped */);
}
// CertificateReportingService should drop old reports from its pending report
@@ -566,13 +520,6 @@ IN_PROC_BROWSER_TEST_F(CertificateReportingServiceBrowserTest,
SendPendingReports();
test_helper()->WaitForRequestsDestroyed(ReportExpectation::Successful(
{{"report2", RetryStatus::RETRIED}, {"report3", RetryStatus::RETRIED}}));
-
- // report0 was submitted once, failed once, dropped once.
- // report1 was submitted twice, failed twice, dropped once.
- // report2 was submitted thrice, failed twice, succeeded once.
- // report3 was submitted thrice, failed twice, succeeded once.
- event_histogram_tester()->SetExpectedValues(
- 9 /* submitted */, 7 /* failed */, 2 /* successful */, 2 /* dropped */);
}
IN_PROC_BROWSER_TEST_F(CertificateReportingServiceBrowserTest,
@@ -596,10 +543,6 @@ IN_PROC_BROWSER_TEST_F(CertificateReportingServiceBrowserTest,
test_helper()->ResumeDelayedRequest();
test_helper()->WaitForRequestsDestroyed(
ReportExpectation::Delayed({{"report0", RetryStatus::NOT_RETRIED}}));
-
- // report0 was submitted once and succeeded once.
- event_histogram_tester()->SetExpectedValues(
- 1 /* submitted */, 0 /* failed */, 1 /* successful */, 0 /* dropped */);
}
// Same as above, but the service is shut down before resuming the delayed
@@ -624,10 +567,6 @@ IN_PROC_BROWSER_TEST_F(CertificateReportingServiceBrowserTest,
test_helper()->ResumeDelayedRequest();
test_helper()->WaitForRequestsDestroyed(
ReportExpectation::Delayed({{"report0", RetryStatus::NOT_RETRIED}}));
-
- // report0 was submitted once and never completed since the service shut down.
- event_histogram_tester()->SetExpectedValues(
- 1 /* submitted */, 0 /* failed */, 0 /* successful */, 0 /* dropped */);
}
// Trigger a delayed report, then disable Safebrowsing. Certificate reporting
@@ -668,11 +607,6 @@ IN_PROC_BROWSER_TEST_F(CertificateReportingServiceBrowserTest, Delayed_Reset) {
test_helper()->ResumeDelayedRequest();
test_helper()->WaitForRequestsDestroyed(
ReportExpectation::Delayed({{"report1", RetryStatus::NOT_RETRIED}}));
-
- // report0 was submitted once and delayed, then cleared.
- // report1 was submitted once and delayed, then succeeded.
- event_histogram_tester()->SetExpectedValues(
- 2 /* submitted */, 0 /* failed */, 1 /* successful */, 0 /* dropped */);
}
} // namespace safe_browsing

Powered by Google App Engine
This is Rietveld 408576698