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

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

Issue 818833004: Remove deprecated methods from Pickle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years 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
« no previous file with comments | « net/cert/x509_certificate.cc ('k') | net/http/http_response_headers.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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 612
613 X509Certificate::FreeOSCertHandle(google_cert_handle); 613 X509Certificate::FreeOSCertHandle(google_cert_handle);
614 X509Certificate::FreeOSCertHandle(thawte_cert_handle); 614 X509Certificate::FreeOSCertHandle(thawte_cert_handle);
615 615
616 Pickle pickle; 616 Pickle pickle;
617 cert->Persist(&pickle); 617 cert->Persist(&pickle);
618 618
619 PickleIterator iter(pickle); 619 PickleIterator iter(pickle);
620 scoped_refptr<X509Certificate> cert_from_pickle = 620 scoped_refptr<X509Certificate> cert_from_pickle =
621 X509Certificate::CreateFromPickle( 621 X509Certificate::CreateFromPickle(
622 pickle, &iter, X509Certificate::PICKLETYPE_CERTIFICATE_CHAIN_V3); 622 &iter, X509Certificate::PICKLETYPE_CERTIFICATE_CHAIN_V3);
623 ASSERT_NE(static_cast<X509Certificate*>(NULL), cert_from_pickle.get()); 623 ASSERT_NE(static_cast<X509Certificate*>(NULL), cert_from_pickle.get());
624 EXPECT_TRUE(X509Certificate::IsSameOSCert( 624 EXPECT_TRUE(X509Certificate::IsSameOSCert(
625 cert->os_cert_handle(), cert_from_pickle->os_cert_handle())); 625 cert->os_cert_handle(), cert_from_pickle->os_cert_handle()));
626 const X509Certificate::OSCertHandles& cert_intermediates = 626 const X509Certificate::OSCertHandles& cert_intermediates =
627 cert->GetIntermediateCertificates(); 627 cert->GetIntermediateCertificates();
628 const X509Certificate::OSCertHandles& pickle_intermediates = 628 const X509Certificate::OSCertHandles& pickle_intermediates =
629 cert_from_pickle->GetIntermediateCertificates(); 629 cert_from_pickle->GetIntermediateCertificates();
630 ASSERT_EQ(cert_intermediates.size(), pickle_intermediates.size()); 630 ASSERT_EQ(cert_intermediates.size(), pickle_intermediates.size());
631 for (size_t i = 0; i < cert_intermediates.size(); ++i) { 631 for (size_t i = 0; i < cert_intermediates.size(); ++i) {
632 EXPECT_TRUE(X509Certificate::IsSameOSCert(cert_intermediates[i], 632 EXPECT_TRUE(X509Certificate::IsSameOSCert(cert_intermediates[i],
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 &actual_type); 1193 &actual_type);
1194 1194
1195 EXPECT_EQ(data.expected_bits, actual_bits); 1195 EXPECT_EQ(data.expected_bits, actual_bits);
1196 EXPECT_EQ(data.expected_type, actual_type); 1196 EXPECT_EQ(data.expected_type, actual_type);
1197 } 1197 }
1198 1198
1199 INSTANTIATE_TEST_CASE_P(, X509CertificatePublicKeyInfoTest, 1199 INSTANTIATE_TEST_CASE_P(, X509CertificatePublicKeyInfoTest,
1200 testing::ValuesIn(kPublicKeyInfoTestData)); 1200 testing::ValuesIn(kPublicKeyInfoTestData));
1201 1201
1202 } // namespace net 1202 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/x509_certificate.cc ('k') | net/http/http_response_headers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698