Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1276)

Unified Diff: net/cert/internal/path_builder_verify_certificate_chain_unittest.cc

Issue 2801813004: Refactor VerifyCertificateChain test data to include a key purpose (Closed)
Patch Set: Address mattm's comment Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert/internal/path_builder_unittest.cc ('k') | net/cert/internal/test_helpers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/path_builder_verify_certificate_chain_unittest.cc
diff --git a/net/cert/internal/path_builder_verify_certificate_chain_unittest.cc b/net/cert/internal/path_builder_verify_certificate_chain_unittest.cc
index 003157b8dfad267946cc426d77f4598d308f5464..3c404bed4b014c824c881c228701a4b8666d8884 100644
--- a/net/cert/internal/path_builder_verify_certificate_chain_unittest.cc
+++ b/net/cert/internal/path_builder_verify_certificate_chain_unittest.cc
@@ -15,30 +15,26 @@ namespace {
class PathBuilderDelegate {
public:
- static void Verify(const ParsedCertificateList& chain,
- const scoped_refptr<TrustAnchor>& trust_anchor,
- const der::GeneralizedTime& time,
- bool expected_result,
- const std::string& expected_errors,
+ static void Verify(const VerifyCertChainTest& test,
const std::string& test_file_path) {
SimpleSignaturePolicy signature_policy(1024);
- ASSERT_FALSE(chain.empty());
+ ASSERT_FALSE(test.chain.empty());
TrustStoreInMemory trust_store;
- trust_store.AddTrustAnchor(trust_anchor);
+ trust_store.AddTrustAnchor(test.trust_anchor);
CertIssuerSourceStatic intermediate_cert_issuer_source;
- for (size_t i = 1; i < chain.size(); ++i)
- intermediate_cert_issuer_source.AddCert(chain[i]);
+ for (size_t i = 1; i < test.chain.size(); ++i)
+ intermediate_cert_issuer_source.AddCert(test.chain[i]);
CertPathBuilder::Result result;
// First cert in the |chain| is the target.
- CertPathBuilder path_builder(chain.front(), &trust_store, &signature_policy,
- time, &result);
+ CertPathBuilder path_builder(test.chain.front(), &trust_store,
+ &signature_policy, test.time, &result);
path_builder.AddCertIssuerSource(&intermediate_cert_issuer_source);
path_builder.Run();
- EXPECT_EQ(expected_result, result.HasValidPath());
+ EXPECT_EQ(test.expected_result, result.HasValidPath());
}
};
« no previous file with comments | « net/cert/internal/path_builder_unittest.cc ('k') | net/cert/internal/test_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698