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

Unified Diff: mojo/edk/system/remote_data_pipe_impl_unittest.cc

Issue 2075353002: Plumb the handle signals state out of Waiter::Wait(). (Closed) Base URL: https://github.com/domokit/mojo.git@work795_wait_set_4.3-x-work794_wait_set_4.2
Patch Set: Created 4 years, 6 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
Index: mojo/edk/system/remote_data_pipe_impl_unittest.cc
diff --git a/mojo/edk/system/remote_data_pipe_impl_unittest.cc b/mojo/edk/system/remote_data_pipe_impl_unittest.cc
index 6e247cfd32d42278f99c4f4eb6c50d8c809cdad9..624de09ca1064cd90ba6aef8948de3eac1d9121c 100644
--- a/mojo/edk/system/remote_data_pipe_impl_unittest.cc
+++ b/mojo/edk/system/remote_data_pipe_impl_unittest.cc
@@ -147,7 +147,8 @@ TEST_F(RemoteDataPipeImplTest, Sanity) {
message_pipe(0)->WriteMessage(0, UserPointer<const void>(kHello),
sizeof(kHello), nullptr,
MOJO_WRITE_MESSAGE_FLAG_NONE));
- EXPECT_EQ(MOJO_RESULT_OK, waiter.Wait(test::ActionTimeout(), &context));
+ EXPECT_EQ(MOJO_RESULT_OK,
+ waiter.Wait(test::ActionTimeout(), &context, nullptr));
EXPECT_EQ(123u, context);
hss = HandleSignalsState();
message_pipe(1)->RemoveAwakable(0, &waiter, &hss);
@@ -212,7 +213,8 @@ TEST_F(RemoteDataPipeImplTest, SendConsumerWithClosedProducer) {
EXPECT_TRUE(consumer_handle.dispatcher->HasOneRef());
consumer_handle.reset();
}
- EXPECT_EQ(MOJO_RESULT_OK, waiter.Wait(test::ActionTimeout(), &context));
+ EXPECT_EQ(MOJO_RESULT_OK,
+ waiter.Wait(test::ActionTimeout(), &context, nullptr));
EXPECT_EQ(123u, context);
hss = HandleSignalsState();
message_pipe(1)->RemoveAwakable(0, &waiter, &hss);
@@ -247,7 +249,8 @@ TEST_F(RemoteDataPipeImplTest, SendConsumerWithClosedProducer) {
consumer->AddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 456, &hss);
if (result == MOJO_RESULT_OK) {
context = 0;
- EXPECT_EQ(MOJO_RESULT_OK, waiter.Wait(test::ActionTimeout(), &context));
+ EXPECT_EQ(MOJO_RESULT_OK,
+ waiter.Wait(test::ActionTimeout(), &context, nullptr));
EXPECT_EQ(456u, context);
consumer->RemoveAwakable(&waiter, &hss);
} else {
@@ -277,7 +280,7 @@ TEST_F(RemoteDataPipeImplTest, SendConsumerWithClosedProducer) {
if (result == MOJO_RESULT_OK) {
context = 0;
EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
- waiter.Wait(test::ActionTimeout(), &context));
+ waiter.Wait(test::ActionTimeout(), &context, nullptr));
EXPECT_EQ(789u, context);
consumer->RemoveAwakable(&waiter, &hss);
} else {
@@ -335,7 +338,8 @@ TEST_F(RemoteDataPipeImplTest, SendConsumerDuringTwoPhaseWrite) {
EXPECT_TRUE(consumer_handle.dispatcher->HasOneRef());
consumer_handle.reset();
}
- EXPECT_EQ(MOJO_RESULT_OK, waiter.Wait(test::ActionTimeout(), &context));
+ EXPECT_EQ(MOJO_RESULT_OK,
+ waiter.Wait(test::ActionTimeout(), &context, nullptr));
EXPECT_EQ(123u, context);
hss = HandleSignalsState();
message_pipe(1)->RemoveAwakable(0, &waiter, &hss);
@@ -378,7 +382,8 @@ TEST_F(RemoteDataPipeImplTest, SendConsumerDuringTwoPhaseWrite) {
consumer->AddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 456, &hss);
if (result == MOJO_RESULT_OK) {
context = 0;
- EXPECT_EQ(MOJO_RESULT_OK, waiter.Wait(test::ActionTimeout(), &context));
+ EXPECT_EQ(MOJO_RESULT_OK,
+ waiter.Wait(test::ActionTimeout(), &context, nullptr));
EXPECT_EQ(456u, context);
consumer->RemoveAwakable(&waiter, &hss);
} else {
@@ -462,7 +467,8 @@ TEST_F(RemoteDataPipeImplTest, SendConsumerDuringSecondTwoPhaseWrite) {
EXPECT_TRUE(consumer_handle.dispatcher->HasOneRef());
consumer_handle.reset();
}
- EXPECT_EQ(MOJO_RESULT_OK, waiter.Wait(test::ActionTimeout(), &context));
+ EXPECT_EQ(MOJO_RESULT_OK,
+ waiter.Wait(test::ActionTimeout(), &context, nullptr));
EXPECT_EQ(123u, context);
hss = HandleSignalsState();
message_pipe(1)->RemoveAwakable(0, &waiter, &hss);
@@ -505,7 +511,8 @@ TEST_F(RemoteDataPipeImplTest, SendConsumerDuringSecondTwoPhaseWrite) {
consumer->AddAwakable(&waiter, MOJO_HANDLE_SIGNAL_PEER_CLOSED, 456, &hss);
if (result == MOJO_RESULT_OK) {
context = 0;
- EXPECT_EQ(MOJO_RESULT_OK, waiter.Wait(test::ActionTimeout(), &context));
+ EXPECT_EQ(MOJO_RESULT_OK,
+ waiter.Wait(test::ActionTimeout(), &context, nullptr));
EXPECT_EQ(456u, context);
consumer->RemoveAwakable(&waiter, &hss);
} else {

Powered by Google App Engine
This is Rietveld 408576698