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

Side by Side Diff: net/cert/internal/test_helpers.h

Issue 2918913002: Add path validation error expectations for PKITS tests. (Closed)
Patch Set: Address Matt's comments Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « net/cert/internal/path_builder_pkits_unittest.cc ('k') | net/cert/internal/test_helpers.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « net/cert/internal/path_builder_pkits_unittest.cc ('k') | net/cert/internal/test_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698