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 #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 Loading... |
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 Loading... |
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 |
OLD | NEW |