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

Unified Diff: net/http/transport_security_state_unittest.cc

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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/http/transport_security_state_static.json ('k') | net/http/url_security_manager_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 eb72050b400e6423ba3f32092f1b516f5bf5df10..cf5f2435b0263e6544664abcffd841af7cd4c322 100644
--- a/net/http/transport_security_state_unittest.cc
+++ b/net/http/transport_security_state_unittest.cc
@@ -299,7 +299,6 @@ TEST_F(TransportSecurityStateTest, Preloaded) {
EXPECT_TRUE(HasStaticState("paypal.com"));
EXPECT_FALSE(HasStaticState("www2.paypal.com"));
- EXPECT_FALSE(HasStaticState("www2.paypal.com"));
// Google hosts:
@@ -535,6 +534,24 @@ TEST_F(TransportSecurityStateTest, PreloadedPins) {
EXPECT_FALSE(domain_state.pkp.spki_hashes.empty());
EXPECT_TRUE(HasStaticPublicKeyPins("www.twitter.com"));
+
+ // Check that Facebook subdomains have pinning but not HSTS.
+ EXPECT_TRUE(state.GetStaticDomainState("facebook.com", &domain_state));
+ EXPECT_FALSE(domain_state.pkp.spki_hashes.empty());
+ EXPECT_TRUE(StaticShouldRedirect("facebook.com"));
+
+ EXPECT_TRUE(state.GetStaticDomainState("foo.facebook.com", &domain_state));
+ EXPECT_FALSE(domain_state.pkp.spki_hashes.empty());
+ EXPECT_FALSE(StaticShouldRedirect("foo.facebook.com"));
+
+ EXPECT_TRUE(state.GetStaticDomainState("www.facebook.com", &domain_state));
+ EXPECT_FALSE(domain_state.pkp.spki_hashes.empty());
+ EXPECT_TRUE(StaticShouldRedirect("www.facebook.com"));
+
+ EXPECT_TRUE(
+ state.GetStaticDomainState("foo.www.facebook.com", &domain_state));
+ EXPECT_FALSE(domain_state.pkp.spki_hashes.empty());
+ EXPECT_TRUE(StaticShouldRedirect("foo.www.facebook.com"));
}
TEST_F(TransportSecurityStateTest, LongNames) {
« no previous file with comments | « net/http/transport_security_state_static.json ('k') | net/http/url_security_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698