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

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

Issue 1154283003: Change most uses of Pickle to base::Pickle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « net/cert/x509_certificate_openssl.cc ('k') | net/cert/x509_certificate_win.cc » ('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 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 606
607 X509Certificate::OSCertHandles intermediates; 607 X509Certificate::OSCertHandles intermediates;
608 intermediates.push_back(thawte_cert_handle); 608 intermediates.push_back(thawte_cert_handle);
609 scoped_refptr<X509Certificate> cert = X509Certificate::CreateFromHandle( 609 scoped_refptr<X509Certificate> cert = X509Certificate::CreateFromHandle(
610 google_cert_handle, intermediates); 610 google_cert_handle, intermediates);
611 ASSERT_NE(static_cast<X509Certificate*>(NULL), cert.get()); 611 ASSERT_NE(static_cast<X509Certificate*>(NULL), cert.get());
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 base::Pickle pickle;
617 cert->Persist(&pickle); 617 cert->Persist(&pickle);
618 618
619 PickleIterator iter(pickle); 619 base::PickleIterator iter(pickle);
620 scoped_refptr<X509Certificate> cert_from_pickle = 620 scoped_refptr<X509Certificate> cert_from_pickle =
621 X509Certificate::CreateFromPickle( 621 X509Certificate::CreateFromPickle(
622 &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();
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 &actual_type); 1204 &actual_type);
1205 1205
1206 EXPECT_EQ(data.expected_bits, actual_bits); 1206 EXPECT_EQ(data.expected_bits, actual_bits);
1207 EXPECT_EQ(data.expected_type, actual_type); 1207 EXPECT_EQ(data.expected_type, actual_type);
1208 } 1208 }
1209 1209
1210 INSTANTIATE_TEST_CASE_P(, X509CertificatePublicKeyInfoTest, 1210 INSTANTIATE_TEST_CASE_P(, X509CertificatePublicKeyInfoTest,
1211 testing::ValuesIn(kPublicKeyInfoTestData)); 1211 testing::ValuesIn(kPublicKeyInfoTestData));
1212 1212
1213 } // namespace net 1213 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/x509_certificate_openssl.cc ('k') | net/cert/x509_certificate_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698