OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MOJO_COMMON_TEST_TEST_UTILS_H_ | 5 #ifndef MOJO_COMMON_TEST_TEST_UTILS_H_ |
6 #define MOJO_COMMON_TEST_TEST_UTILS_H_ | 6 #define MOJO_COMMON_TEST_TEST_UTILS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
| 10 #include <string> |
| 11 |
| 12 #include "base/files/file_path.h" |
| 13 |
10 namespace mojo { | 14 namespace mojo { |
11 | 15 |
12 namespace embedder { | 16 namespace embedder { |
13 struct PlatformHandle; | 17 struct PlatformHandle; |
14 } | 18 } |
15 | 19 |
16 namespace test { | 20 namespace test { |
17 | 21 |
18 // On success, |bytes_written| is updated to the number of bytes written; | 22 // On success, |bytes_written| is updated to the number of bytes written; |
19 // otherwise it is untouched. | 23 // otherwise it is untouched. |
(...skipping 11 matching lines...) Expand all Loading... |
31 | 35 |
32 // If the read is done successfully or would block, the function returns true | 36 // If the read is done successfully or would block, the function returns true |
33 // and updates |bytes_read| to the number of bytes read (0 if the read would | 37 // and updates |bytes_read| to the number of bytes read (0 if the read would |
34 // block); otherwise it returns false and leaves |bytes_read| untouched. | 38 // block); otherwise it returns false and leaves |bytes_read| untouched. |
35 // |handle| must already be in non-blocking mode. | 39 // |handle| must already be in non-blocking mode. |
36 bool NonBlockingRead(const embedder::PlatformHandle& handle, | 40 bool NonBlockingRead(const embedder::PlatformHandle& handle, |
37 void* buffer, | 41 void* buffer, |
38 size_t buffer_size, | 42 size_t buffer_size, |
39 size_t* bytes_read); | 43 size_t* bytes_read); |
40 | 44 |
| 45 // Returns the path to the mojom js bindings file. |
| 46 base::FilePath GetFilePathForJSResource(const std::string& path); |
| 47 |
41 } // namespace test | 48 } // namespace test |
42 } // namespace mojo | 49 } // namespace mojo |
43 | 50 |
44 #endif // MOJO_COMMON_TEST_TEST_UTILS_H_ | 51 #endif // MOJO_COMMON_TEST_TEST_UTILS_H_ |
OLD | NEW |