OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/common/safe_browsing/binary_feature_extractor.h" | 5 #include "chrome/common/safe_browsing/binary_feature_extractor.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 #include <string.h> |
| 9 |
7 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
8 #include "base/files/file.h" | 11 #include "base/files/file.h" |
9 #include "base/files/scoped_temp_dir.h" | 12 #include "base/files/scoped_temp_dir.h" |
10 #include "base/path_service.h" | 13 #include "base/path_service.h" |
11 #include "chrome/common/safe_browsing/csd.pb.h" | 14 #include "chrome/common/safe_browsing/csd.pb.h" |
12 #include "crypto/sha2.h" | 15 #include "crypto/sha2.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
14 | 17 |
15 namespace safe_browsing { | 18 namespace safe_browsing { |
16 | 19 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 0x33, 0xa7, 0x70, 0xf3, 0x6b, 0x85, 0xbf, 0xce, 0x9d, 0x5c}; | 95 0x33, 0xa7, 0x70, 0xf3, 0x6b, 0x85, 0xbf, 0xce, 0x9d, 0x5c}; |
93 | 96 |
94 const int kDataLen = kBlockSize + 1; | 97 const int kDataLen = kBlockSize + 1; |
95 scoped_ptr<char[]> data(new char[kDataLen]); | 98 scoped_ptr<char[]> data(new char[kDataLen]); |
96 memset(data.get(), 71, kDataLen); | 99 memset(data.get(), 71, kDataLen); |
97 WriteFileToHash(data.get(), kDataLen); | 100 WriteFileToHash(data.get(), kDataLen); |
98 ExpectFileDigestEq(kDigest); | 101 ExpectFileDigestEq(kDigest); |
99 } | 102 } |
100 | 103 |
101 } // namespace safe_browsing | 104 } // namespace safe_browsing |
OLD | NEW |