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() = default; | 128 VerifyCertChainTest::VerifyCertChainTest() |
| 129 : user_initial_policy_set{AnyPolicy()} {} |
129 VerifyCertChainTest::~VerifyCertChainTest() = default; | 130 VerifyCertChainTest::~VerifyCertChainTest() = default; |
130 | 131 |
131 bool VerifyCertChainTest::HasHighSeverityErrors() const { | 132 bool VerifyCertChainTest::HasHighSeverityErrors() const { |
132 // This function assumes that high severity warnings are prefixed with | 133 // This function assumes that high severity warnings are prefixed with |
133 // "ERROR: " and warnings are prefixed with "WARNING: ". This is an | 134 // "ERROR: " and warnings are prefixed with "WARNING: ". This is an |
134 // implementation detail of CertError::ToDebugString). | 135 // implementation detail of CertError::ToDebugString). |
135 // | 136 // |
136 // Do a quick sanity-check to confirm this. | 137 // Do a quick sanity-check to confirm this. |
137 CertError error(CertError::SEVERITY_HIGH, "unused", nullptr); | 138 CertError error(CertError::SEVERITY_HIGH, "unused", nullptr); |
138 EXPECT_EQ("ERROR: unused\n", error.ToDebugString()); | 139 EXPECT_EQ("ERROR: unused\n", error.ToDebugString()); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 std::string file_data; | 302 std::string file_data; |
302 if (!base::ReadFileToString(filepath, &file_data)) { | 303 if (!base::ReadFileToString(filepath, &file_data)) { |
303 ADD_FAILURE() << "Couldn't read file: " << filepath.value(); | 304 ADD_FAILURE() << "Couldn't read file: " << filepath.value(); |
304 return std::string(); | 305 return std::string(); |
305 } | 306 } |
306 | 307 |
307 return file_data; | 308 return file_data; |
308 } | 309 } |
309 | 310 |
310 } // namespace net | 311 } // namespace net |
OLD | NEW |