OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SERVICES_FILES_C_TESTS_TEST_UTILS_H_ | 5 #ifndef SERVICES_FILES_C_TESTS_TEST_UTILS_H_ |
6 #define SERVICES_FILES_C_TESTS_TEST_UTILS_H_ | 6 #define SERVICES_FILES_C_TESTS_TEST_UTILS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "files/public/interfaces/directory.mojom.h" | 13 #include "files/interfaces/directory.mojom.h" |
14 #include "files/public/interfaces/file.mojom.h" | 14 #include "files/interfaces/file.mojom.h" |
15 | 15 |
16 namespace mojio { | 16 namespace mojio { |
17 namespace test { | 17 namespace test { |
18 | 18 |
19 // Makes a directory at the given path under the given root directory. | 19 // Makes a directory at the given path under the given root directory. |
20 // (Check-fails on any failure.) | 20 // (Check-fails on any failure.) |
21 void MakeDirAt(mojo::files::DirectoryPtr* root, const char* path); | 21 void MakeDirAt(mojo::files::DirectoryPtr* root, const char* path); |
22 | 22 |
23 // Opens a file at the given path under the given root directory using the given | 23 // Opens a file at the given path under the given root directory using the given |
24 // flags (|mojo::files::kOpenFlag...|). Returns a null |FilePtr| on failure | 24 // flags (|mojo::files::kOpenFlag...|). Returns a null |FilePtr| on failure |
(...skipping 16 matching lines...) Expand all Loading... |
41 int64_t GetFileSize(mojo::files::DirectoryPtr* root, const char* path); | 41 int64_t GetFileSize(mojo::files::DirectoryPtr* root, const char* path); |
42 | 42 |
43 // Gets the contents of the file (up to 1 MiB) at the given path under the given | 43 // Gets the contents of the file (up to 1 MiB) at the given path under the given |
44 // root directory. (Check-fails on any failure.) | 44 // root directory. (Check-fails on any failure.) |
45 std::string GetFileContents(mojo::files::DirectoryPtr* root, const char* path); | 45 std::string GetFileContents(mojo::files::DirectoryPtr* root, const char* path); |
46 | 46 |
47 } // namespace test | 47 } // namespace test |
48 } // namespace mojio | 48 } // namespace mojio |
49 | 49 |
50 #endif // SERVICES_FILES_C_TESTS_TEST_UTILS_H_ | 50 #endif // SERVICES_FILES_C_TESTS_TEST_UTILS_H_ |
OLD | NEW |