| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ios/web/net/request_tracker_impl.h" | 5 #include "ios/web/net/request_tracker_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 private: | 481 private: |
| 482 ~MockCertificatePolicyCache() override {} | 482 ~MockCertificatePolicyCache() override {} |
| 483 }; | 483 }; |
| 484 | 484 |
| 485 void TwoStartsSSLCallback(bool* called, bool ok) { | 485 void TwoStartsSSLCallback(bool* called, bool ok) { |
| 486 *called = true; | 486 *called = true; |
| 487 } | 487 } |
| 488 | 488 |
| 489 // crbug/386180 | 489 // crbug/386180 |
| 490 TEST_F(RequestTrackerTest, DISABLED_TwoStartsNoEstimate) { | 490 TEST_F(RequestTrackerTest, DISABLED_TwoStartsNoEstimate) { |
| 491 net::X509Certificate* cert = | |
| 492 new net::X509Certificate("subject", "issuer", base::Time::Now(), | |
| 493 base::Time::Max()); | |
| 494 net::SSLInfo ssl_info; | 491 net::SSLInfo ssl_info; |
| 495 ssl_info.cert = cert; | 492 ssl_info.cert = |
| 493 net::ImportCertFromFile(net::GetTestCertsDirectory(), "ok_cert.pem"); |
| 496 ssl_info.cert_status = net::CERT_STATUS_AUTHORITY_INVALID; | 494 ssl_info.cert_status = net::CERT_STATUS_AUTHORITY_INVALID; |
| 497 scoped_refptr<MockCertificatePolicyCache> cache; | 495 scoped_refptr<MockCertificatePolicyCache> cache; |
| 498 tracker_->SetCertificatePolicyCacheForTest(cache.get()); | 496 tracker_->SetCertificatePolicyCacheForTest(cache.get()); |
| 499 TrimRequest(request_group_id_, GetSecureURL(0)); | 497 TrimRequest(request_group_id_, GetSecureURL(0)); |
| 500 tracker_->StartRequest(GetSecureRequest(0)); | 498 tracker_->StartRequest(GetSecureRequest(0)); |
| 501 tracker_->StartRequest(GetSecureRequest(1)); | 499 tracker_->StartRequest(GetSecureRequest(1)); |
| 502 bool request_0_called = false; | 500 bool request_0_called = false; |
| 503 bool request_1_called = false; | 501 bool request_1_called = false; |
| 504 tracker_->OnSSLCertificateError(GetSecureRequest(0), ssl_info, true, | 502 tracker_->OnSSLCertificateError(GetSecureRequest(0), ssl_info, true, |
| 505 base::Bind(&TwoStartsSSLCallback, | 503 base::Bind(&TwoStartsSSLCallback, |
| 506 &request_0_called)); | 504 &request_0_called)); |
| 507 tracker_->OnSSLCertificateError(GetSecureRequest(1), ssl_info, true, | 505 tracker_->OnSSLCertificateError(GetSecureRequest(1), ssl_info, true, |
| 508 base::Bind(&TwoStartsSSLCallback, | 506 base::Bind(&TwoStartsSSLCallback, |
| 509 &request_1_called)); | 507 &request_1_called)); |
| 510 EXPECT_TRUE(request_0_called); | 508 EXPECT_TRUE(request_0_called); |
| 511 EXPECT_TRUE(request_1_called); | 509 EXPECT_TRUE(request_1_called); |
| 512 } | 510 } |
| 513 | 511 |
| 514 } // namespace | 512 } // namespace |
| OLD | NEW |