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

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

Issue 2109503009: Refactor net tests to use GMock matchers for checking net::Error results (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert changes to contents.txt files Created 4 years, 5 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
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/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
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
OLDNEW
« no previous file with comments | « net/cert/cert_verify_proc_unittest.cc ('k') | net/cert/multi_threaded_cert_verifier_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698