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

Unified Diff: net/tools/transport_security_state_generator/input_file_parsers_unittest.cc

Issue 2924583002: Handle Windows style line-endings in transport_security_state_static.pins. (Closed)
Patch Set: Created 3 years, 6 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 | « net/tools/transport_security_state_generator/input_file_parsers.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/transport_security_state_generator/input_file_parsers_unittest.cc
diff --git a/net/tools/transport_security_state_generator/input_file_parsers_unittest.cc b/net/tools/transport_security_state_generator/input_file_parsers_unittest.cc
index 733a6fb7ebb1e970827cb941b2fd5ddc0df9b569..33f7eff57a192623bb29fa1466d7f42bb8278540 100644
--- a/net/tools/transport_security_state_generator/input_file_parsers_unittest.cc
+++ b/net/tools/transport_security_state_generator/input_file_parsers_unittest.cc
@@ -339,6 +339,19 @@ TEST(InputFileParsersTest, ParseCertificatesFileInvalidCertificateName) {
EXPECT_TRUE(ParseCertificatesFile(valid, &pinsets));
}
+// Test that parsing the pins file with Windows line-endings works.
+TEST(InputFileParsersTest, ParseCertificatesFileWindowLineEndings) {
+ Pinsets pinsets;
+
+ std::string windows_line_endings =
+ "TestSPKI\r\n"
+ "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\r\n";
+ EXPECT_TRUE(ParseCertificatesFile(windows_line_endings, &pinsets));
+
+ const SPKIHashMap& hashes = pinsets.spki_hashes();
+ EXPECT_NE(hashes.cend(), hashes.find("TestSPKI"));
+}
+
} // namespace
} // namespace transport_security_state
« no previous file with comments | « net/tools/transport_security_state_generator/input_file_parsers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698