OLD | NEW |
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" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 namespace net { | 13 namespace net { |
14 | 14 |
15 namespace ct { | 15 namespace ct { |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 const char kLogDescription[] = "somelog"; | 19 const char kLogDescription[] = "somelog"; |
20 | 20 |
21 class SignedCertificateTimestampTest : public ::testing::Test { | 21 class SignedCertificateTimestampTest : public ::testing::Test { |
22 public: | 22 public: |
23 virtual void SetUp() OVERRIDE { | 23 virtual void SetUp() override { |
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) { |
(...skipping 11 matching lines...) Expand all Loading... |
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 } // namespace | 50 } // namespace |
51 | 51 |
52 } // namespace ct | 52 } // namespace ct |
53 | 53 |
54 } // namespace net | 54 } // namespace net |
OLD | NEW |