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/name_constraints.h" | 5 #include "net/cert/internal/name_constraints.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "net/base/ip_address.h" | 9 #include "net/base/ip_address.h" |
10 #include "net/cert/internal/test_helpers.h" | 10 #include "net/cert/internal/test_helpers.h" |
| 11 #include "net/test/gtest_util.h" |
| 12 #include "testing/gmock/include/gmock/gmock.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
12 | 14 |
| 15 using net::test::IsOk; |
| 16 |
13 namespace net { | 17 namespace net { |
14 namespace { | 18 namespace { |
15 | 19 |
16 ::testing::AssertionResult LoadTestData(const char* token, | 20 ::testing::AssertionResult LoadTestData(const char* token, |
17 const std::string& basename, | 21 const std::string& basename, |
18 std::string* result) { | 22 std::string* result) { |
19 std::string path = "net/data/name_constraints_unittest/" + basename; | 23 std::string path = "net/data/name_constraints_unittest/" + basename; |
20 | 24 |
21 const PemBlockMapping mappings[] = { | 25 const PemBlockMapping mappings[] = { |
22 {token, result}, | 26 {token, result}, |
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 | 1126 |
1123 TEST_P(ParseNameConstraints, | 1127 TEST_P(ParseNameConstraints, |
1124 GeneralNamesCreateFromDerFailsOnInvalidIpInSubjectAltName) { | 1128 GeneralNamesCreateFromDerFailsOnInvalidIpInSubjectAltName) { |
1125 std::string invalid_san_der; | 1129 std::string invalid_san_der; |
1126 ASSERT_TRUE(LoadTestSubjectAltNameData("san-invalid-ipaddress.pem", | 1130 ASSERT_TRUE(LoadTestSubjectAltNameData("san-invalid-ipaddress.pem", |
1127 &invalid_san_der)); | 1131 &invalid_san_der)); |
1128 EXPECT_FALSE(GeneralNames::CreateFromDer(der::Input(&invalid_san_der))); | 1132 EXPECT_FALSE(GeneralNames::CreateFromDer(der::Input(&invalid_san_der))); |
1129 } | 1133 } |
1130 | 1134 |
1131 } // namespace net | 1135 } // namespace net |
OLD | NEW |