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