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

Side by Side Diff: net/cert/signed_certificate_timestamp_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/signed_certificate_timestamp.cc ('k') | net/cert/x509_certificate.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/signed_certificate_timestamp.h" 5 #include "net/cert/signed_certificate_timestamp.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/pickle.h" 9 #include "base/pickle.h"
10 #include "net/test/ct_test_util.h" 10 #include "net/test/ct_test_util.h"
(...skipping 13 matching lines...) Expand all
24 GetX509CertSCT(&sample_sct_); 24 GetX509CertSCT(&sample_sct_);
25 sample_sct_->origin = SignedCertificateTimestamp::SCT_FROM_OCSP_RESPONSE; 25 sample_sct_->origin = SignedCertificateTimestamp::SCT_FROM_OCSP_RESPONSE;
26 sample_sct_->log_description = kLogDescription; 26 sample_sct_->log_description = kLogDescription;
27 } 27 }
28 28
29 protected: 29 protected:
30 scoped_refptr<SignedCertificateTimestamp> sample_sct_; 30 scoped_refptr<SignedCertificateTimestamp> sample_sct_;
31 }; 31 };
32 32
33 TEST_F(SignedCertificateTimestampTest, PicklesAndUnpickles) { 33 TEST_F(SignedCertificateTimestampTest, PicklesAndUnpickles) {
34 Pickle pickle; 34 base::Pickle pickle;
35 35
36 sample_sct_->Persist(&pickle); 36 sample_sct_->Persist(&pickle);
37 PickleIterator iter(pickle); 37 base::PickleIterator iter(pickle);
38 38
39 scoped_refptr<SignedCertificateTimestamp> unpickled_sct( 39 scoped_refptr<SignedCertificateTimestamp> unpickled_sct(
40 SignedCertificateTimestamp::CreateFromPickle(&iter)); 40 SignedCertificateTimestamp::CreateFromPickle(&iter));
41 41
42 SignedCertificateTimestamp::LessThan less_than; 42 SignedCertificateTimestamp::LessThan less_than;
43 43
44 ASSERT_FALSE(less_than(sample_sct_, unpickled_sct)); 44 ASSERT_FALSE(less_than(sample_sct_, unpickled_sct));
45 ASSERT_FALSE(less_than(unpickled_sct, sample_sct_)); 45 ASSERT_FALSE(less_than(unpickled_sct, sample_sct_));
46 ASSERT_EQ(sample_sct_->origin, unpickled_sct->origin); 46 ASSERT_EQ(sample_sct_->origin, unpickled_sct->origin);
47 ASSERT_EQ(sample_sct_->log_description, unpickled_sct->log_description); 47 ASSERT_EQ(sample_sct_->log_description, unpickled_sct->log_description);
48 } 48 }
49 49
50 TEST_F(SignedCertificateTimestampTest, SCTsWithDifferentOriginsNotEqual) { 50 TEST_F(SignedCertificateTimestampTest, SCTsWithDifferentOriginsNotEqual) {
51 scoped_refptr<SignedCertificateTimestamp> another_sct; 51 scoped_refptr<SignedCertificateTimestamp> another_sct;
52 GetX509CertSCT(&another_sct); 52 GetX509CertSCT(&another_sct);
53 another_sct->origin = SignedCertificateTimestamp::SCT_FROM_TLS_EXTENSION; 53 another_sct->origin = SignedCertificateTimestamp::SCT_FROM_TLS_EXTENSION;
54 54
55 SignedCertificateTimestamp::LessThan less_than; 55 SignedCertificateTimestamp::LessThan less_than;
56 56
57 ASSERT_TRUE(less_than(sample_sct_, another_sct) || 57 ASSERT_TRUE(less_than(sample_sct_, another_sct) ||
58 less_than(another_sct, sample_sct_)); 58 less_than(another_sct, sample_sct_));
59 } 59 }
60 60
61 } // namespace 61 } // namespace
62 62
63 } // namespace ct 63 } // namespace ct
64 64
65 } // namespace net 65 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/signed_certificate_timestamp.cc ('k') | net/cert/x509_certificate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698