file_test_util.h 701 B

1234567891011121314151617181920212223
  1. // Copyright 2019 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.
  4. #ifndef EXTENSIONS_COMMON_FILE_TEST_UTIL_H_
  5. #define EXTENSIONS_COMMON_FILE_TEST_UTIL_H_
  6. #include "base/strings/string_piece.h"
  7. namespace base {
  8. class FilePath;
  9. }
  10. namespace extensions {
  11. namespace file_test_util {
  12. // Writes |content| to |path|. Returns true if writing was successful,
  13. // verifying the number of bytes written equals the size of |content|.
  14. bool WriteFile(const base::FilePath& path, base::StringPiece content);
  15. } // namespace file_test_util
  16. } // namespace extensions
  17. #endif // EXTENSIONS_COMMON_FILE_TEST_UTIL_H_