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

Unified Diff: net/http/transport_security_state_unittest.cc

Issue 103803012: Make HSTS headers not clobber preloaded pins. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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: net/http/transport_security_state_unittest.cc
diff --git a/net/http/transport_security_state_unittest.cc b/net/http/transport_security_state_unittest.cc
index 599bfb2b92c08e11327e6f50e4d17d671f6a2618..3d7d88f66ac40e97fa11c926b4763fab783e8e17 100644
--- a/net/http/transport_security_state_unittest.cc
+++ b/net/http/transport_security_state_unittest.cc
@@ -234,6 +234,17 @@ static bool OnlyPinning(const char *hostname) {
!domain_state.ShouldUpgradeToSSL();
}
+TEST_F(TransportSecurityStateTest, NoClobberPins) {
+ TransportSecurityState state;
+ TransportSecurityState::DomainState domain_state;
+
+ EXPECT_TRUE(state.GetDomainState("accounts.google.com", true, &domain_state));
+ EXPECT_TRUE(HasPublicKeyPins("accounts.google.com"));
+ EXPECT_TRUE(state.AddHSTSHeader("accounts.google.com",
+ "includesubdomains; max-age=1000000"));
+ EXPECT_TRUE(HasPublicKeyPins("accounts.google.com"));
+}
+
TEST_F(TransportSecurityStateTest, Preloaded) {
TransportSecurityState state;
TransportSecurityState::DomainState domain_state;
« net/http/transport_security_state.cc ('K') | « net/http/transport_security_state.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698