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

Unified Diff: net/cert/internal/test_helpers.h

Issue 2805213004: Refactor how net/data/verify_certificate_chain_unittest/* (Closed)
Patch Set: fix android 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/test_helpers.h
diff --git a/net/cert/internal/test_helpers.h b/net/cert/internal/test_helpers.h
index 0ba8938257fbb79c53431d2927ba7bc42e919a67..dceb06821571d5c6c7a48861cfbe0db0645ad3dc 100644
--- a/net/cert/internal/test_helpers.h
+++ b/net/cert/internal/test_helpers.h
@@ -95,19 +95,25 @@ struct VerifyCertChainTest {
// The Key Purpose to use when verifying the chain.
KeyPurpose key_purpose = KeyPurpose::ANY_EKU;
- // The expected result from verification.
- bool expected_result = false;
-
- // The expected errors from verification (as a string).
+ // The expected errors/warnings from verification (as a string).
std::string expected_errors;
+
+ // Returns true if |expected_errors| contains any high severity errors (a
+ // non-empty expected_errors doesn't necessarily mean verification is
+ // expected to fail, as it may have contained warnings).
+ bool HasHighSeverityErrors() const;
};
// Reads a test case from |file_path_ascii| (which is relative to //src).
// Generally |file_path_ascii| will start with:
// net/data/verify_certificate_chain_unittest/
-void ReadVerifyCertChainTestFromFile(const std::string& file_path_ascii,
+bool ReadVerifyCertChainTestFromFile(const std::string& file_path_ascii,
VerifyCertChainTest* test);
+// Reads a certificate chain from |file_path_ascii|
+bool ReadCertChainFromFile(const std::string& file_path_ascii,
+ ParsedCertificateList* chain);
+
// Reads a data file relative to the src root directory.
std::string ReadTestFileToString(const std::string& file_path_ascii);

Powered by Google App Engine
This is Rietveld 408576698