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

Unified Diff: chrome/browser/io_thread_unittest.cc

Issue 2753123002: Add --ignore-certificate-errors-spki-list switch and UMA histogram. (Closed)
Patch Set: Add --ignore-certificate-errors-spki-list switch and UMA histogram. Created 3 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/io_thread_unittest.cc
diff --git a/chrome/browser/io_thread_unittest.cc b/chrome/browser/io_thread_unittest.cc
index 352d037b4cb9cd90cda2156008ac01088131441a..21e71ce46352fb820f4cd606454766ce922deb91 100644
--- a/chrome/browser/io_thread_unittest.cc
+++ b/chrome/browser/io_thread_unittest.cc
@@ -457,6 +457,23 @@ TEST_F(ConfigureParamsFromFieldTrialsAndCommandLineTest,
EXPECT_TRUE(params_.ignore_certificate_errors);
}
+TEST_F(ConfigureParamsFromFieldTrialsAndCommandLineTest,
+ DisableCertificateErrorsSPKIList) {
+ const std::string spki = "BZef6CjpE0HUDfp5ra3F3soQ9kkFxZoBo5PiK1hpudI=";
+ command_line_.AppendSwitchASCII("ignore-certificate-errors-spki-list",
+ "foo," + spki);
+ net::HashValue hash(net::HASH_VALUE_SHA256);
+ ASSERT_TRUE(hash.FromString("sha256/" + spki));
+ net::SHA256HashValue sha256;
+ memcpy(&sha256, hash.data(), sizeof(sha256));
+
+ ConfigureParamsFromFieldTrialsAndCommandLine();
+
+ EXPECT_EQ(1u, params_.ignore_certificate_error_spki_set.size());
+ EXPECT_TRUE(
+ base::ContainsKey(params_.ignore_certificate_error_spki_set, sha256));
+}
+
TEST_F(ConfigureParamsFromFieldTrialsAndCommandLineTest, TestingFixedPort) {
command_line_.AppendSwitchASCII("testing-fixed-http-port", "42");
command_line_.AppendSwitchASCII("testing-fixed-https-port", "137");

Powered by Google App Engine
This is Rietveld 408576698