Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / chrome / utility / safe_browsing / mac / dmg_test_utils.h
blob87d34de4b2dc9aa576dbe6534703b86ed6bdf2b3
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_
8 #include <vector>
10 #include "base/files/file.h"
11 #include "chrome/utility/safe_browsing/mac/read_stream.h"
13 namespace safe_browsing {
14 namespace dmg {
15 namespace test {
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);
25 } // namespace test
26 } // namespace dmg
27 } // namespace safe_browsing
29 #endif // CHROME_UTILITY_SAFE_BROWSING_MAC_DMG_TEST_UTILS_H_