Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: mojo/common/test/test_utils.h

Issue 176063002: Reland: Add some handle read/write helpers to mojo/common/test/test_utils.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MOJO_COMMON_TEST_TEST_UTILS_H_
6 #define MOJO_COMMON_TEST_TEST_UTILS_H_
7
8 #include <stddef.h>
9
10 namespace mojo {
11
12 namespace embedder {
13 struct PlatformHandle;
14 }
15
16 namespace test {
17
18 // On success, |bytes_written| is updated to the number of bytes written;
19 // otherwise it is untouched.
20 bool BlockingWrite(const embedder::PlatformHandle& handle,
21 const void* buffer,
22 size_t bytes_to_write,
23 size_t* bytes_written);
24
25 // On success, |bytes_read| is updated to the number of bytes read; otherwise it
26 // is untouched.
27 bool BlockingRead(const embedder::PlatformHandle& handle,
28 void* buffer,
29 size_t buffer_size,
30 size_t* bytes_read);
31
32 // 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
34 // block); otherwise it returns false and leaves |bytes_read| untouched.
35 // |handle| must already be in non-blocking mode.
36 bool NonBlockingRead(const embedder::PlatformHandle& handle,
37 void* buffer,
38 size_t buffer_size,
39 size_t* bytes_read);
40
41 } // namespace test
42 } // namespace mojo
43
44 #endif // MOJO_COMMON_TEST_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « mojo/common/test/multiprocess_test_base_unittest.cc ('k') | mojo/common/test/test_utils_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698