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

Side by Side Diff: mojo/public/cpp/test_support/lib/test_utils.cc

Issue 1801793003: Move mojo::{Wait,WaitMany}() to (the newly-added) mojo/public/cpp/system/wait.h. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « mojo/public/cpp/system/wait.h ('k') | mojo/public/cpp/utility/lib/run_loop.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "mojo/public/cpp/test_support/test_utils.h" 5 #include "mojo/public/cpp/test_support/test_utils.h"
6 6
7 #include "mojo/public/cpp/system/handle.h" 7 #include "mojo/public/cpp/system/handle.h"
8 #include "mojo/public/cpp/system/message_pipe.h" 8 #include "mojo/public/cpp/system/message_pipe.h"
9 #include "mojo/public/cpp/system/wait.h"
9 10
10 namespace mojo { 11 namespace mojo {
11 namespace test { 12 namespace test {
12 13
13 bool WriteTextMessage(const MessagePipeHandle& handle, 14 bool WriteTextMessage(const MessagePipeHandle& handle,
14 const std::string& text) { 15 const std::string& text) {
15 MojoResult rv = 16 MojoResult rv =
16 WriteMessageRaw(handle, text.data(), static_cast<uint32_t>(text.size()), 17 WriteMessageRaw(handle, text.data(), static_cast<uint32_t>(text.size()),
17 nullptr, 0u, MOJO_WRITE_MESSAGE_FLAG_NONE); 18 nullptr, 0u, MOJO_WRITE_MESSAGE_FLAG_NONE);
18 return rv == MOJO_RESULT_OK; 19 return rv == MOJO_RESULT_OK;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } 51 }
51 52
52 bool DiscardMessage(const MessagePipeHandle& handle) { 53 bool DiscardMessage(const MessagePipeHandle& handle) {
53 MojoResult rv = ReadMessageRaw(handle, nullptr, nullptr, nullptr, nullptr, 54 MojoResult rv = ReadMessageRaw(handle, nullptr, nullptr, nullptr, nullptr,
54 MOJO_READ_MESSAGE_FLAG_MAY_DISCARD); 55 MOJO_READ_MESSAGE_FLAG_MAY_DISCARD);
55 return rv == MOJO_RESULT_OK; 56 return rv == MOJO_RESULT_OK;
56 } 57 }
57 58
58 } // namespace test 59 } // namespace test
59 } // namespace mojo 60 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/system/wait.h ('k') | mojo/public/cpp/utility/lib/run_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698