diff options
author | dkegel@google.com <dkegel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-24 18:09:33 +0000 |
---|---|---|
committer | dkegel@google.com <dkegel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-24 18:09:33 +0000 |
commit | 143cb01067b26440ad710a9db8b24982f0196c47 (patch) | |
tree | f694147676c3f35ed4f2807e2f6278914e9728e7 /net/base/x509_certificate_unittest.cc | |
parent | 28d9c672a6fcf2d93c487ffb9b855c4d7fe58d22 (diff) | |
download | chromium_src-143cb01067b26440ad710a9db8b24982f0196c47.zip chromium_src-143cb01067b26440ad710a9db8b24982f0196c47.tar.gz chromium_src-143cb01067b26440ad710a9db8b24982f0196c47.tar.bz2 |
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
Diffstat (limited to 'net/base/x509_certificate_unittest.cc')
-rw-r--r-- | net/base/x509_certificate_unittest.cc | 16 |
1 files changed, 15 insertions, 1 deletions
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<X509Certificate> cert1 = X509Certificate::CreateFromBytes( + reinterpret_cast<const char*>(google_der), sizeof(google_der)); + + Pickle pickle; + cert1->Persist(&pickle); + + void* iter = NULL; + scoped_refptr<X509Certificate> cert2 = + X509Certificate::CreateFromPickle(pickle, &iter); + + EXPECT_EQ(cert1, cert2); +} + } // namespace net |