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

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

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/edk/system/local_data_pipe_unittest.cc
diff --git a/mojo/edk/system/local_data_pipe_unittest.cc b/mojo/edk/system/local_data_pipe_unittest.cc
index cea50a08d30528464fa12ece7c79576bd6c0715a..1223a2ba54430a30fad14f7716ff8046dc585ff8 100644
--- a/mojo/edk/system/local_data_pipe_unittest.cc
+++ b/mojo/edk/system/local_data_pipe_unittest.cc
@@ -237,7 +237,7 @@ TEST(LocalDataPipeTest, BasicProducerWaiting) {
hss = HandleSignalsState();
EXPECT_EQ(
MOJO_RESULT_FAILED_PRECONDITION,
- dp->ProducerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 12, &hss));
+ dp->ProducerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 12, &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -247,7 +247,7 @@ TEST(LocalDataPipeTest, BasicProducerWaiting) {
hss = HandleSignalsState();
EXPECT_EQ(
MOJO_RESULT_ALREADY_EXISTS,
- dp->ProducerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 34, &hss));
+ dp->ProducerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 34, &hss));
// Write two elements.
int32_t elements[2] = {123, 456};
@@ -259,13 +259,13 @@ TEST(LocalDataPipeTest, BasicProducerWaiting) {
// Adding a waiter should now succeed.
waiter.Init();
- ASSERT_EQ(
- MOJO_RESULT_OK,
- dp->ProducerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 56, nullptr));
+ ASSERT_EQ(MOJO_RESULT_OK,
+ dp->ProducerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 56,
+ nullptr));
// And it shouldn't be writable yet.
EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, waiter.Wait(0, nullptr));
hss = HandleSignalsState();
- dp->ProducerRemoveWaiter(&waiter, &hss);
+ dp->ProducerRemoveAwakable(&waiter, &hss);
EXPECT_EQ(0u, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -283,22 +283,22 @@ TEST(LocalDataPipeTest, BasicProducerWaiting) {
// Add a waiter.
waiter.Init();
- ASSERT_EQ(
- MOJO_RESULT_OK,
- dp->ProducerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 56, nullptr));
+ ASSERT_EQ(MOJO_RESULT_OK,
+ dp->ProducerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 56,
+ nullptr));
// And it still shouldn't be writable yet.
EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, waiter.Wait(0, nullptr));
hss = HandleSignalsState();
- dp->ProducerRemoveWaiter(&waiter, &hss);
+ dp->ProducerRemoveAwakable(&waiter, &hss);
EXPECT_EQ(0u, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
// Do it again.
waiter.Init();
- ASSERT_EQ(
- MOJO_RESULT_OK,
- dp->ProducerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 78, nullptr));
+ ASSERT_EQ(MOJO_RESULT_OK,
+ dp->ProducerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 78,
+ nullptr));
// Read one element.
elements[0] = -1;
@@ -315,7 +315,7 @@ TEST(LocalDataPipeTest, BasicProducerWaiting) {
EXPECT_EQ(MOJO_RESULT_OK, waiter.Wait(1000, &context));
EXPECT_EQ(78u, context);
hss = HandleSignalsState();
- dp->ProducerRemoveWaiter(&waiter, &hss);
+ dp->ProducerRemoveAwakable(&waiter, &hss);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -335,9 +335,9 @@ TEST(LocalDataPipeTest, BasicProducerWaiting) {
// Add a waiter.
waiter.Init();
- ASSERT_EQ(
- MOJO_RESULT_OK,
- dp->ProducerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 90, nullptr));
+ ASSERT_EQ(MOJO_RESULT_OK,
+ dp->ProducerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 90,
+ nullptr));
// Read one element, using a two-phase read.
const void* read_buffer = nullptr;
@@ -359,7 +359,7 @@ TEST(LocalDataPipeTest, BasicProducerWaiting) {
EXPECT_EQ(MOJO_RESULT_OK, waiter.Wait(1000, &context));
EXPECT_EQ(90u, context);
hss = HandleSignalsState();
- dp->ProducerRemoveWaiter(&waiter, &hss);
+ dp->ProducerRemoveAwakable(&waiter, &hss);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -374,9 +374,9 @@ TEST(LocalDataPipeTest, BasicProducerWaiting) {
// Add a waiter.
waiter.Init();
- ASSERT_EQ(
- MOJO_RESULT_OK,
- dp->ProducerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 12, nullptr));
+ ASSERT_EQ(MOJO_RESULT_OK,
+ dp->ProducerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 12,
+ nullptr));
// Close the consumer.
dp->ConsumerClose();
@@ -385,7 +385,7 @@ TEST(LocalDataPipeTest, BasicProducerWaiting) {
EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION, waiter.Wait(1000, &context));
EXPECT_EQ(12u, context);
hss = HandleSignalsState();
- dp->ProducerRemoveWaiter(&waiter, &hss);
+ dp->ProducerRemoveAwakable(&waiter, &hss);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfiable_signals);
@@ -412,8 +412,8 @@ TEST(LocalDataPipeTest, PeerClosedWaiting) {
// Add a waiter.
waiter.Init();
ASSERT_EQ(MOJO_RESULT_OK,
- dp->ProducerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_PEER_CLOSED, 12,
- nullptr));
+ dp->ProducerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_PEER_CLOSED,
+ 12, nullptr));
// Close the consumer.
dp->ConsumerClose();
@@ -423,7 +423,7 @@ TEST(LocalDataPipeTest, PeerClosedWaiting) {
EXPECT_EQ(MOJO_RESULT_OK, waiter.Wait(1000, &context));
EXPECT_EQ(12u, context);
hss = HandleSignalsState();
- dp->ProducerRemoveWaiter(&waiter, &hss);
+ dp->ProducerRemoveAwakable(&waiter, &hss);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfiable_signals);
@@ -436,8 +436,8 @@ TEST(LocalDataPipeTest, PeerClosedWaiting) {
// Add a waiter.
waiter.Init();
ASSERT_EQ(MOJO_RESULT_OK,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_PEER_CLOSED, 12,
- nullptr));
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_PEER_CLOSED,
+ 12, nullptr));
// Close the producer.
dp->ProducerClose();
@@ -447,7 +447,7 @@ TEST(LocalDataPipeTest, PeerClosedWaiting) {
EXPECT_EQ(MOJO_RESULT_OK, waiter.Wait(1000, &context));
EXPECT_EQ(12u, context);
hss = HandleSignalsState();
- dp->ConsumerRemoveWaiter(&waiter, &hss);
+ dp->ConsumerRemoveAwakable(&waiter, &hss);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfiable_signals);
@@ -475,9 +475,9 @@ TEST(LocalDataPipeTest, BasicConsumerWaiting) {
// Never writable.
waiter.Init();
hss = HandleSignalsState();
- EXPECT_EQ(
- MOJO_RESULT_FAILED_PRECONDITION,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 12, &hss));
+ EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 12,
+ &hss));
EXPECT_EQ(0u, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -485,11 +485,11 @@ TEST(LocalDataPipeTest, BasicConsumerWaiting) {
// Not yet readable.
waiter.Init();
ASSERT_EQ(MOJO_RESULT_OK,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 34,
- nullptr));
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 34,
+ nullptr));
EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, waiter.Wait(0, nullptr));
hss = HandleSignalsState();
- dp->ConsumerRemoveWaiter(&waiter, &hss);
+ dp->ConsumerRemoveAwakable(&waiter, &hss);
EXPECT_EQ(0u, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -504,9 +504,9 @@ TEST(LocalDataPipeTest, BasicConsumerWaiting) {
// Should already be readable.
waiter.Init();
hss = HandleSignalsState();
- EXPECT_EQ(
- MOJO_RESULT_ALREADY_EXISTS,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 56, &hss));
+ EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 56,
+ &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -520,9 +520,9 @@ TEST(LocalDataPipeTest, BasicConsumerWaiting) {
// Should still be readable.
waiter.Init();
hss = HandleSignalsState();
- EXPECT_EQ(
- MOJO_RESULT_ALREADY_EXISTS,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 78, &hss));
+ EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 78,
+ &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -541,9 +541,9 @@ TEST(LocalDataPipeTest, BasicConsumerWaiting) {
// Should still be readable.
waiter.Init();
hss = HandleSignalsState();
- EXPECT_EQ(
- MOJO_RESULT_ALREADY_EXISTS,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 78, &hss));
+ EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 78,
+ &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -562,8 +562,8 @@ TEST(LocalDataPipeTest, BasicConsumerWaiting) {
// Adding a waiter should now succeed.
waiter.Init();
ASSERT_EQ(MOJO_RESULT_OK,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 90,
- nullptr));
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 90,
+ nullptr));
// Write one element.
elements[0] = 789;
@@ -577,7 +577,7 @@ TEST(LocalDataPipeTest, BasicConsumerWaiting) {
EXPECT_EQ(MOJO_RESULT_OK, waiter.Wait(1000, &context));
EXPECT_EQ(90u, context);
hss = HandleSignalsState();
- dp->ConsumerRemoveWaiter(&waiter, &hss);
+ dp->ConsumerRemoveAwakable(&waiter, &hss);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -588,9 +588,9 @@ TEST(LocalDataPipeTest, BasicConsumerWaiting) {
// Should still be readable.
waiter.Init();
hss = HandleSignalsState();
- EXPECT_EQ(
- MOJO_RESULT_ALREADY_EXISTS,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 12, &hss));
+ EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 12,
+ &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
@@ -610,9 +610,9 @@ TEST(LocalDataPipeTest, BasicConsumerWaiting) {
// Should be never-readable.
waiter.Init();
hss = HandleSignalsState();
- EXPECT_EQ(
- MOJO_RESULT_FAILED_PRECONDITION,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 34, &hss));
+ EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 34,
+ &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfiable_signals);
@@ -646,9 +646,9 @@ TEST(LocalDataPipeTest, BasicConsumerWaiting) {
// Should already be readable.
waiter.Init();
hss = HandleSignalsState();
- EXPECT_EQ(
- MOJO_RESULT_ALREADY_EXISTS,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 12, &hss));
+ EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 12,
+ &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -670,9 +670,9 @@ TEST(LocalDataPipeTest, BasicConsumerWaiting) {
// Should still be readable.
waiter.Init();
hss = HandleSignalsState();
- EXPECT_EQ(
- MOJO_RESULT_ALREADY_EXISTS,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 34, &hss));
+ EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 34,
+ &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -694,8 +694,8 @@ TEST(LocalDataPipeTest, BasicConsumerWaiting) {
// Adding a waiter should now succeed.
waiter.Init();
ASSERT_EQ(MOJO_RESULT_OK,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 56,
- nullptr));
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 56,
+ nullptr));
// Close the producer.
dp->ProducerClose();
@@ -704,7 +704,7 @@ TEST(LocalDataPipeTest, BasicConsumerWaiting) {
EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION, waiter.Wait(1000, &context));
EXPECT_EQ(56u, context);
hss = HandleSignalsState();
- dp->ConsumerRemoveWaiter(&waiter, &hss);
+ dp->ConsumerRemoveAwakable(&waiter, &hss);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfiable_signals);
@@ -733,7 +733,7 @@ TEST(LocalDataPipeTest, BasicTwoPhaseWaiting) {
hss = HandleSignalsState();
EXPECT_EQ(
MOJO_RESULT_ALREADY_EXISTS,
- dp->ProducerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 0, &hss));
+ dp->ProducerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 0, &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -748,24 +748,24 @@ TEST(LocalDataPipeTest, BasicTwoPhaseWaiting) {
// At this point, it shouldn't be writable.
waiter.Init();
- ASSERT_EQ(
- MOJO_RESULT_OK,
- dp->ProducerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 1, nullptr));
+ ASSERT_EQ(MOJO_RESULT_OK,
+ dp->ProducerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 1,
+ nullptr));
EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, waiter.Wait(0, nullptr));
hss = HandleSignalsState();
- dp->ProducerRemoveWaiter(&waiter, &hss);
+ dp->ProducerRemoveAwakable(&waiter, &hss);
EXPECT_EQ(0u, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
// It shouldn't be readable yet either.
waiter.Init();
- ASSERT_EQ(
- MOJO_RESULT_OK,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 2, nullptr));
+ ASSERT_EQ(MOJO_RESULT_OK,
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 2,
+ nullptr));
EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, waiter.Wait(0, nullptr));
hss = HandleSignalsState();
- dp->ConsumerRemoveWaiter(&waiter, &hss);
+ dp->ConsumerRemoveAwakable(&waiter, &hss);
EXPECT_EQ(0u, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -779,7 +779,7 @@ TEST(LocalDataPipeTest, BasicTwoPhaseWaiting) {
hss = HandleSignalsState();
EXPECT_EQ(
MOJO_RESULT_ALREADY_EXISTS,
- dp->ProducerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 3, &hss));
+ dp->ProducerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 3, &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -789,7 +789,7 @@ TEST(LocalDataPipeTest, BasicTwoPhaseWaiting) {
hss = HandleSignalsState();
EXPECT_EQ(
MOJO_RESULT_ALREADY_EXISTS,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 4, &hss));
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 4, &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -809,7 +809,7 @@ TEST(LocalDataPipeTest, BasicTwoPhaseWaiting) {
hss = HandleSignalsState();
EXPECT_EQ(
MOJO_RESULT_ALREADY_EXISTS,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 5, &hss));
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 5, &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -831,19 +831,19 @@ TEST(LocalDataPipeTest, BasicTwoPhaseWaiting) {
hss = HandleSignalsState();
EXPECT_EQ(
MOJO_RESULT_ALREADY_EXISTS,
- dp->ProducerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 6, &hss));
+ dp->ProducerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 6, &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
// But not readable.
waiter.Init();
- ASSERT_EQ(
- MOJO_RESULT_OK,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 7, nullptr));
+ ASSERT_EQ(MOJO_RESULT_OK,
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 7,
+ nullptr));
EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, waiter.Wait(0, nullptr));
hss = HandleSignalsState();
- dp->ConsumerRemoveWaiter(&waiter, &hss);
+ dp->ConsumerRemoveAwakable(&waiter, &hss);
EXPECT_EQ(0u, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -856,7 +856,7 @@ TEST(LocalDataPipeTest, BasicTwoPhaseWaiting) {
hss = HandleSignalsState();
EXPECT_EQ(
MOJO_RESULT_ALREADY_EXISTS,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 8, &hss));
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 8, &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -886,19 +886,19 @@ TEST(LocalDataPipeTest, BasicMayDiscardWaiting) {
hss = HandleSignalsState();
EXPECT_EQ(
MOJO_RESULT_ALREADY_EXISTS,
- dp->ProducerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 0, &hss));
+ dp->ProducerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 0, &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
// Not readable.
waiter.Init();
- ASSERT_EQ(
- MOJO_RESULT_OK,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 1, nullptr));
+ ASSERT_EQ(MOJO_RESULT_OK,
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 1,
+ nullptr));
EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, waiter.Wait(0, nullptr));
hss = HandleSignalsState();
- dp->ConsumerRemoveWaiter(&waiter, &hss);
+ dp->ConsumerRemoveAwakable(&waiter, &hss);
EXPECT_EQ(0u, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -915,7 +915,7 @@ TEST(LocalDataPipeTest, BasicMayDiscardWaiting) {
hss = HandleSignalsState();
EXPECT_EQ(
MOJO_RESULT_ALREADY_EXISTS,
- dp->ProducerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 2, &hss));
+ dp->ProducerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 2, &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -925,7 +925,7 @@ TEST(LocalDataPipeTest, BasicMayDiscardWaiting) {
hss = HandleSignalsState();
EXPECT_EQ(
MOJO_RESULT_ALREADY_EXISTS,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 3, &hss));
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 3, &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -943,7 +943,7 @@ TEST(LocalDataPipeTest, BasicMayDiscardWaiting) {
hss = HandleSignalsState();
EXPECT_EQ(
MOJO_RESULT_ALREADY_EXISTS,
- dp->ProducerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 4, &hss));
+ dp->ProducerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 4, &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -953,7 +953,7 @@ TEST(LocalDataPipeTest, BasicMayDiscardWaiting) {
hss = HandleSignalsState();
EXPECT_EQ(
MOJO_RESULT_ALREADY_EXISTS,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 5, &hss));
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 5, &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
@@ -972,19 +972,19 @@ TEST(LocalDataPipeTest, BasicMayDiscardWaiting) {
hss = HandleSignalsState();
EXPECT_EQ(
MOJO_RESULT_ALREADY_EXISTS,
- dp->ProducerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 6, &hss));
+ dp->ProducerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 6, &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);
// No longer readable.
waiter.Init();
- ASSERT_EQ(
- MOJO_RESULT_OK,
- dp->ConsumerAddWaiter(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 7, nullptr));
+ ASSERT_EQ(MOJO_RESULT_OK,
+ dp->ConsumerAddAwakable(&waiter, MOJO_HANDLE_SIGNAL_READABLE, 7,
+ nullptr));
EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, waiter.Wait(0, nullptr));
hss = HandleSignalsState();
- dp->ConsumerRemoveWaiter(&waiter, &hss);
+ dp->ConsumerRemoveAwakable(&waiter, &hss);
EXPECT_EQ(0u, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
hss.satisfiable_signals);

Powered by Google App Engine
This is Rietveld 408576698