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
3 // found in the LICENSE file.
5 #ifndef CHROME_UTILITY_SAFE_BROWSING_MAC_DMG_TEST_UTILS_H_
6 #define CHROME_UTILITY_SAFE_BROWSING_MAC_DMG_TEST_UTILS_H_
10 #include "base/files/file.h"
11 #include "chrome/utility/safe_browsing/mac/read_stream.h"
13 namespace safe_browsing
{
17 // Opens a generated test data file. Uses gtest assertions to verify success,
18 // so this should be called with ASSERT_NO_FATAL_FAILURE().
19 void GetTestFile(const char* file_name
, base::File
* file
);
21 // 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.
23 bool ReadEntireStream(ReadStream
* stream
, std::vector
<uint8_t>* data
);
27 } // namespace safe_browsing
29 #endif // CHROME_UTILITY_SAFE_BROWSING_MAC_DMG_TEST_UTILS_H_