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

Unified Diff: net/base/transport_security_state_unittest.cc

Issue 8084008: net: add certificate pins for Twitter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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: net/base/transport_security_state_unittest.cc
diff --git a/net/base/transport_security_state_unittest.cc b/net/base/transport_security_state_unittest.cc
index 316902573520f2a7e45da3e3466903d1ff2834a2..bd4572c48e675ebfdaac22e64d19bf14a07f5937 100644
--- a/net/base/transport_security_state_unittest.cc
+++ b/net/base/transport_security_state_unittest.cc
@@ -706,6 +706,16 @@ TEST_F(TransportSecurityStateTest, Preloaded) {
EXPECT_FALSE(state.IsEnabledForHost(&domain_state,
"foo.greplin.com",
false));
+
+#if defined(OS_CHROMEOS)
+ EXPECT_TRUE(state.IsEnabledForHost(&domain_state,
+ "twitter.com",
+ false));
+#else
+ EXPECT_FALSE(state.IsEnabledForHost(&domain_state,
+ "twitter.com",
+ false));
+#endif
}
TEST_F(TransportSecurityStateTest, LongNames) {
@@ -760,7 +770,6 @@ TEST_F(TransportSecurityStateTest, BuiltinCertPins) {
// This essential checks that a built-in list does exist.
EXPECT_FALSE(domain_state.IsChainOfPublicKeysPermitted(hashes));
EXPECT_FALSE(state.HasPinsForHost(&domain_state, "www.paypal.com", true));
- EXPECT_FALSE(state.HasPinsForHost(&domain_state, "twitter.com", true));
EXPECT_TRUE(state.HasPinsForHost(&domain_state, "docs.google.com", true));
EXPECT_TRUE(state.HasPinsForHost(&domain_state, "1.docs.google.com", true));
@@ -803,6 +812,18 @@ TEST_F(TransportSecurityStateTest, BuiltinCertPins) {
EXPECT_TRUE(state.HasPinsForHost(&domain_state,
"ssl.google-analytics.com",
true));
+
+ EXPECT_TRUE(state.HasPinsForHost(&domain_state, "twitter.com", true));
+ EXPECT_FALSE(state.HasPinsForHost(&domain_state, "foo.twitter.com", true));
+ EXPECT_TRUE(state.HasPinsForHost(&domain_state, "www.twitter.com", true));
+ EXPECT_TRUE(state.HasPinsForHost(&domain_state, "api.twitter.com", true));
+ EXPECT_TRUE(state.HasPinsForHost(&domain_state, "oauth.twitter.com", true));
+ EXPECT_TRUE(state.HasPinsForHost(&domain_state, "mobile.twitter.com", true));
+ EXPECT_TRUE(state.HasPinsForHost(&domain_state, "dev.twitter.com", true));
+ EXPECT_TRUE(state.HasPinsForHost(&domain_state, "business.twitter.com", true));
+ EXPECT_TRUE(state.HasPinsForHost(&domain_state, "platform.twitter.com", true));
+ EXPECT_TRUE(state.HasPinsForHost(&domain_state, "si0.twimg.com", true));
+ EXPECT_TRUE(state.HasPinsForHost(&domain_state, "twimg0-a.akamaihd.net", true));
}
TEST_F(TransportSecurityStateTest, OptionalHSTSCertPins) {
« net/base/transport_security_state.cc ('K') | « net/base/transport_security_state.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698