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

Unified Diff: chrome/browser/net/certificate_error_reporter_unittest.cc

Issue 935663004: Add checkbox for reporting invalid TLS/SSL cert chains (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: set callback to DoNothing close to where it's used Created 5 years, 9 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/net/certificate_error_reporter_unittest.cc
diff --git a/chrome/browser/net/certificate_error_reporter_unittest.cc b/chrome/browser/net/certificate_error_reporter_unittest.cc
index f890f97d5e760d353bd53b7e2184155bfae98f7a..36f60569fa835d974a0514cca4f848f4dd9d9fd5 100644
--- a/chrome/browser/net/certificate_error_reporter_unittest.cc
+++ b/chrome/browser/net/certificate_error_reporter_unittest.cc
@@ -174,12 +174,13 @@ TEST_F(CertificateErrorReporterTest, SendReportSendsRequest) {
GURL url = net::URLRequestMockDataJob::GetMockHttpsUrl("dummy data", 1);
network_delegate()->set_expected_url(url);
- CertificateErrorReporter reporter(context(), url);
+ scoped_refptr<CertificateErrorReporter> reporter =
+ new CertificateErrorReporter(context(), url);
EXPECT_EQ(0, network_delegate()->num_requests());
- reporter.SendReport(CertificateErrorReporter::REPORT_TYPE_PINNING_VIOLATION,
- kHostname, GetTestSSLInfo());
+ reporter->SendReport(CertificateErrorReporter::REPORT_TYPE_PINNING_VIOLATION,
+ kHostname, GetTestSSLInfo());
run_loop.Run();
EXPECT_EQ(1, network_delegate()->num_requests());
@@ -199,11 +200,11 @@ TEST_F(CertificateErrorReporterTest, PendingRequestGetsDeleted) {
EXPECT_EQ(0, network_delegate()->num_requests());
- scoped_ptr<CertificateErrorReporter> reporter(
+ scoped_refptr<CertificateErrorReporter> reporter(
new CertificateErrorReporter(context(), url));
reporter->SendReport(CertificateErrorReporter::REPORT_TYPE_PINNING_VIOLATION,
kHostname, GetTestSSLInfo());
- reporter.reset();
+ reporter = nullptr;
run_loop.Run();
@@ -221,9 +222,10 @@ TEST_F(CertificateErrorReporterTest, ErroredRequestGetsDeleted) {
EXPECT_EQ(0, network_delegate()->num_requests());
- CertificateErrorReporter reporter(context(), url);
- reporter.SendReport(CertificateErrorReporter::REPORT_TYPE_PINNING_VIOLATION,
- kHostname, GetTestSSLInfo());
+ scoped_refptr<CertificateErrorReporter> reporter =
+ new CertificateErrorReporter(context(), url);
+ reporter->SendReport(CertificateErrorReporter::REPORT_TYPE_PINNING_VIOLATION,
+ kHostname, GetTestSSLInfo());
run_loop.Run();
EXPECT_EQ(1, network_delegate()->num_requests());

Powered by Google App Engine
This is Rietveld 408576698