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 3c81c69789b8f8c9d75262c02ba12f6e58a6dc71..8283aa34b65b58e3f9e61df04d0117a7fa04bbae 100644 |
--- a/net/base/transport_security_state_unittest.cc |
+++ b/net/base/transport_security_state_unittest.cc |
@@ -281,6 +281,23 @@ TEST_F(TransportSecurityStateTest, DeleteSince) { |
EXPECT_FALSE(state->IsEnabledForHost(&domain_state, "google.com")); |
} |
+TEST_F(TransportSecurityStateTest, DeleteHost) { |
+ scoped_refptr<TransportSecurityState> state( |
+ new TransportSecurityState); |
+ |
+ TransportSecurityState::DomainState domain_state; |
+ const base::Time current_time(base::Time::Now()); |
+ const base::Time expiry = current_time + base::TimeDelta::FromSeconds(1000); |
+ domain_state.mode = TransportSecurityState::DomainState::MODE_STRICT; |
+ domain_state.expiry = expiry; |
+ state->EnableHost("google.com", domain_state); |
+ |
+ EXPECT_TRUE(state->IsEnabledForHost(&domain_state, "google.com")); |
+ EXPECT_FALSE(state->IsEnabledForHost(&domain_state, "example.com")); |
+ EXPECT_TRUE(state->DeleteHost("google.com")); |
+ EXPECT_FALSE(state->IsEnabledForHost(&domain_state, "google.com")); |
+} |
+ |
TEST_F(TransportSecurityStateTest, SerialiseOld) { |
scoped_refptr<TransportSecurityState> state( |
new TransportSecurityState); |
@@ -331,6 +348,7 @@ TEST_F(TransportSecurityStateTest, Preloaded) { |
EXPECT_TRUE(state->IsEnabledForHost(&domain_state, "www.paypal.com")); |
EXPECT_EQ(domain_state.mode, |
TransportSecurityState::DomainState::MODE_STRICT); |
+ EXPECT_TRUE(domain_state.preloaded); |
EXPECT_FALSE(domain_state.include_subdomains); |
EXPECT_FALSE(state->IsEnabledForHost(&domain_state, "www2.paypal.com")); |
EXPECT_FALSE(state->IsEnabledForHost(&domain_state, "a.www.paypal.com")); |
@@ -370,6 +388,10 @@ TEST_F(TransportSecurityStateTest, Preloaded) { |
EXPECT_TRUE(state->IsEnabledForHost(&domain_state, "splendidbacon.com")); |
EXPECT_TRUE(state->IsEnabledForHost(&domain_state, "www.splendidbacon.com")); |
EXPECT_TRUE(state->IsEnabledForHost(&domain_state, "foo.splendidbacon.com")); |
+ |
+ EXPECT_TRUE(state->IsEnabledForHost(&domain_state, "chrome.google.com")); |
+ EXPECT_TRUE(state->IsEnabledForHost(&domain_state, "checkout.google.com")); |
+ EXPECT_TRUE(state->IsEnabledForHost(&domain_state, "health.google.com")); |
} |
TEST_F(TransportSecurityStateTest, LongNames) { |