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

Side by Side Diff: net/cert/x509_certificate_unittest.cc

Issue 15829004: Update net/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: license twerk Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « net/cert/test_root_certs.cc ('k') | net/cookies/cookie_monster.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/x509_certificate.h" 5 #include "net/cert/x509_certificate.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/pickle.h" 10 #include "base/pickle.h"
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 // returned before marking this test a success. 936 // returned before marking this test a success.
937 EXPECT_EQ(i, certs.size()); 937 EXPECT_EQ(i, certs.size());
938 break; 938 break;
939 } 939 }
940 940
941 // A cert is expected - make sure that one was parsed. 941 // A cert is expected - make sure that one was parsed.
942 ASSERT_LT(i, certs.size()); 942 ASSERT_LT(i, certs.size());
943 943
944 // Compare the parsed certificate with the expected certificate, by 944 // Compare the parsed certificate with the expected certificate, by
945 // comparing fingerprints. 945 // comparing fingerprints.
946 const X509Certificate* cert = certs[i]; 946 const X509Certificate* cert = certs[i].get();
947 const SHA1HashValue& actual_fingerprint = cert->fingerprint(); 947 const SHA1HashValue& actual_fingerprint = cert->fingerprint();
948 uint8* expected_fingerprint = test_data_.chain_fingerprints[i]; 948 uint8* expected_fingerprint = test_data_.chain_fingerprints[i];
949 949
950 for (size_t j = 0; j < 20; ++j) 950 for (size_t j = 0; j < 20; ++j)
951 EXPECT_EQ(expected_fingerprint[j], actual_fingerprint.data[j]); 951 EXPECT_EQ(expected_fingerprint[j], actual_fingerprint.data[j]);
952 } 952 }
953 } 953 }
954 954
955 INSTANTIATE_TEST_CASE_P(, X509CertificateParseTest, 955 INSTANTIATE_TEST_CASE_P(, X509CertificateParseTest,
956 testing::ValuesIn(FormatTestData)); 956 testing::ValuesIn(FormatTestData));
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1176 } 1176 }
1177 1177
1178 EXPECT_EQ(test_data.expected, X509Certificate::VerifyHostname( 1178 EXPECT_EQ(test_data.expected, X509Certificate::VerifyHostname(
1179 test_data.hostname, common_name, dns_names, ip_addressses)); 1179 test_data.hostname, common_name, dns_names, ip_addressses));
1180 } 1180 }
1181 1181
1182 INSTANTIATE_TEST_CASE_P(, X509CertificateNameVerifyTest, 1182 INSTANTIATE_TEST_CASE_P(, X509CertificateNameVerifyTest,
1183 testing::ValuesIn(kNameVerifyTestData)); 1183 testing::ValuesIn(kNameVerifyTestData));
1184 1184
1185 } // namespace net 1185 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/test_root_certs.cc ('k') | net/cookies/cookie_monster.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698