summaryrefslogtreecommitdiffstats
path: root/net/base/x509_certificate_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/base/x509_certificate_unittest.cc')
-rw-r--r--net/base/x509_certificate_unittest.cc16
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