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

Unified Diff: net/cert/internal/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
Index: net/cert/internal/verify_certificate_chain_unittest.cc
diff --git a/net/cert/internal/verify_certificate_chain_unittest.cc b/net/cert/internal/verify_certificate_chain_unittest.cc
index d66f67496f2982c30497d41305a2f47223d22fdb..7a162b89975ba72ddf8ff3c45a3b523ccf6b4b6d 100644
--- a/net/cert/internal/verify_certificate_chain_unittest.cc
+++ b/net/cert/internal/verify_certificate_chain_unittest.cc
@@ -14,21 +14,17 @@ namespace {
class VerifyCertificateChainDelegate {
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) {
- ASSERT_TRUE(trust_anchor);
+ ASSERT_TRUE(test.trust_anchor);
SimpleSignaturePolicy signature_policy(1024);
CertPathErrors errors;
- bool result = VerifyCertificateChain(chain, trust_anchor.get(),
- &signature_policy, time, &errors);
- EXPECT_EQ(expected_result, result);
- EXPECT_EQ(expected_errors, errors.ToDebugString(chain))
+ bool result = VerifyCertificateChain(test.chain, test.trust_anchor.get(),
+ &signature_policy, test.time, &errors);
+ EXPECT_EQ(test.expected_result, result);
+ EXPECT_EQ(test.expected_errors, errors.ToDebugString(test.chain))
<< "Test file: " << test_file_path;
EXPECT_EQ(result, !errors.ContainsHighSeverityErrors());
}

Powered by Google App Engine
This is Rietveld 408576698