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

Unified Diff: net/http/http_security_headers_unittest.cc

Issue 2906633003: Add a build flag to configure bundling of HSTS preload list (Closed)
Patch Set: change flag to INCLUDE_TRANSPORT_SECURITY_STATE_PRELOAD_LIST Created 3 years, 6 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
Index: net/http/http_security_headers_unittest.cc
diff --git a/net/http/http_security_headers_unittest.cc b/net/http/http_security_headers_unittest.cc
index 2ddd6b1cdbf1f9b702e0c0635b38301419bb6972..aa1eef69889169093b1fd078c250e8f271695f26 100644
--- a/net/http/http_security_headers_unittest.cc
+++ b/net/http/http_security_headers_unittest.cc
@@ -653,6 +653,9 @@ TEST_F(HttpSecurityHeadersTest, ValidPKPHeadersSHA256) {
}
TEST_F(HttpSecurityHeadersTest, UpdateDynamicPKPOnly) {
+#if !BUILDFLAG(INCLUDE_TRANSPORT_SECURITY_STATE_PRELOAD_LIST)
+ return;
+#endif
Ryan Sleevi 2017/06/29 20:47:40 To better allow the compiler to optimize this out,
xunjieli 2017/06/30 19:12:18 Done.
TransportSecurityState state;
TransportSecurityState::STSState static_sts_state;
TransportSecurityState::PKPState static_pkp_state;
@@ -729,6 +732,9 @@ TEST_F(HttpSecurityHeadersTest, UpdateDynamicPKPOnly) {
}
TEST_F(HttpSecurityHeadersTest, UpdateDynamicPKPMaxAge0) {
+#if !BUILDFLAG(INCLUDE_TRANSPORT_SECURITY_STATE_PRELOAD_LIST)
+ return;
+#endif
TransportSecurityState state;
TransportSecurityState::STSState static_sts_state;
TransportSecurityState::PKPState static_pkp_state;
@@ -807,6 +813,9 @@ TEST_F(HttpSecurityHeadersTest, UpdateDynamicPKPMaxAge0) {
// dynamic HSTS header does not clobber the static HPKP entry. Further, adding a
// dynamic HPKP entry could not affect the HSTS entry for the site.
TEST_F(HttpSecurityHeadersTest, NoClobberPins) {
+#if !BUILDFLAG(INCLUDE_TRANSPORT_SECURITY_STATE_PRELOAD_LIST)
+ return;
+#endif
TransportSecurityState state;
TransportSecurityState::STSState sts_state;
TransportSecurityState::PKPState pkp_state;

Powered by Google App Engine
This is Rietveld 408576698