| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 mapping.value->assign(pem_tokenizer.data()); | 76 mapping.value->assign(pem_tokenizer.data()); |
| 77 | 77 |
| 78 // Mark the mapping as having been satisfied. | 78 // Mark the mapping as having been satisfied. |
| 79 mapping.value = nullptr; | 79 mapping.value = nullptr; |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 } | 82 } |
| 83 | 83 |
| 84 // Ensure that all specified blocks were found. | 84 // Ensure that all specified blocks were found. |
| 85 for (const auto& mapping : mappings_copy) { | 85 for (const auto& mapping : mappings_copy) { |
| 86 if (mapping.value) { | 86 if (mapping.value && !mapping.optional) { |
| 87 return ::testing::AssertionFailure() << "PEM block missing: " | 87 return ::testing::AssertionFailure() << "PEM block missing: " |
| 88 << mapping.block_name; | 88 << mapping.block_name; |
| 89 } | 89 } |
| 90 } | 90 } |
| 91 | 91 |
| 92 return ::testing::AssertionSuccess(); | 92 return ::testing::AssertionSuccess(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 } // namespace net | 95 } // namespace net |
| OLD | NEW |