| 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 7fe9642f2d3d7c70b3d773baf3039e6e868d6a9e..fdb1f9f38a288d148f86eb562cf89666bc32d548 100644
|
| --- a/net/http/transport_security_state_unittest.cc
|
| +++ b/net/http/transport_security_state_unittest.cc
|
| @@ -33,6 +33,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"
|
| @@ -43,6 +44,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"
|
| }
|
| @@ -398,8 +403,17 @@ void CheckExpectStapleReport(TransportSecurityState* state,
|
|
|
| class TransportSecurityStateTest : public testing::Test {
|
| public:
|
| + TransportSecurityStateTest() {
|
| + old_transport_security_state_source_ =
|
| + GetTransportSecurityStateSourceForTesting();
|
| +#if !BUILDFLAG(INCLUDE_TRANSPORT_SECURITY_STATE_PRELOAD_LIST)
|
| + SetTransportSecurityStateSourceForTesting(&test0::kHSTSSource);
|
| +#endif
|
| + }
|
| +
|
| ~TransportSecurityStateTest() override {
|
| - SetTransportSecurityStateSourceForTesting(nullptr);
|
| + SetTransportSecurityStateSourceForTesting(
|
| + old_transport_security_state_source_);
|
| }
|
|
|
| void SetUp() override {
|
| @@ -456,6 +470,9 @@ class TransportSecurityStateTest : public testing::Test {
|
| TransportSecurityState::ExpectStapleState* result) {
|
| return state->GetStaticExpectStapleState(host, result);
|
| }
|
| +
|
| + private:
|
| + const TransportSecurityStateSource* old_transport_security_state_source_;
|
| };
|
|
|
| TEST_F(TransportSecurityStateTest, DomainNameOddities) {
|
| @@ -1356,7 +1373,15 @@ static bool AddHash(const std::string& type_and_base64,
|
| return true;
|
| }
|
|
|
| -TEST_F(TransportSecurityStateTest, PinValidationWithoutRejectedCerts) {
|
| +// This test depends on the pinset of tor.
|
| +#if !BUILDFLAG(INCLUDE_TRANSPORT_SECURITY_STATE_PRELOAD_LIST)
|
| +#define MAYBE_PinValidationWithoutRejectedCerts \
|
| + DISABLED_PinValidationWithoutRejectedCerts
|
| +#else
|
| +#define MAYBE_PinValidationWithoutRejectedCerts \
|
| + PinValidationWithoutRejectedCerts
|
| +#endif
|
| +TEST_F(TransportSecurityStateTest, MAYBE_PinValidationWithoutRejectedCerts) {
|
| HashValueVector good_hashes, bad_hashes;
|
|
|
| for (size_t i = 0; kGoodPath[i]; i++) {
|
|
|