Satoru Takabayashi | 5ebb4ce | 2018-08-16 10:28:13 +0900 | [diff] [blame] | 1 | // Copyright 2018 The Chromium OS 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 | |
| 5 | #include "crash-reporter/test_util.h" |
| 6 | |
| 7 | #include <base/files/file_util.h> |
| 8 | |
| 9 | namespace test_util { |
| 10 | |
| 11 | bool CreateFile(const base::FilePath& file_path, base::StringPiece content) { |
| 12 | if (!base::CreateDirectory(file_path.DirName())) |
| 13 | return false; |
| 14 | return base::WriteFile(file_path, content.data(), content.size()) == |
| 15 | content.size(); |
| 16 | } |
| 17 | |
| 18 | } // namespace test_util |