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 9c2db43241de41550e57e07bd511bfd1a293681d..57c1857b39cc2f6c59faecaad2248408a04a43ac 100644 |
--- a/net/http/transport_security_state_unittest.cc |
+++ b/net/http/transport_security_state_unittest.cc |
@@ -1273,6 +1273,24 @@ TEST_F(TransportSecurityStateTest, HPKPReporting) { |
EXPECT_EQ(std::string(), mock_report_sender.latest_report()); |
EXPECT_FALSE(state.CheckPublicKeyPins( |
+ host_port_pair, false, bad_hashes, cert1.get(), cert2.get(), |
+ TransportSecurityState::ENABLE_PIN_REPORTS, &failure_log)); |
+ |
+ // No report should have been sent because the certificate chained to a |
+ // non-public root |
+ EXPECT_EQ(GURL(), mock_report_sender.latest_report_uri()); |
+ EXPECT_EQ(std::string(), mock_report_sender.latest_report()); |
+ |
+ EXPECT_TRUE(state.CheckPublicKeyPins( |
+ host_port_pair, false, good_hashes, cert1.get(), cert2.get(), |
+ TransportSecurityState::ENABLE_PIN_REPORTS, &failure_log)); |
+ |
+ // No report should have been sent because there was no violation, even though |
+ // the certificate chained to a local trust anchor. |
+ EXPECT_EQ(GURL(), mock_report_sender.latest_report_uri()); |
+ EXPECT_EQ(std::string(), mock_report_sender.latest_report()); |
+ |
+ EXPECT_FALSE(state.CheckPublicKeyPins( |
host_port_pair, true, bad_hashes, cert1.get(), cert2.get(), |
TransportSecurityState::ENABLE_PIN_REPORTS, &failure_log)); |