OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef NET_CERT_INTERNAL_TEST_HELPERS_H_ | 5 #ifndef NET_CERT_INTERNAL_TEST_HELPERS_H_ |
6 #define NET_CERT_INTERNAL_TEST_HELPERS_H_ | 6 #define NET_CERT_INTERNAL_TEST_HELPERS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <ostream> | 10 #include <ostream> |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 bool ReadVerifyCertChainTestFromFile(const std::string& file_path_ascii, | 120 bool ReadVerifyCertChainTestFromFile(const std::string& file_path_ascii, |
121 VerifyCertChainTest* test); | 121 VerifyCertChainTest* test); |
122 | 122 |
123 // Reads a certificate chain from |file_path_ascii| | 123 // Reads a certificate chain from |file_path_ascii| |
124 bool ReadCertChainFromFile(const std::string& file_path_ascii, | 124 bool ReadCertChainFromFile(const std::string& file_path_ascii, |
125 ParsedCertificateList* chain); | 125 ParsedCertificateList* chain); |
126 | 126 |
127 // Reads a data file relative to the src root directory. | 127 // Reads a data file relative to the src root directory. |
128 std::string ReadTestFileToString(const std::string& file_path_ascii); | 128 std::string ReadTestFileToString(const std::string& file_path_ascii); |
129 | 129 |
| 130 // Asserts that |actual_errors| matches |expected_errors_str|. |
| 131 // |
| 132 // This is a helper function to simplify rebasing the error expectations when |
| 133 // they originate from a test file. |
| 134 void VerifyCertPathErrors(const std::string& expected_errors_str, |
| 135 const CertPathErrors& actual_errors, |
| 136 const ParsedCertificateList& chain, |
| 137 const std::string& errors_file_path); |
| 138 |
| 139 // Asserts that |actual_errors| matches |expected_errors_str|. |
| 140 // |
| 141 // This is a helper function to simplify rebasing the error expectations when |
| 142 // they originate from a test file. |
| 143 void VerifyCertErrors(const std::string& expected_errors_str, |
| 144 const CertErrors& actual_errors, |
| 145 const std::string& errors_file_path); |
| 146 |
130 } // namespace net | 147 } // namespace net |
131 | 148 |
132 #endif // NET_CERT_INTERNAL_TEST_HELPERS_H_ | 149 #endif // NET_CERT_INTERNAL_TEST_HELPERS_H_ |
OLD | NEW |