| Index: net/cert/ct_serialization_unittest.cc
|
| diff --git a/net/cert/ct_serialization_unittest.cc b/net/cert/ct_serialization_unittest.cc
|
| index 28ed04c7d180917d089b64d78fc74d74db1c2f1c..38b096a5eae81d04dac93a2d4614511383ae5621 100644
|
| --- a/net/cert/ct_serialization_unittest.cc
|
| +++ b/net/cert/ct_serialization_unittest.cc
|
| @@ -162,7 +162,16 @@ TEST_F(CtSerializationTest, FailsDecodingInvalidSignedCertificateTimestamp) {
|
| ct::DecodeSignedCertificateTimestamp(&invalid_length_sct, &sct));
|
| }
|
|
|
| -TEST_F(CtSerializationTest, EncodesValidSignedTreeHead) {
|
| +TEST_F(CtSerializationTest, EncodesSignedCertificateTimestamp) {
|
| + scoped_refptr<ct::SignedCertificateTimestamp> sct;
|
| + ct::GetX509CertSCT(&sct);
|
| +
|
| + std::string output;
|
| + EXPECT_TRUE(ct::EncodeSignedCertificateTimestamp(*sct, &output));
|
| + EXPECT_EQ(ct::GetTestSignedCertificateTimestamp(), output);
|
| +}
|
| +
|
| +TEST_F(CtSerializationTest, EncodesValidTreeHeadForSignature) {
|
| ct::SignedTreeHead signed_tree_head;
|
| GetSampleSignedTreeHead(&signed_tree_head);
|
|
|
| @@ -180,5 +189,27 @@ TEST_F(CtSerializationTest, EncodesValidSignedTreeHead) {
|
| ASSERT_EQ(expected_buffer, encoded);
|
| }
|
|
|
| +TEST_F(CtSerializationTest, EncodesSignedTreeHead) {
|
| + ct::SignedTreeHead sth;
|
| + GetSampleSignedTreeHead(&sth);
|
| +
|
| + std::string output;
|
| + EXPECT_TRUE(ct::EncodeSignedTreeHead(sth, &output));
|
| +
|
| + EXPECT_EQ(ct::GetSampleSTH(), output);
|
| +}
|
| +
|
| +TEST_F(CtSerializationTest, DecodesSignedTreeHead) {
|
| + ct::SignedTreeHead expected_sth;
|
| + GetSampleSignedTreeHead(&expected_sth);
|
| +
|
| + std::string encoded_sth = ct::GetSampleSTH();
|
| + base::StringPiece encoded_sth_ptr(encoded_sth);
|
| + ct::SignedTreeHead sth;
|
| +
|
| + EXPECT_TRUE(ct::DecodeSignedTreeHead(&encoded_sth_ptr, &sth));
|
| + EXPECT_EQ(expected_sth, sth);
|
| +}
|
| +
|
| } // namespace net
|
|
|
|
|