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

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

Issue 1134283003: Add HTTP certificate report URL with Finch gate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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 | « chrome/browser/net/certificate_error_reporter.cc ('k') | chrome/browser/safe_browsing/ping_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8641e5e471a2d14c22eb85a20472a3bf9151e930..6804e2721d45ccaa55df57d0cdd1972346d3fc6f 100644
--- a/chrome/browser/net/certificate_error_reporter_unittest.cc
+++ b/chrome/browser/net/certificate_error_reporter_unittest.cc
@@ -11,7 +11,9 @@
#include "base/bind_helpers.h"
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
+#include "base/metrics/field_trial.h"
#include "base/run_loop.h"
+#include "base/test/mock_entropy_provider.h"
#include "base/thread_task_runner_handle.h"
#include "chrome/browser/net/encrypted_cert_logger.pb.h"
#include "chrome/common/chrome_paths.h"
@@ -324,6 +326,30 @@ TEST_F(CertificateErrorReporterTest, ErroredRequestGetsDeleted) {
CertificateErrorReporter::REPORT_TYPE_PINNING_VIOLATION);
}
+// Test that the Finch config correctly controls whether the reporter
+// supports HTTP uploads.
+TEST_F(CertificateErrorReporterTest, FinchConfigDisablesHttpUploads) {
+ base::FieldTrialList field_trial_list(new base::MockEntropyProvider());
+ ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
+ chrome_browser_net::kHttpCertificateUploadExperiment,
+ "not the right group"));
+
+ EXPECT_FALSE(CertificateErrorReporter::IsHttpUploadUrlSupported());
+}
+
+TEST_F(CertificateErrorReporterTest, FinchConfigPossiblyEnablesHttpUploads) {
+ base::FieldTrialList field_trial_list(new base::MockEntropyProvider());
+ ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
+ chrome_browser_net::kHttpCertificateUploadExperiment,
+ chrome_browser_net::kHttpCertificateUploadGroup));
+
+#if defined(USE_OPENSSL)
+ EXPECT_TRUE(CertificateErrorReporter::IsHttpUploadUrlSupported());
+#else
+ EXPECT_FALSE(CertificateErrorReporter::IsHttpUploadUrlSupported());
+#endif
+}
+
// Test that cookies are sent or not sent according to the error
// reporter's cookies preference.
« no previous file with comments | « chrome/browser/net/certificate_error_reporter.cc ('k') | chrome/browser/safe_browsing/ping_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698