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

Unified Diff: net/base/x509_certificate_unittest.cc

Issue 27033: Implement X509Certificate::Persist. This fixes gmail on linux. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/x509_certificate_nss.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/x509_certificate_unittest.cc
===================================================================
--- net/base/x509_certificate_unittest.cc (revision 10264)
+++ net/base/x509_certificate_unittest.cc (working copy)
@@ -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 @@
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
« no previous file with comments | « net/base/x509_certificate_nss.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698