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

Unified Diff: mojo/public/c/system/tests/core_unittest_pure_c.c

Issue 2744943002: Mojo: Move waiting APIs to public library (Closed)
Patch Set: . Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/c/system/tests/core_unittest.cc ('k') | mojo/public/c/system/thunks.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/system/tests/core_unittest_pure_c.c
diff --git a/mojo/public/c/system/tests/core_unittest_pure_c.c b/mojo/public/c/system/tests/core_unittest_pure_c.c
index 890bcfac91e9e48c9dfbd3c23060a45de3a82442..3164649cbd71df02fe8366444f51a88de7b703d4 100644
--- a/mojo/public/c/system/tests/core_unittest_pure_c.c
+++ b/mojo/public/c/system/tests/core_unittest_pure_c.c
@@ -42,7 +42,6 @@ const char* MinimalCTest(void) {
// at the top. (MSVS 2013 is more reasonable.)
MojoTimeTicks ticks;
MojoHandle handle0, handle1;
- MojoHandleSignals signals;
const char kHello[] = "hello";
char buffer[200] = {0};
uint32_t num_bytes;
@@ -56,41 +55,13 @@ const char* MinimalCTest(void) {
EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
MojoQueryHandleSignalsState(handle0, NULL));
- EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
- MojoWait(handle0, ~MOJO_HANDLE_SIGNAL_NONE,
- MOJO_DEADLINE_INDEFINITE, NULL));
-
handle1 = MOJO_HANDLE_INVALID;
EXPECT_EQ(MOJO_RESULT_OK, MojoCreateMessagePipe(NULL, &handle0, &handle1));
- signals = MOJO_HANDLE_SIGNAL_READABLE;
- uint32_t result_index = 123;
- struct MojoHandleSignalsState states[1];
- EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED,
- MojoWaitMany(&handle0, &signals, 1, 1, &result_index, states));
-
- // "Deadline exceeded" doesn't apply to a single handle, so this should leave
- // |result_index| untouched.
- EXPECT_EQ(123u, result_index);
- EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE, states[0].satisfied_signals);
- EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_WRITABLE |
- MOJO_HANDLE_SIGNAL_PEER_CLOSED,
- states[0].satisfiable_signals);
-
EXPECT_EQ(MOJO_RESULT_OK,
MojoWriteMessage(handle0, kHello, (uint32_t)sizeof(kHello), NULL,
0u, MOJO_WRITE_DATA_FLAG_NONE));
- struct MojoHandleSignalsState state;
- EXPECT_EQ(MOJO_RESULT_OK, MojoWait(handle1, MOJO_HANDLE_SIGNAL_READABLE,
- MOJO_DEADLINE_INDEFINITE, &state));
-
- EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_WRITABLE,
- state.satisfied_signals);
- EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_WRITABLE |
- MOJO_HANDLE_SIGNAL_PEER_CLOSED,
- state.satisfiable_signals);
-
num_bytes = (uint32_t)sizeof(buffer);
EXPECT_EQ(MOJO_RESULT_OK, MojoReadMessage(handle1, buffer, &num_bytes, NULL,
NULL, MOJO_READ_MESSAGE_FLAG_NONE));
« no previous file with comments | « mojo/public/c/system/tests/core_unittest.cc ('k') | mojo/public/c/system/thunks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698