| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shlobj.h> | 9 #include <shlobj.h> |
| 10 #endif | 10 #endif |
| (...skipping 4942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4953 TestDelegate d; | 4953 TestDelegate d; |
| 4954 URLRequest request(https_test_server.GetURL("files/hsts-headers.html"), | 4954 URLRequest request(https_test_server.GetURL("files/hsts-headers.html"), |
| 4955 DEFAULT_PRIORITY, | 4955 DEFAULT_PRIORITY, |
| 4956 &d, | 4956 &d, |
| 4957 &default_context_); | 4957 &default_context_); |
| 4958 request.Start(); | 4958 request.Start(); |
| 4959 base::RunLoop().Run(); | 4959 base::RunLoop().Run(); |
| 4960 | 4960 |
| 4961 TransportSecurityState* security_state = | 4961 TransportSecurityState* security_state = |
| 4962 default_context_.transport_security_state(); | 4962 default_context_.transport_security_state(); |
| 4963 bool sni_available = true; | |
| 4964 TransportSecurityState::DomainState domain_state; | 4963 TransportSecurityState::DomainState domain_state; |
| 4965 EXPECT_TRUE(security_state->GetDomainState( | 4964 EXPECT_TRUE(security_state->GetDynamicDomainState( |
| 4966 SpawnedTestServer::kLocalhost, sni_available, &domain_state)); | 4965 SpawnedTestServer::kLocalhost, &domain_state)); |
| 4967 EXPECT_EQ(TransportSecurityState::DomainState::MODE_FORCE_HTTPS, | 4966 EXPECT_EQ(TransportSecurityState::DomainState::MODE_FORCE_HTTPS, |
| 4968 domain_state.upgrade_mode); | 4967 domain_state.sts.upgrade_mode); |
| 4969 EXPECT_TRUE(domain_state.sts_include_subdomains); | 4968 EXPECT_TRUE(domain_state.sts.include_subdomains); |
| 4970 EXPECT_FALSE(domain_state.pkp_include_subdomains); | 4969 EXPECT_FALSE(domain_state.pkp.include_subdomains); |
| 4971 #if defined(OS_ANDROID) | 4970 #if defined(OS_ANDROID) |
| 4972 // Android's CertVerifyProc does not (yet) handle pins. | 4971 // Android's CertVerifyProc does not (yet) handle pins. |
| 4973 #else | 4972 #else |
| 4974 EXPECT_FALSE(domain_state.HasPublicKeyPins()); | 4973 EXPECT_FALSE(domain_state.HasPublicKeyPins()); |
| 4975 #endif | 4974 #endif |
| 4976 } | 4975 } |
| 4977 | 4976 |
| 4978 // Android's CertVerifyProc does not (yet) handle pins. Therefore, it will | 4977 // Android's CertVerifyProc does not (yet) handle pins. Therefore, it will |
| 4979 // reject HPKP headers, and a test setting only HPKP headers will fail (no | 4978 // reject HPKP headers, and a test setting only HPKP headers will fail (no |
| 4980 // DomainState present because header rejected). | 4979 // DomainState present because header rejected). |
| (...skipping 16 matching lines...) Expand all Loading... |
| 4997 TestDelegate d; | 4996 TestDelegate d; |
| 4998 URLRequest request(https_test_server.GetURL("files/hpkp-headers.html"), | 4997 URLRequest request(https_test_server.GetURL("files/hpkp-headers.html"), |
| 4999 DEFAULT_PRIORITY, | 4998 DEFAULT_PRIORITY, |
| 5000 &d, | 4999 &d, |
| 5001 &default_context_); | 5000 &default_context_); |
| 5002 request.Start(); | 5001 request.Start(); |
| 5003 base::RunLoop().Run(); | 5002 base::RunLoop().Run(); |
| 5004 | 5003 |
| 5005 TransportSecurityState* security_state = | 5004 TransportSecurityState* security_state = |
| 5006 default_context_.transport_security_state(); | 5005 default_context_.transport_security_state(); |
| 5007 bool sni_available = true; | |
| 5008 TransportSecurityState::DomainState domain_state; | 5006 TransportSecurityState::DomainState domain_state; |
| 5009 EXPECT_TRUE(security_state->GetDomainState( | 5007 EXPECT_TRUE(security_state->GetDynamicDomainState( |
| 5010 SpawnedTestServer::kLocalhost, sni_available, &domain_state)); | 5008 SpawnedTestServer::kLocalhost, &domain_state)); |
| 5011 EXPECT_EQ(TransportSecurityState::DomainState::MODE_DEFAULT, | 5009 EXPECT_EQ(TransportSecurityState::DomainState::MODE_DEFAULT, |
| 5012 domain_state.upgrade_mode); | 5010 domain_state.sts.upgrade_mode); |
| 5013 EXPECT_FALSE(domain_state.sts_include_subdomains); | 5011 EXPECT_FALSE(domain_state.sts.include_subdomains); |
| 5014 EXPECT_FALSE(domain_state.pkp_include_subdomains); | 5012 EXPECT_FALSE(domain_state.pkp.include_subdomains); |
| 5015 EXPECT_TRUE(domain_state.HasPublicKeyPins()); | 5013 EXPECT_TRUE(domain_state.HasPublicKeyPins()); |
| 5016 EXPECT_NE(domain_state.upgrade_expiry, | 5014 EXPECT_NE(domain_state.sts.expiry, domain_state.pkp.expiry); |
| 5017 domain_state.dynamic_spki_hashes_expiry); | |
| 5018 } | 5015 } |
| 5019 | 5016 |
| 5020 TEST_F(URLRequestTestHTTP, ProcessSTSOnce) { | 5017 TEST_F(URLRequestTestHTTP, ProcessSTSOnce) { |
| 5021 SpawnedTestServer::SSLOptions ssl_options; | 5018 SpawnedTestServer::SSLOptions ssl_options; |
| 5022 SpawnedTestServer https_test_server( | 5019 SpawnedTestServer https_test_server( |
| 5023 SpawnedTestServer::TYPE_HTTPS, | 5020 SpawnedTestServer::TYPE_HTTPS, |
| 5024 ssl_options, | 5021 ssl_options, |
| 5025 base::FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))); | 5022 base::FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))); |
| 5026 ASSERT_TRUE(https_test_server.Start()); | 5023 ASSERT_TRUE(https_test_server.Start()); |
| 5027 | 5024 |
| 5028 TestDelegate d; | 5025 TestDelegate d; |
| 5029 URLRequest request( | 5026 URLRequest request( |
| 5030 https_test_server.GetURL("files/hsts-multiple-headers.html"), | 5027 https_test_server.GetURL("files/hsts-multiple-headers.html"), |
| 5031 DEFAULT_PRIORITY, | 5028 DEFAULT_PRIORITY, |
| 5032 &d, | 5029 &d, |
| 5033 &default_context_); | 5030 &default_context_); |
| 5034 request.Start(); | 5031 request.Start(); |
| 5035 base::RunLoop().Run(); | 5032 base::RunLoop().Run(); |
| 5036 | 5033 |
| 5037 // We should have set parameters from the first header, not the second. | 5034 // We should have set parameters from the first header, not the second. |
| 5038 TransportSecurityState* security_state = | 5035 TransportSecurityState* security_state = |
| 5039 default_context_.transport_security_state(); | 5036 default_context_.transport_security_state(); |
| 5040 bool sni_available = true; | |
| 5041 TransportSecurityState::DomainState domain_state; | 5037 TransportSecurityState::DomainState domain_state; |
| 5042 EXPECT_TRUE(security_state->GetDomainState( | 5038 EXPECT_TRUE(security_state->GetDynamicDomainState( |
| 5043 SpawnedTestServer::kLocalhost, sni_available, &domain_state)); | 5039 SpawnedTestServer::kLocalhost, &domain_state)); |
| 5044 EXPECT_EQ(TransportSecurityState::DomainState::MODE_FORCE_HTTPS, | 5040 EXPECT_EQ(TransportSecurityState::DomainState::MODE_FORCE_HTTPS, |
| 5045 domain_state.upgrade_mode); | 5041 domain_state.sts.upgrade_mode); |
| 5046 EXPECT_FALSE(domain_state.sts_include_subdomains); | 5042 EXPECT_FALSE(domain_state.sts.include_subdomains); |
| 5047 EXPECT_FALSE(domain_state.pkp_include_subdomains); | 5043 EXPECT_FALSE(domain_state.pkp.include_subdomains); |
| 5048 } | 5044 } |
| 5049 | 5045 |
| 5050 TEST_F(URLRequestTestHTTP, ProcessSTSAndPKP) { | 5046 TEST_F(URLRequestTestHTTP, ProcessSTSAndPKP) { |
| 5051 SpawnedTestServer::SSLOptions ssl_options; | 5047 SpawnedTestServer::SSLOptions ssl_options; |
| 5052 SpawnedTestServer https_test_server( | 5048 SpawnedTestServer https_test_server( |
| 5053 SpawnedTestServer::TYPE_HTTPS, | 5049 SpawnedTestServer::TYPE_HTTPS, |
| 5054 ssl_options, | 5050 ssl_options, |
| 5055 base::FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))); | 5051 base::FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))); |
| 5056 ASSERT_TRUE(https_test_server.Start()); | 5052 ASSERT_TRUE(https_test_server.Start()); |
| 5057 | 5053 |
| 5058 TestDelegate d; | 5054 TestDelegate d; |
| 5059 URLRequest request( | 5055 URLRequest request( |
| 5060 https_test_server.GetURL("files/hsts-and-hpkp-headers.html"), | 5056 https_test_server.GetURL("files/hsts-and-hpkp-headers.html"), |
| 5061 DEFAULT_PRIORITY, | 5057 DEFAULT_PRIORITY, |
| 5062 &d, | 5058 &d, |
| 5063 &default_context_); | 5059 &default_context_); |
| 5064 request.Start(); | 5060 request.Start(); |
| 5065 base::RunLoop().Run(); | 5061 base::RunLoop().Run(); |
| 5066 | 5062 |
| 5067 // We should have set parameters from the first header, not the second. | 5063 // We should have set parameters from the first header, not the second. |
| 5068 TransportSecurityState* security_state = | 5064 TransportSecurityState* security_state = |
| 5069 default_context_.transport_security_state(); | 5065 default_context_.transport_security_state(); |
| 5070 bool sni_available = true; | |
| 5071 TransportSecurityState::DomainState domain_state; | 5066 TransportSecurityState::DomainState domain_state; |
| 5072 EXPECT_TRUE(security_state->GetDomainState( | 5067 EXPECT_TRUE(security_state->GetDynamicDomainState( |
| 5073 SpawnedTestServer::kLocalhost, sni_available, &domain_state)); | 5068 SpawnedTestServer::kLocalhost, &domain_state)); |
| 5074 EXPECT_EQ(TransportSecurityState::DomainState::MODE_FORCE_HTTPS, | 5069 EXPECT_EQ(TransportSecurityState::DomainState::MODE_FORCE_HTTPS, |
| 5075 domain_state.upgrade_mode); | 5070 domain_state.sts.upgrade_mode); |
| 5076 #if defined(OS_ANDROID) | 5071 #if defined(OS_ANDROID) |
| 5077 // Android's CertVerifyProc does not (yet) handle pins. | 5072 // Android's CertVerifyProc does not (yet) handle pins. |
| 5078 #else | 5073 #else |
| 5079 EXPECT_TRUE(domain_state.HasPublicKeyPins()); | 5074 EXPECT_TRUE(domain_state.HasPublicKeyPins()); |
| 5080 #endif | 5075 #endif |
| 5081 EXPECT_NE(domain_state.upgrade_expiry, | 5076 EXPECT_NE(domain_state.sts.expiry, domain_state.pkp.expiry); |
| 5082 domain_state.dynamic_spki_hashes_expiry); | |
| 5083 | 5077 |
| 5084 // Even though there is an HSTS header asserting includeSubdomains, it is | 5078 // Even though there is an HSTS header asserting includeSubdomains, it is |
| 5085 // the *second* such header, and we MUST process only the first. | 5079 // the *second* such header, and we MUST process only the first. |
| 5086 EXPECT_FALSE(domain_state.sts_include_subdomains); | 5080 EXPECT_FALSE(domain_state.sts.include_subdomains); |
| 5087 // includeSubdomains does not occur in the test HPKP header. | 5081 // includeSubdomains does not occur in the test HPKP header. |
| 5088 EXPECT_FALSE(domain_state.pkp_include_subdomains); | 5082 EXPECT_FALSE(domain_state.pkp.include_subdomains); |
| 5089 } | 5083 } |
| 5090 | 5084 |
| 5091 // Tests that when multiple HPKP headers are present, asserting different | 5085 // Tests that when multiple HPKP headers are present, asserting different |
| 5092 // policies, that only the first such policy is processed. | 5086 // policies, that only the first such policy is processed. |
| 5093 TEST_F(URLRequestTestHTTP, ProcessSTSAndPKP2) { | 5087 TEST_F(URLRequestTestHTTP, ProcessSTSAndPKP2) { |
| 5094 SpawnedTestServer::SSLOptions ssl_options; | 5088 SpawnedTestServer::SSLOptions ssl_options; |
| 5095 SpawnedTestServer https_test_server( | 5089 SpawnedTestServer https_test_server( |
| 5096 SpawnedTestServer::TYPE_HTTPS, | 5090 SpawnedTestServer::TYPE_HTTPS, |
| 5097 ssl_options, | 5091 ssl_options, |
| 5098 base::FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))); | 5092 base::FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))); |
| 5099 ASSERT_TRUE(https_test_server.Start()); | 5093 ASSERT_TRUE(https_test_server.Start()); |
| 5100 | 5094 |
| 5101 TestDelegate d; | 5095 TestDelegate d; |
| 5102 URLRequest request( | 5096 URLRequest request( |
| 5103 https_test_server.GetURL("files/hsts-and-hpkp-headers2.html"), | 5097 https_test_server.GetURL("files/hsts-and-hpkp-headers2.html"), |
| 5104 DEFAULT_PRIORITY, | 5098 DEFAULT_PRIORITY, |
| 5105 &d, | 5099 &d, |
| 5106 &default_context_); | 5100 &default_context_); |
| 5107 request.Start(); | 5101 request.Start(); |
| 5108 base::RunLoop().Run(); | 5102 base::RunLoop().Run(); |
| 5109 | 5103 |
| 5110 TransportSecurityState* security_state = | 5104 TransportSecurityState* security_state = |
| 5111 default_context_.transport_security_state(); | 5105 default_context_.transport_security_state(); |
| 5112 bool sni_available = true; | |
| 5113 TransportSecurityState::DomainState domain_state; | 5106 TransportSecurityState::DomainState domain_state; |
| 5114 EXPECT_TRUE(security_state->GetDomainState( | 5107 EXPECT_TRUE(security_state->GetDynamicDomainState( |
| 5115 SpawnedTestServer::kLocalhost, sni_available, &domain_state)); | 5108 SpawnedTestServer::kLocalhost, &domain_state)); |
| 5116 EXPECT_EQ(TransportSecurityState::DomainState::MODE_FORCE_HTTPS, | 5109 EXPECT_EQ(TransportSecurityState::DomainState::MODE_FORCE_HTTPS, |
| 5117 domain_state.upgrade_mode); | 5110 domain_state.sts.upgrade_mode); |
| 5118 #if defined(OS_ANDROID) | 5111 #if defined(OS_ANDROID) |
| 5119 // Android's CertVerifyProc does not (yet) handle pins. | 5112 // Android's CertVerifyProc does not (yet) handle pins. |
| 5120 #else | 5113 #else |
| 5121 EXPECT_TRUE(domain_state.HasPublicKeyPins()); | 5114 EXPECT_TRUE(domain_state.HasPublicKeyPins()); |
| 5122 #endif | 5115 #endif |
| 5123 EXPECT_NE(domain_state.upgrade_expiry, | 5116 EXPECT_NE(domain_state.sts.expiry, domain_state.pkp.expiry); |
| 5124 domain_state.dynamic_spki_hashes_expiry); | |
| 5125 | 5117 |
| 5126 EXPECT_TRUE(domain_state.sts_include_subdomains); | 5118 EXPECT_TRUE(domain_state.sts.include_subdomains); |
| 5127 EXPECT_FALSE(domain_state.pkp_include_subdomains); | 5119 EXPECT_FALSE(domain_state.pkp.include_subdomains); |
| 5128 } | 5120 } |
| 5129 | 5121 |
| 5130 TEST_F(URLRequestTestHTTP, ContentTypeNormalizationTest) { | 5122 TEST_F(URLRequestTestHTTP, ContentTypeNormalizationTest) { |
| 5131 ASSERT_TRUE(test_server_.Start()); | 5123 ASSERT_TRUE(test_server_.Start()); |
| 5132 | 5124 |
| 5133 TestDelegate d; | 5125 TestDelegate d; |
| 5134 URLRequest req(test_server_.GetURL("files/content-type-normalization.html"), | 5126 URLRequest req(test_server_.GetURL("files/content-type-normalization.html"), |
| 5135 DEFAULT_PRIORITY, | 5127 DEFAULT_PRIORITY, |
| 5136 &d, | 5128 &d, |
| 5137 &default_context_); | 5129 &default_context_); |
| (...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6655 // The actual problem -- CERT_MISMATCHED_NAME in this case -- doesn't | 6647 // The actual problem -- CERT_MISMATCHED_NAME in this case -- doesn't |
| 6656 // matter. It just has to be any error. | 6648 // matter. It just has to be any error. |
| 6657 SpawnedTestServer::SSLOptions ssl_options( | 6649 SpawnedTestServer::SSLOptions ssl_options( |
| 6658 SpawnedTestServer::SSLOptions::CERT_MISMATCHED_NAME); | 6650 SpawnedTestServer::SSLOptions::CERT_MISMATCHED_NAME); |
| 6659 SpawnedTestServer test_server( | 6651 SpawnedTestServer test_server( |
| 6660 SpawnedTestServer::TYPE_HTTPS, | 6652 SpawnedTestServer::TYPE_HTTPS, |
| 6661 ssl_options, | 6653 ssl_options, |
| 6662 base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); | 6654 base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); |
| 6663 ASSERT_TRUE(test_server.Start()); | 6655 ASSERT_TRUE(test_server.Start()); |
| 6664 | 6656 |
| 6665 // We require that the URL be www.google.com in order to pick up the | 6657 // We require that the URL be www.google.com in order to pick up the static |
| 6666 // preloaded and dynamic HSTS and public key pin entries in the | 6658 // and dynamic STS and PKP entries in the TransportSecurityState. This means |
| 6667 // TransportSecurityState. This means that we have to use a | 6659 // that we have to use a MockHostResolver in order to direct www.google.com to |
| 6668 // MockHostResolver in order to direct www.google.com to the testserver. | 6660 // the testserver. By default, MockHostResolver maps all hosts to 127.0.0.1. |
| 6669 // By default, MockHostResolver maps all hosts to 127.0.0.1. | |
| 6670 | 6661 |
| 6671 MockHostResolver host_resolver; | 6662 MockHostResolver host_resolver; |
| 6672 TestNetworkDelegate network_delegate; // Must outlive URLRequest. | 6663 TestNetworkDelegate network_delegate; // Must outlive URLRequest. |
| 6673 TestURLRequestContext context(true); | 6664 TestURLRequestContext context(true); |
| 6674 context.set_network_delegate(&network_delegate); | 6665 context.set_network_delegate(&network_delegate); |
| 6675 context.set_host_resolver(&host_resolver); | 6666 context.set_host_resolver(&host_resolver); |
| 6676 TransportSecurityState transport_security_state; | 6667 TransportSecurityState transport_security_state; |
| 6677 TransportSecurityState::DomainState domain_state; | 6668 |
| 6678 EXPECT_TRUE(transport_security_state.GetDomainState("www.google.com", true, | 6669 TransportSecurityState::DomainState static_domain_state; |
| 6679 &domain_state)); | 6670 EXPECT_TRUE(transport_security_state.GetStaticDomainState( |
| 6671 "www.google.com", true, &static_domain_state)); |
| 6680 context.set_transport_security_state(&transport_security_state); | 6672 context.set_transport_security_state(&transport_security_state); |
| 6681 context.Init(); | 6673 context.Init(); |
| 6682 | 6674 |
| 6675 TransportSecurityState::DomainState dynamic_domain_state; |
| 6676 EXPECT_FALSE(transport_security_state.GetDynamicDomainState( |
| 6677 "www.google.com", &dynamic_domain_state)); |
| 6678 |
| 6683 TestDelegate d; | 6679 TestDelegate d; |
| 6684 URLRequest r(GURL(base::StringPrintf("https://www.google.com:%d", | 6680 URLRequest r(GURL(base::StringPrintf("https://www.google.com:%d", |
| 6685 test_server.host_port_pair().port())), | 6681 test_server.host_port_pair().port())), |
| 6686 DEFAULT_PRIORITY, | 6682 DEFAULT_PRIORITY, |
| 6687 &d, | 6683 &d, |
| 6688 &context); | 6684 &context); |
| 6689 | 6685 |
| 6690 r.Start(); | 6686 r.Start(); |
| 6691 EXPECT_TRUE(r.is_pending()); | 6687 EXPECT_TRUE(r.is_pending()); |
| 6692 | 6688 |
| 6693 base::RunLoop().Run(); | 6689 base::RunLoop().Run(); |
| 6694 | 6690 |
| 6695 EXPECT_EQ(1, d.response_started_count()); | 6691 EXPECT_EQ(1, d.response_started_count()); |
| 6696 EXPECT_FALSE(d.received_data_before_response()); | 6692 EXPECT_FALSE(d.received_data_before_response()); |
| 6697 EXPECT_TRUE(d.have_certificate_errors()); | 6693 EXPECT_TRUE(d.have_certificate_errors()); |
| 6698 EXPECT_TRUE(d.certificate_errors_are_fatal()); | 6694 EXPECT_TRUE(d.certificate_errors_are_fatal()); |
| 6699 | 6695 |
| 6700 // Get a fresh copy of the state, and check that it hasn't been updated. | 6696 // Get a fresh copy of the states, and check that they haven't changed. |
| 6701 TransportSecurityState::DomainState new_domain_state; | 6697 TransportSecurityState::DomainState new_static_domain_state; |
| 6702 EXPECT_TRUE(transport_security_state.GetDomainState("www.google.com", true, | 6698 EXPECT_TRUE(transport_security_state.GetStaticDomainState( |
| 6703 &new_domain_state)); | 6699 "www.google.com", true, &new_static_domain_state)); |
| 6704 EXPECT_EQ(new_domain_state.upgrade_mode, domain_state.upgrade_mode); | 6700 TransportSecurityState::DomainState new_dynamic_domain_state; |
| 6705 EXPECT_EQ(new_domain_state.sts_include_subdomains, | 6701 EXPECT_FALSE(transport_security_state.GetDynamicDomainState( |
| 6706 domain_state.sts_include_subdomains); | 6702 "www.google.com", &new_dynamic_domain_state)); |
| 6707 EXPECT_EQ(new_domain_state.pkp_include_subdomains, | 6703 |
| 6708 domain_state.pkp_include_subdomains); | 6704 EXPECT_EQ(new_static_domain_state.sts.upgrade_mode, |
| 6709 EXPECT_TRUE(FingerprintsEqual(new_domain_state.static_spki_hashes, | 6705 static_domain_state.sts.upgrade_mode); |
| 6710 domain_state.static_spki_hashes)); | 6706 EXPECT_EQ(new_static_domain_state.sts.include_subdomains, |
| 6711 EXPECT_TRUE(FingerprintsEqual(new_domain_state.dynamic_spki_hashes, | 6707 static_domain_state.sts.include_subdomains); |
| 6712 domain_state.dynamic_spki_hashes)); | 6708 EXPECT_EQ(new_static_domain_state.pkp.include_subdomains, |
| 6713 EXPECT_TRUE(FingerprintsEqual(new_domain_state.bad_static_spki_hashes, | 6709 static_domain_state.pkp.include_subdomains); |
| 6714 domain_state.bad_static_spki_hashes)); | 6710 EXPECT_TRUE(FingerprintsEqual(new_static_domain_state.pkp.spki_hashes, |
| 6711 static_domain_state.pkp.spki_hashes)); |
| 6712 EXPECT_TRUE(FingerprintsEqual(new_static_domain_state.pkp.bad_spki_hashes, |
| 6713 static_domain_state.pkp.bad_spki_hashes)); |
| 6715 } | 6714 } |
| 6716 | 6715 |
| 6717 // Make sure HSTS preserves a POST request's method and body. | 6716 // Make sure HSTS preserves a POST request's method and body. |
| 6718 TEST_F(HTTPSRequestTest, HSTSPreservesPosts) { | 6717 TEST_F(HTTPSRequestTest, HSTSPreservesPosts) { |
| 6719 static const char kData[] = "hello world"; | 6718 static const char kData[] = "hello world"; |
| 6720 | 6719 |
| 6721 SpawnedTestServer::SSLOptions ssl_options( | 6720 SpawnedTestServer::SSLOptions ssl_options( |
| 6722 SpawnedTestServer::SSLOptions::CERT_OK); | 6721 SpawnedTestServer::SSLOptions::CERT_OK); |
| 6723 SpawnedTestServer test_server( | 6722 SpawnedTestServer test_server( |
| 6724 SpawnedTestServer::TYPE_HTTPS, | 6723 SpawnedTestServer::TYPE_HTTPS, |
| (...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7994 | 7993 |
| 7995 EXPECT_FALSE(r.is_pending()); | 7994 EXPECT_FALSE(r.is_pending()); |
| 7996 EXPECT_EQ(1, d->response_started_count()); | 7995 EXPECT_EQ(1, d->response_started_count()); |
| 7997 EXPECT_FALSE(d->received_data_before_response()); | 7996 EXPECT_FALSE(d->received_data_before_response()); |
| 7998 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); | 7997 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); |
| 7999 } | 7998 } |
| 8000 } | 7999 } |
| 8001 #endif // !defined(DISABLE_FTP_SUPPORT) | 8000 #endif // !defined(DISABLE_FTP_SUPPORT) |
| 8002 | 8001 |
| 8003 } // namespace net | 8002 } // namespace net |
| OLD | NEW |