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

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

Issue 2918063002: Revert of Add policies support to VerifyCertificateChain(). (Closed)
Patch Set: 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/test_helpers.h ('k') | net/cert/internal/verify_certificate_chain.h » ('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 #include "net/cert/internal/test_helpers.h" 5 #include "net/cert/internal/test_helpers.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/base_paths.h" 8 #include "base/base_paths.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 for (const auto& mapping : mappings_copy) { 118 for (const auto& mapping : mappings_copy) {
119 if (mapping.value && !mapping.optional) { 119 if (mapping.value && !mapping.optional) {
120 return ::testing::AssertionFailure() 120 return ::testing::AssertionFailure()
121 << "PEM block missing: " << mapping.block_name; 121 << "PEM block missing: " << mapping.block_name;
122 } 122 }
123 } 123 }
124 124
125 return ::testing::AssertionSuccess(); 125 return ::testing::AssertionSuccess();
126 } 126 }
127 127
128 VerifyCertChainTest::VerifyCertChainTest() 128 VerifyCertChainTest::VerifyCertChainTest() = default;
129 : user_initial_policy_set{AnyPolicy()} {}
130 VerifyCertChainTest::~VerifyCertChainTest() = default; 129 VerifyCertChainTest::~VerifyCertChainTest() = default;
131 130
132 bool VerifyCertChainTest::HasHighSeverityErrors() const { 131 bool VerifyCertChainTest::HasHighSeverityErrors() const {
133 // This function assumes that high severity warnings are prefixed with 132 // This function assumes that high severity warnings are prefixed with
134 // "ERROR: " and warnings are prefixed with "WARNING: ". This is an 133 // "ERROR: " and warnings are prefixed with "WARNING: ". This is an
135 // implementation detail of CertError::ToDebugString). 134 // implementation detail of CertError::ToDebugString).
136 // 135 //
137 // Do a quick sanity-check to confirm this. 136 // Do a quick sanity-check to confirm this.
138 CertError error(CertError::SEVERITY_HIGH, "unused", nullptr); 137 CertError error(CertError::SEVERITY_HIGH, "unused", nullptr);
139 EXPECT_EQ("ERROR: unused\n", error.ToDebugString()); 138 EXPECT_EQ("ERROR: unused\n", error.ToDebugString());
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 std::string file_data; 301 std::string file_data;
303 if (!base::ReadFileToString(filepath, &file_data)) { 302 if (!base::ReadFileToString(filepath, &file_data)) {
304 ADD_FAILURE() << "Couldn't read file: " << filepath.value(); 303 ADD_FAILURE() << "Couldn't read file: " << filepath.value();
305 return std::string(); 304 return std::string();
306 } 305 }
307 306
308 return file_data; 307 return file_data;
309 } 308 }
310 309
311 } // namespace net 310 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/internal/test_helpers.h ('k') | net/cert/internal/verify_certificate_chain.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698