| 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 <memory> | 5 #include <memory> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 9445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9456 | 9456 |
| 9457 {{{SpawnedTestServer::SSLOptions::OCSP_MISMATCHED_SERIAL, | 9457 {{{SpawnedTestServer::SSLOptions::OCSP_MISMATCHED_SERIAL, |
| 9458 SpawnedTestServer::SSLOptions::OCSP_DATE_EARLY}}, | 9458 SpawnedTestServer::SSLOptions::OCSP_DATE_EARLY}}, |
| 9459 SpawnedTestServer::SSLOptions::OCSP_PRODUCED_VALID, | 9459 SpawnedTestServer::SSLOptions::OCSP_PRODUCED_VALID, |
| 9460 OCSPVerifyResult::NO_MATCHING_RESPONSE, | 9460 OCSPVerifyResult::NO_MATCHING_RESPONSE, |
| 9461 false, | 9461 false, |
| 9462 OCSPRevocationStatus::UNKNOWN}, | 9462 OCSPRevocationStatus::UNKNOWN}, |
| 9463 | 9463 |
| 9464 }; | 9464 }; |
| 9465 | 9465 |
| 9466 // Flaky on Android Tests (dbg) bot, crbug.com/630286. | |
| 9467 #if !defined(OS_ANDROID) | |
| 9468 class HTTPSOCSPVerifyTest | 9466 class HTTPSOCSPVerifyTest |
| 9469 : public HTTPSOCSPTest, | 9467 : public HTTPSOCSPTest, |
| 9470 public testing::WithParamInterface<OCSPVerifyTestData> {}; | 9468 public testing::WithParamInterface<OCSPVerifyTestData> {}; |
| 9471 | 9469 |
| 9472 TEST_P(HTTPSOCSPVerifyTest, VerifyResult) { | 9470 TEST_P(HTTPSOCSPVerifyTest, VerifyResult) { |
| 9473 SpawnedTestServer::SSLOptions ssl_options( | 9471 SpawnedTestServer::SSLOptions ssl_options( |
| 9474 SpawnedTestServer::SSLOptions::CERT_AUTO); | 9472 SpawnedTestServer::SSLOptions::CERT_AUTO); |
| 9475 OCSPVerifyTestData test = GetParam(); | 9473 OCSPVerifyTestData test = GetParam(); |
| 9476 | 9474 |
| 9477 ssl_options.ocsp_responses = test.ocsp_responses; | 9475 ssl_options.ocsp_responses = test.ocsp_responses; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 9492 | 9490 |
| 9493 EXPECT_EQ(test.response_status, ssl_info.ocsp_result.response_status); | 9491 EXPECT_EQ(test.response_status, ssl_info.ocsp_result.response_status); |
| 9494 | 9492 |
| 9495 if (test.has_revocation_status) | 9493 if (test.has_revocation_status) |
| 9496 EXPECT_EQ(test.cert_status, ssl_info.ocsp_result.revocation_status); | 9494 EXPECT_EQ(test.cert_status, ssl_info.ocsp_result.revocation_status); |
| 9497 } | 9495 } |
| 9498 | 9496 |
| 9499 INSTANTIATE_TEST_CASE_P(OCSPVerify, | 9497 INSTANTIATE_TEST_CASE_P(OCSPVerify, |
| 9500 HTTPSOCSPVerifyTest, | 9498 HTTPSOCSPVerifyTest, |
| 9501 testing::ValuesIn(kOCSPVerifyData)); | 9499 testing::ValuesIn(kOCSPVerifyData)); |
| 9502 #endif | |
| 9503 | 9500 |
| 9504 class HTTPSHardFailTest : public HTTPSOCSPTest { | 9501 class HTTPSHardFailTest : public HTTPSOCSPTest { |
| 9505 protected: | 9502 protected: |
| 9506 void SetupContext() override { | 9503 void SetupContext() override { |
| 9507 context_.set_ssl_config_service(new TestSSLConfigService( | 9504 context_.set_ssl_config_service(new TestSSLConfigService( |
| 9508 false /* check for EV */, false /* online revocation checking */, | 9505 false /* check for EV */, false /* online revocation checking */, |
| 9509 true /* require rev. checking for local | 9506 true /* require rev. checking for local |
| 9510 anchors */, | 9507 anchors */, |
| 9511 false /* token binding enabled */)); | 9508 false /* token binding enabled */)); |
| 9512 } | 9509 } |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10151 AddTestInterceptor()->set_main_intercept_job(std::move(job)); | 10148 AddTestInterceptor()->set_main_intercept_job(std::move(job)); |
| 10152 | 10149 |
| 10153 req->Start(); | 10150 req->Start(); |
| 10154 req->Cancel(); | 10151 req->Cancel(); |
| 10155 base::RunLoop().RunUntilIdle(); | 10152 base::RunLoop().RunUntilIdle(); |
| 10156 EXPECT_EQ(URLRequestStatus::CANCELED, req->status().status()); | 10153 EXPECT_EQ(URLRequestStatus::CANCELED, req->status().status()); |
| 10157 EXPECT_EQ(0, d.received_redirect_count()); | 10154 EXPECT_EQ(0, d.received_redirect_count()); |
| 10158 } | 10155 } |
| 10159 | 10156 |
| 10160 } // namespace net | 10157 } // namespace net |
| OLD | NEW |