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 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6625 // The actual problem -- CERT_MISMATCHED_NAME in this case -- doesn't | 6617 // The actual problem -- CERT_MISMATCHED_NAME in this case -- doesn't |
6626 // matter. It just has to be any error. | 6618 // matter. It just has to be any error. |
6627 SpawnedTestServer::SSLOptions ssl_options( | 6619 SpawnedTestServer::SSLOptions ssl_options( |
6628 SpawnedTestServer::SSLOptions::CERT_MISMATCHED_NAME); | 6620 SpawnedTestServer::SSLOptions::CERT_MISMATCHED_NAME); |
6629 SpawnedTestServer test_server( | 6621 SpawnedTestServer test_server( |
6630 SpawnedTestServer::TYPE_HTTPS, | 6622 SpawnedTestServer::TYPE_HTTPS, |
6631 ssl_options, | 6623 ssl_options, |
6632 base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); | 6624 base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); |
6633 ASSERT_TRUE(test_server.Start()); | 6625 ASSERT_TRUE(test_server.Start()); |
6634 | 6626 |
6635 // We require that the URL be www.google.com in order to pick up the | 6627 // We require that the URL be www.google.com in order to pick up the static |
6636 // preloaded and dynamic HSTS and public key pin entries in the | 6628 // and dynamic STS and PKP entries in the TransportSecurityState. This means |
6637 // TransportSecurityState. This means that we have to use a | 6629 // that we have to use a MockHostResolver in order to direct www.google.com to |
6638 // MockHostResolver in order to direct www.google.com to the testserver. | 6630 // the testserver. By default, MockHostResolver maps all hosts to 127.0.0.1. |
6639 // By default, MockHostResolver maps all hosts to 127.0.0.1. | |
6640 | 6631 |
6641 MockHostResolver host_resolver; | 6632 MockHostResolver host_resolver; |
6642 TestNetworkDelegate network_delegate; // Must outlive URLRequest. | 6633 TestNetworkDelegate network_delegate; // Must outlive URLRequest. |
6643 TestURLRequestContext context(true); | 6634 TestURLRequestContext context(true); |
6644 context.set_network_delegate(&network_delegate); | 6635 context.set_network_delegate(&network_delegate); |
6645 context.set_host_resolver(&host_resolver); | 6636 context.set_host_resolver(&host_resolver); |
6646 TransportSecurityState transport_security_state; | 6637 TransportSecurityState transport_security_state; |
6647 TransportSecurityState::DomainState domain_state; | 6638 |
6648 EXPECT_TRUE(transport_security_state.GetDomainState("www.google.com", true, | 6639 TransportSecurityState::DomainState static_domain_state; |
6649 &domain_state)); | 6640 EXPECT_TRUE(transport_security_state.GetStaticDomainState( |
| 6641 "www.google.com", true, &static_domain_state)); |
6650 context.set_transport_security_state(&transport_security_state); | 6642 context.set_transport_security_state(&transport_security_state); |
6651 context.Init(); | 6643 context.Init(); |
6652 | 6644 |
| 6645 TransportSecurityState::DomainState dynamic_domain_state; |
| 6646 EXPECT_FALSE(transport_security_state.GetDynamicDomainState( |
| 6647 "www.google.com", &dynamic_domain_state)); |
| 6648 |
6653 TestDelegate d; | 6649 TestDelegate d; |
6654 URLRequest r(GURL(base::StringPrintf("https://www.google.com:%d", | 6650 URLRequest r(GURL(base::StringPrintf("https://www.google.com:%d", |
6655 test_server.host_port_pair().port())), | 6651 test_server.host_port_pair().port())), |
6656 DEFAULT_PRIORITY, | 6652 DEFAULT_PRIORITY, |
6657 &d, | 6653 &d, |
6658 &context); | 6654 &context); |
6659 | 6655 |
6660 r.Start(); | 6656 r.Start(); |
6661 EXPECT_TRUE(r.is_pending()); | 6657 EXPECT_TRUE(r.is_pending()); |
6662 | 6658 |
6663 base::RunLoop().Run(); | 6659 base::RunLoop().Run(); |
6664 | 6660 |
6665 EXPECT_EQ(1, d.response_started_count()); | 6661 EXPECT_EQ(1, d.response_started_count()); |
6666 EXPECT_FALSE(d.received_data_before_response()); | 6662 EXPECT_FALSE(d.received_data_before_response()); |
6667 EXPECT_TRUE(d.have_certificate_errors()); | 6663 EXPECT_TRUE(d.have_certificate_errors()); |
6668 EXPECT_TRUE(d.certificate_errors_are_fatal()); | 6664 EXPECT_TRUE(d.certificate_errors_are_fatal()); |
6669 | 6665 |
6670 // Get a fresh copy of the state, and check that it hasn't been updated. | 6666 // Get a fresh copy of the states, and check that they haven't changed. |
6671 TransportSecurityState::DomainState new_domain_state; | 6667 TransportSecurityState::DomainState new_static_domain_state; |
6672 EXPECT_TRUE(transport_security_state.GetDomainState("www.google.com", true, | 6668 EXPECT_TRUE(transport_security_state.GetStaticDomainState( |
6673 &new_domain_state)); | 6669 "www.google.com", true, &new_static_domain_state)); |
6674 EXPECT_EQ(new_domain_state.upgrade_mode, domain_state.upgrade_mode); | 6670 TransportSecurityState::DomainState new_dynamic_domain_state; |
6675 EXPECT_EQ(new_domain_state.sts_include_subdomains, | 6671 EXPECT_FALSE(transport_security_state.GetDynamicDomainState( |
6676 domain_state.sts_include_subdomains); | 6672 "www.google.com", &new_dynamic_domain_state)); |
6677 EXPECT_EQ(new_domain_state.pkp_include_subdomains, | 6673 |
6678 domain_state.pkp_include_subdomains); | 6674 EXPECT_EQ(new_static_domain_state.sts.upgrade_mode, |
6679 EXPECT_TRUE(FingerprintsEqual(new_domain_state.static_spki_hashes, | 6675 static_domain_state.sts.upgrade_mode); |
6680 domain_state.static_spki_hashes)); | 6676 EXPECT_EQ(new_static_domain_state.sts.include_subdomains, |
6681 EXPECT_TRUE(FingerprintsEqual(new_domain_state.dynamic_spki_hashes, | 6677 static_domain_state.sts.include_subdomains); |
6682 domain_state.dynamic_spki_hashes)); | 6678 EXPECT_EQ(new_static_domain_state.pkp.include_subdomains, |
6683 EXPECT_TRUE(FingerprintsEqual(new_domain_state.bad_static_spki_hashes, | 6679 static_domain_state.pkp.include_subdomains); |
6684 domain_state.bad_static_spki_hashes)); | 6680 EXPECT_TRUE(FingerprintsEqual(new_static_domain_state.pkp.spki_hashes, |
| 6681 static_domain_state.pkp.spki_hashes)); |
| 6682 EXPECT_TRUE(FingerprintsEqual(new_static_domain_state.pkp.bad_spki_hashes, |
| 6683 static_domain_state.pkp.bad_spki_hashes)); |
6685 } | 6684 } |
6686 | 6685 |
6687 // Make sure HSTS preserves a POST request's method and body. | 6686 // Make sure HSTS preserves a POST request's method and body. |
6688 TEST_F(HTTPSRequestTest, HSTSPreservesPosts) { | 6687 TEST_F(HTTPSRequestTest, HSTSPreservesPosts) { |
6689 static const char kData[] = "hello world"; | 6688 static const char kData[] = "hello world"; |
6690 | 6689 |
6691 SpawnedTestServer::SSLOptions ssl_options( | 6690 SpawnedTestServer::SSLOptions ssl_options( |
6692 SpawnedTestServer::SSLOptions::CERT_OK); | 6691 SpawnedTestServer::SSLOptions::CERT_OK); |
6693 SpawnedTestServer test_server( | 6692 SpawnedTestServer test_server( |
6694 SpawnedTestServer::TYPE_HTTPS, | 6693 SpawnedTestServer::TYPE_HTTPS, |
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7964 | 7963 |
7965 EXPECT_FALSE(r.is_pending()); | 7964 EXPECT_FALSE(r.is_pending()); |
7966 EXPECT_EQ(1, d->response_started_count()); | 7965 EXPECT_EQ(1, d->response_started_count()); |
7967 EXPECT_FALSE(d->received_data_before_response()); | 7966 EXPECT_FALSE(d->received_data_before_response()); |
7968 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); | 7967 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); |
7969 } | 7968 } |
7970 } | 7969 } |
7971 #endif // !defined(DISABLE_FTP_SUPPORT) | 7970 #endif // !defined(DISABLE_FTP_SUPPORT) |
7972 | 7971 |
7973 } // namespace net | 7972 } // namespace net |
OLD | NEW |