From 143cb01067b26440ad710a9db8b24982f0196c47 Mon Sep 17 00:00:00 2001 From: "dkegel@google.com" Date: Tue, 24 Feb 2009 18:09:33 +0000 Subject: Implement X509Certificate::Persist. This lets the browser read gmail on linux. Review URL: http://codereview.chromium.org/27033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10269 0039d316-1c4b-4281-b951-d872f2087c98 --- net/base/x509_certificate_unittest.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'net/base/x509_certificate_unittest.cc') diff --git a/net/base/x509_certificate_unittest.cc b/net/base/x509_certificate_unittest.cc index bf98b5c..8287184 100644 --- a/net/base/x509_certificate_unittest.cc +++ b/net/base/x509_certificate_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/port.h" +#include "base/pickle.h" #include "net/base/cert_status_flags.h" #include "net/base/x509_certificate.h" #include "testing/gtest/include/gtest/gtest.h" @@ -540,4 +540,18 @@ TEST(X509CertificateTest, Cache) { EXPECT_EQ(cert3, cert5); } +TEST(X509CertificateTest, Pickle) { + scoped_refptr cert1 = X509Certificate::CreateFromBytes( + reinterpret_cast(google_der), sizeof(google_der)); + + Pickle pickle; + cert1->Persist(&pickle); + + void* iter = NULL; + scoped_refptr cert2 = + X509Certificate::CreateFromPickle(pickle, &iter); + + EXPECT_EQ(cert1, cert2); +} + } // namespace net -- cgit v1.1