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 f7a79c75c51d0393976142082a82df4d93919945..810b3a1afbfba24cf7dc0ef12707d56cc6839a57 100644 |
--- a/net/http/transport_security_state_unittest.cc |
+++ b/net/http/transport_security_state_unittest.cc |
@@ -34,6 +34,7 @@ |
#include "net/cert/x509_certificate.h" |
#include "net/http/http_status_code.h" |
#include "net/http/http_util.h" |
+#include "net/net_features.h" |
#include "net/ssl/ssl_info.h" |
#include "net/test/cert_test_util.h" |
#include "net/test/test_data_directory.h" |
@@ -44,6 +45,10 @@ namespace net { |
namespace { |
+namespace test0 { |
+#include "net/http/transport_security_state_static_unittest0.h" |
+} |
+ |
namespace test1 { |
#include "net/http/transport_security_state_static_unittest1.h" |
} |
@@ -401,6 +406,12 @@ void CheckExpectStapleReport(TransportSecurityState* state, |
class TransportSecurityStateTest : public testing::Test { |
public: |
+ TransportSecurityStateTest() { |
+#if !BUILDFLAG(INCLUDE_TRANSPORT_SECURITY_STATE_PRELOAD_LIST) |
+ SetTransportSecurityStateSourceForTesting(&test0::kHSTSSource); |
+#endif |
+ } |
+ |
~TransportSecurityStateTest() override { |
SetTransportSecurityStateSourceForTesting(nullptr); |
} |
@@ -1360,6 +1371,11 @@ static bool AddHash(const std::string& type_and_base64, |
} |
TEST_F(TransportSecurityStateTest, PinValidationWithoutRejectedCerts) { |
+// This test depends on the pinset of tor. |
+#if !BUILDFLAG(INCLUDE_TRANSPORT_SECURITY_STATE_PRELOAD_LIST) |
+ return; |
+#endif |
+ |
HashValueVector good_hashes, bad_hashes; |
for (size_t i = 0; kGoodPath[i]; i++) { |