| 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/ct_serialization.h" | 5 #include "net/cert/ct_serialization.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| 11 #include "net/base/test_completion_callback.h" | 11 #include "net/base/test_completion_callback.h" |
| 12 #include "net/base/test_data_directory.h" | 12 #include "net/base/test_data_directory.h" |
| 13 #include "net/cert/signed_certificate_timestamp.h" |
| 14 #include "net/cert/signed_tree_head.h" |
| 13 #include "net/cert/x509_certificate.h" | 15 #include "net/cert/x509_certificate.h" |
| 14 #include "net/log/net_log.h" | 16 #include "net/log/net_log.h" |
| 15 #include "net/test/cert_test_util.h" | 17 #include "net/test/cert_test_util.h" |
| 16 #include "net/test/ct_test_util.h" | 18 #include "net/test/ct_test_util.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 20 |
| 19 namespace net { | 21 namespace net { |
| 20 | 22 |
| 21 class CtSerializationTest : public ::testing::Test { | 23 class CtSerializationTest : public ::testing::Test { |
| 22 public: | 24 public: |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 // Bytes 18-49 are sha256 root hash | 177 // Bytes 18-49 are sha256 root hash |
| 176 ASSERT_EQ(50u, encoded.length()); | 178 ASSERT_EQ(50u, encoded.length()); |
| 177 std::string expected_buffer( | 179 std::string expected_buffer( |
| 178 "\x0\x1\x0\x0\x1\x45\x3c\x5f\xb8\x35\x0\x0\x0\x0\x0\x0\x0\x15", 18); | 180 "\x0\x1\x0\x0\x1\x45\x3c\x5f\xb8\x35\x0\x0\x0\x0\x0\x0\x0\x15", 18); |
| 179 expected_buffer.append(ct::GetSampleSTHSHA256RootHash()); | 181 expected_buffer.append(ct::GetSampleSTHSHA256RootHash()); |
| 180 ASSERT_EQ(expected_buffer, encoded); | 182 ASSERT_EQ(expected_buffer, encoded); |
| 181 } | 183 } |
| 182 | 184 |
| 183 } // namespace net | 185 } // namespace net |
| 184 | 186 |
| OLD | NEW |