OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CHROME_UTILITY_SAFE_BROWSING_MAC_DMG_TEST_UTILS_H_ | 5 #ifndef CHROME_UTILITY_SAFE_BROWSING_MAC_DMG_TEST_UTILS_H_ |
6 #define CHROME_UTILITY_SAFE_BROWSING_MAC_DMG_TEST_UTILS_H_ | 6 #define CHROME_UTILITY_SAFE_BROWSING_MAC_DMG_TEST_UTILS_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <vector> | 10 #include <vector> |
9 | 11 |
10 #include "base/files/file.h" | 12 #include "base/files/file.h" |
11 #include "chrome/utility/safe_browsing/mac/read_stream.h" | 13 #include "chrome/utility/safe_browsing/mac/read_stream.h" |
12 | 14 |
13 namespace safe_browsing { | 15 namespace safe_browsing { |
14 namespace dmg { | 16 namespace dmg { |
15 namespace test { | 17 namespace test { |
16 | 18 |
17 // Opens a generated test data file. Uses gtest assertions to verify success, | 19 // Opens a generated test data file. Uses gtest assertions to verify success, |
18 // so this should be called with ASSERT_NO_FATAL_FAILURE(). | 20 // so this should be called with ASSERT_NO_FATAL_FAILURE(). |
19 void GetTestFile(const char* file_name, base::File* file); | 21 void GetTestFile(const char* file_name, base::File* file); |
20 | 22 |
21 // Reads the given |stream| until end-of-stream is reached, storying the read | 23 // Reads the given |stream| until end-of-stream is reached, storying the read |
22 // bytes into |data|. Returns true on success and false on error. | 24 // bytes into |data|. Returns true on success and false on error. |
23 bool ReadEntireStream(ReadStream* stream, std::vector<uint8_t>* data); | 25 bool ReadEntireStream(ReadStream* stream, std::vector<uint8_t>* data); |
24 | 26 |
25 } // namespace test | 27 } // namespace test |
26 } // namespace dmg | 28 } // namespace dmg |
27 } // namespace safe_browsing | 29 } // namespace safe_browsing |
28 | 30 |
29 #endif // CHROME_UTILITY_SAFE_BROWSING_MAC_DMG_TEST_UTILS_H_ | 31 #endif // CHROME_UTILITY_SAFE_BROWSING_MAC_DMG_TEST_UTILS_H_ |
OLD | NEW |