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

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

Issue 2916383005: Fix flaky CertificateReportingServiceBrowserTest.DontSendOldReports test (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c2654358ad2853d84e95729a20c2642072fb88d4..be1fa7ffa8aad785a361ece2d1d87ba3ad6f6410 100644
--- a/chrome/browser/safe_browsing/certificate_reporting_service_browsertest.cc
+++ b/chrome/browser/safe_browsing/certificate_reporting_service_browsertest.cc
@@ -388,15 +388,9 @@ IN_PROC_BROWSER_TEST_F(CertificateReportingServiceBrowserTest,
ReportExpectation::Successful({{"report1", RetryStatus::RETRIED}}));
}
-// Failing on some Win and Mac buildbots. See crbug.com/719138.
-#if defined(OS_WIN) || defined(OS_MACOSX)
-#define MAYBE_DontSendOldReports DISABLED_DontSendOldReports
-#else
-#define MAYBE_DontSendOldReports DontSendOldReports
-#endif
// CertificateReportingService should ignore reports older than the report TTL.
IN_PROC_BROWSER_TEST_F(CertificateReportingServiceBrowserTest,
- MAYBE_DontSendOldReports) {
+ DontSendOldReports) {
SetExpectedHistogramCountOnTeardown(5);
base::SimpleTestClock* clock = new base::SimpleTestClock();
@@ -456,6 +450,15 @@ 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();
+
+ // Let all reports succeed and send a single report. This is to make sure
+ // that any (incorrectly) pending reports are dropped before the test tear
+ // down.
+ test_helper()->SetFailureMode(certificate_reporting_test_utils::
+ ReportSendingResult::REPORTS_SUCCESSFUL);
+ SendReport("report3");
+ test_helper()->WaitForRequestsDestroyed(
+ ReportExpectation::Successful({{"report3", RetryStatus::NOT_RETRIED}}));
}
// CertificateReportingService should drop old reports from its pending report
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698