Commit 19f85676 authored by eroman's avatar eroman Committed by Commit bot

Re-enable the omitted tests in path_builder_unittest.cc.

This also fixes a problem introduced by
994db999.

BUG=649017

Review-Url: https://codereview.chromium.org/2597003002
Cr-Commit-Position: refs/heads/master@{#443184}
parent 96bbaa02
...@@ -82,6 +82,9 @@ class CertIssuersIter { ...@@ -82,6 +82,9 @@ class CertIssuersIter {
void AddIssuers(ParsedCertificateList issuers); void AddIssuers(ParsedCertificateList issuers);
void DoAsyncIssuerQuery(); void DoAsyncIssuerQuery();
// Returns true if |issuers_| contains unconsumed certificates.
bool HasCurrentIssuer() const { return cur_issuer_ < issuers_.size(); }
scoped_refptr<ParsedCertificate> cert_; scoped_refptr<ParsedCertificate> cert_;
CertIssuerSources* cert_issuer_sources_; CertIssuerSources* cert_issuer_sources_;
const TrustStore* trust_store_; const TrustStore* trust_store_;
...@@ -160,7 +163,7 @@ void CertIssuersIter::GetNextIssuer(CertificateOrTrustAnchor* out) { ...@@ -160,7 +163,7 @@ void CertIssuersIter::GetNextIssuer(CertificateOrTrustAnchor* out) {
} }
// If there aren't any issuers left, block until async results are ready. // If there aren't any issuers left, block until async results are ready.
if (cur_issuer_ >= issuers_.size()) { if (!HasCurrentIssuer()) {
if (!did_async_issuer_query_) { if (!did_async_issuer_query_) {
// Now issue request(s) for async ones (AIA, etc). // Now issue request(s) for async ones (AIA, etc).
DoAsyncIssuerQuery(); DoAsyncIssuerQuery();
...@@ -168,22 +171,21 @@ void CertIssuersIter::GetNextIssuer(CertificateOrTrustAnchor* out) { ...@@ -168,22 +171,21 @@ void CertIssuersIter::GetNextIssuer(CertificateOrTrustAnchor* out) {
// TODO(eroman): Rather than blocking on the async requests in FIFO order, // TODO(eroman): Rather than blocking on the async requests in FIFO order,
// consume in the order they become ready. // consume in the order they become ready.
while (cur_async_request_ < pending_async_requests_.size()) { while (!HasCurrentIssuer() &&
cur_async_request_ < pending_async_requests_.size()) {
ParsedCertificateList new_issuers; ParsedCertificateList new_issuers;
pending_async_requests_[cur_async_request_]->GetNext(&new_issuers); pending_async_requests_[cur_async_request_]->GetNext(&new_issuers);
if (new_issuers.empty()) { if (new_issuers.empty()) {
// Request is exhausted, no more results pending from that // Request is exhausted, no more results pending from that
// CertIssuerSource. // CertIssuerSource.
pending_async_requests_[cur_async_request_++].reset(); pending_async_requests_[cur_async_request_++].reset();
continue; } else {
AddIssuers(std::move(new_issuers));
} }
AddIssuers(std::move(new_issuers));
break;
} }
} }
if (cur_issuer_ < issuers_.size()) { if (HasCurrentIssuer()) {
DVLOG(1) << "CertIssuersIter(" << CertDebugString(cert()) DVLOG(1) << "CertIssuersIter(" << CertDebugString(cert())
<< "): returning issuer " << cur_issuer_ << " of " << "): returning issuer " << cur_issuer_ << " of "
<< issuers_.size(); << issuers_.size();
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment