| // Copyright 2018 The Chromium OS Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #include "crash-reporter/test_util.h" |
| |
| #include <base/files/file_util.h> |
| |
| namespace test_util { |
| |
| bool CreateFile(const base::FilePath& file_path, base::StringPiece content) { |
| if (!base::CreateDirectory(file_path.DirName())) |
| return false; |
| return base::WriteFile(file_path, content.data(), content.size()) == |
| content.size(); |
| } |
| |
| } // namespace test_util |