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

Unified Diff: net/http/transport_security_state_unittest.cc

Issue 2906633003: Add a build flag to configure bundling of HSTS preload list (Closed)
Patch Set: add one missing file and address lgarron comments Created 3 years, 5 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
« no previous file with comments | « net/http/transport_security_state_static_unittest0.json ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3fcb7dd34fa87b968dd0987590d2e733e9aae393 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,6 +403,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);
}
@@ -1356,7 +1367,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++) {
« no previous file with comments | « net/http/transport_security_state_static_unittest0.json ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698