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" | |
13 #include "net/cert/merkle_tree_leaf.h" | 12 #include "net/cert/merkle_tree_leaf.h" |
14 #include "net/cert/signed_certificate_timestamp.h" | 13 #include "net/cert/signed_certificate_timestamp.h" |
15 #include "net/cert/signed_tree_head.h" | 14 #include "net/cert/signed_tree_head.h" |
16 #include "net/cert/x509_certificate.h" | 15 #include "net/cert/x509_certificate.h" |
17 #include "net/log/net_log.h" | 16 #include "net/log/net_log.h" |
18 #include "net/test/cert_test_util.h" | 17 #include "net/test/cert_test_util.h" |
19 #include "net/test/ct_test_util.h" | 18 #include "net/test/ct_test_util.h" |
| 19 #include "net/test/test_data_directory.h" |
20 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 | 22 |
23 using ::testing::ElementsAreArray; | 23 using ::testing::ElementsAreArray; |
24 | 24 |
25 namespace net { | 25 namespace net { |
26 | 26 |
27 class CtSerializationTest : public ::testing::Test { | 27 class CtSerializationTest : public ::testing::Test { |
28 public: | 28 public: |
29 void SetUp() override { | 29 void SetUp() override { |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 // Bytes 18-49 are sha256 root hash | 254 // Bytes 18-49 are sha256 root hash |
255 ASSERT_EQ(50u, encoded.length()); | 255 ASSERT_EQ(50u, encoded.length()); |
256 std::string expected_buffer( | 256 std::string expected_buffer( |
257 "\x0\x1\x0\x0\x1\x45\x3c\x5f\xb8\x35\x0\x0\x0\x0\x0\x0\x0\x15", 18); | 257 "\x0\x1\x0\x0\x1\x45\x3c\x5f\xb8\x35\x0\x0\x0\x0\x0\x0\x0\x15", 18); |
258 expected_buffer.append(ct::GetSampleSTHSHA256RootHash()); | 258 expected_buffer.append(ct::GetSampleSTHSHA256RootHash()); |
259 ASSERT_EQ(expected_buffer, encoded); | 259 ASSERT_EQ(expected_buffer, encoded); |
260 } | 260 } |
261 | 261 |
262 } // namespace net | 262 } // namespace net |
263 | 263 |
OLD | NEW |