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

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

Issue 782693004: Update mojo sdk to rev f6c8ec07c01deebc13178d516225fd12695c3dc2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: hack mojo_system_impl gypi for android :| Created 6 years 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
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 33de6883f9654b3e5fb59863a826d7acb83d8fea..bb00927c3b664870b6c36daa4b1b5fa59d4178f6 100644
--- a/mojo/public/c/system/tests/core_unittest_pure_c.c
+++ b/mojo/public/c/system/tests/core_unittest_pure_c.c
@@ -61,8 +61,18 @@ const char* MinimalCTest(void) {
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));
+ MojoNewWaitMany(&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,
@@ -72,9 +82,17 @@ const char* MinimalCTest(void) {
0u,
MOJO_WRITE_DATA_FLAG_NONE));
+ struct MojoHandleSignalsState state;
EXPECT_EQ(
MOJO_RESULT_OK,
- MojoWait(handle1, MOJO_HANDLE_SIGNAL_READABLE, MOJO_DEADLINE_INDEFINITE));
+ MojoNewWait(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,

Powered by Google App Engine
This is Rietveld 408576698