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

Unified Diff: mojo/edk/system/message_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/message_pipe_unittest.cc
diff --git a/mojo/edk/system/message_pipe_unittest.cc b/mojo/edk/system/message_pipe_unittest.cc
index c700891ac9ecc991da003e51debd72ea400aca7a..a30b63663d2968847b592de5c6c3fe6605342b44 100644
--- a/mojo/edk/system/message_pipe_unittest.cc
+++ b/mojo/edk/system/message_pipe_unittest.cc
@@ -337,25 +337,26 @@ TEST(MessagePipeTest, BasicWaiting) {
waiter.Init();
hss = HandleSignalsState();
EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
- mp->AddWaiter(0, &waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 0, &hss));
+ mp->AddAwakable(0, &waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 0, &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE, hss.satisfied_signals);
EXPECT_EQ(kAllSignals, hss.satisfiable_signals);
waiter.Init();
hss = HandleSignalsState();
EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
- mp->AddWaiter(0, &waiter, MOJO_HANDLE_SIGNAL_READABLE |
- MOJO_HANDLE_SIGNAL_WRITABLE,
- 0, &hss));
+ mp->AddAwakable(0, &waiter, MOJO_HANDLE_SIGNAL_READABLE |
+ MOJO_HANDLE_SIGNAL_WRITABLE,
+ 0, &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE, hss.satisfied_signals);
EXPECT_EQ(kAllSignals, hss.satisfiable_signals);
// Not yet readable.
waiter.Init();
- ASSERT_EQ(MOJO_RESULT_OK,
- mp->AddWaiter(0, &waiter, MOJO_HANDLE_SIGNAL_READABLE, 1, nullptr));
+ ASSERT_EQ(
+ MOJO_RESULT_OK,
+ mp->AddAwakable(0, &waiter, MOJO_HANDLE_SIGNAL_READABLE, 1, nullptr));
EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, waiter.Wait(0, nullptr));
hss = HandleSignalsState();
- mp->RemoveWaiter(0, &waiter, &hss);
+ mp->RemoveAwakable(0, &waiter, &hss);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE, hss.satisfied_signals);
EXPECT_EQ(kAllSignals, hss.satisfiable_signals);
@@ -363,10 +364,10 @@ TEST(MessagePipeTest, BasicWaiting) {
waiter.Init();
ASSERT_EQ(
MOJO_RESULT_OK,
- mp->AddWaiter(0, &waiter, MOJO_HANDLE_SIGNAL_PEER_CLOSED, 2, nullptr));
+ mp->AddAwakable(0, &waiter, MOJO_HANDLE_SIGNAL_PEER_CLOSED, 2, nullptr));
EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, waiter.Wait(0, nullptr));
hss = HandleSignalsState();
- mp->RemoveWaiter(0, &waiter, &hss);
+ mp->RemoveAwakable(0, &waiter, &hss);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE, hss.satisfied_signals);
EXPECT_EQ(kAllSignals, hss.satisfiable_signals);
@@ -380,16 +381,16 @@ TEST(MessagePipeTest, BasicWaiting) {
waiter.Init();
hss = HandleSignalsState();
EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
- mp->AddWaiter(1, &waiter, MOJO_HANDLE_SIGNAL_READABLE, 3, &hss));
+ mp->AddAwakable(1, &waiter, MOJO_HANDLE_SIGNAL_READABLE, 3, &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_WRITABLE,
hss.satisfied_signals);
EXPECT_EQ(kAllSignals, hss.satisfiable_signals);
waiter.Init();
hss = HandleSignalsState();
EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
- mp->AddWaiter(1, &waiter, MOJO_HANDLE_SIGNAL_READABLE |
- MOJO_HANDLE_SIGNAL_WRITABLE,
- 0, &hss));
+ mp->AddAwakable(1, &waiter, MOJO_HANDLE_SIGNAL_READABLE |
+ MOJO_HANDLE_SIGNAL_WRITABLE,
+ 0, &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_WRITABLE,
hss.satisfied_signals);
EXPECT_EQ(kAllSignals, hss.satisfiable_signals);
@@ -397,7 +398,7 @@ TEST(MessagePipeTest, BasicWaiting) {
waiter.Init();
hss = HandleSignalsState();
EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
- mp->AddWaiter(1, &waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 4, &hss));
+ mp->AddAwakable(1, &waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 4, &hss));
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_WRITABLE,
hss.satisfied_signals);
EXPECT_EQ(kAllSignals, hss.satisfiable_signals);
@@ -408,8 +409,9 @@ TEST(MessagePipeTest, BasicWaiting) {
// Port 1 should be signaled with peer closed.
waiter.Init();
hss = HandleSignalsState();
- EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
- mp->AddWaiter(1, &waiter, MOJO_HANDLE_SIGNAL_PEER_CLOSED, 5, &hss));
+ EXPECT_EQ(
+ MOJO_RESULT_ALREADY_EXISTS,
+ mp->AddAwakable(1, &waiter, MOJO_HANDLE_SIGNAL_PEER_CLOSED, 5, &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,
@@ -419,7 +421,7 @@ TEST(MessagePipeTest, BasicWaiting) {
waiter.Init();
hss = HandleSignalsState();
EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
- mp->AddWaiter(1, &waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 6, &hss));
+ mp->AddAwakable(1, &waiter, MOJO_HANDLE_SIGNAL_WRITABLE, 6, &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,
@@ -429,7 +431,7 @@ TEST(MessagePipeTest, BasicWaiting) {
waiter.Init();
hss = HandleSignalsState();
EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
- mp->AddWaiter(1, &waiter, MOJO_HANDLE_SIGNAL_READABLE, 7, &hss));
+ mp->AddAwakable(1, &waiter, MOJO_HANDLE_SIGNAL_READABLE, 7, &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,
@@ -447,8 +449,9 @@ TEST(MessagePipeTest, BasicWaiting) {
// Now port 1 should no longer be readable.
waiter.Init();
hss = HandleSignalsState();
- EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
- mp->AddWaiter(1, &waiter, MOJO_HANDLE_SIGNAL_READABLE, 8, nullptr));
+ EXPECT_EQ(
+ MOJO_RESULT_FAILED_PRECONDITION,
+ mp->AddAwakable(1, &waiter, MOJO_HANDLE_SIGNAL_READABLE, 8, nullptr));
EXPECT_EQ(0u, hss.satisfied_signals);
EXPECT_EQ(0u, hss.satisfiable_signals);
@@ -469,8 +472,8 @@ TEST(MessagePipeTest, ThreadedWaiting) {
thread.waiter()->Init();
ASSERT_EQ(MOJO_RESULT_OK,
- mp->AddWaiter(1, thread.waiter(), MOJO_HANDLE_SIGNAL_READABLE, 1,
- nullptr));
+ mp->AddAwakable(1, thread.waiter(), MOJO_HANDLE_SIGNAL_READABLE,
+ 1, nullptr));
thread.Start();
buffer[0] = 123456789;
@@ -480,7 +483,7 @@ TEST(MessagePipeTest, ThreadedWaiting) {
nullptr, MOJO_WRITE_MESSAGE_FLAG_NONE));
HandleSignalsState hss;
- mp->RemoveWaiter(1, thread.waiter(), &hss);
+ mp->RemoveAwakable(1, thread.waiter(), &hss);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_WRITABLE,
hss.satisfied_signals);
EXPECT_EQ(kAllSignals, hss.satisfiable_signals);
@@ -499,16 +502,16 @@ TEST(MessagePipeTest, ThreadedWaiting) {
thread.waiter()->Init();
ASSERT_EQ(MOJO_RESULT_OK,
- mp->AddWaiter(1, thread.waiter(), MOJO_HANDLE_SIGNAL_READABLE, 2,
- nullptr));
+ mp->AddAwakable(1, thread.waiter(), MOJO_HANDLE_SIGNAL_READABLE,
+ 2, nullptr));
thread.Start();
// Close port 1 first -- this should result in the waiter being cancelled.
- mp->CancelAllWaiters(1);
+ mp->CancelAllAwakables(1);
mp->Close(1);
- // Port 1 is closed, so |Dispatcher::RemoveWaiter()| wouldn't call into the
- // |MessagePipe| to remove any waiter.
+ // Port 1 is closed, so |Dispatcher::RemoveAwakable()| wouldn't call into
+ // the |MessagePipe| to remove any waiter.
mp->Close(0);
} // Joins |thread|.
@@ -522,16 +525,16 @@ TEST(MessagePipeTest, ThreadedWaiting) {
thread.waiter()->Init();
ASSERT_EQ(MOJO_RESULT_OK,
- mp->AddWaiter(1, thread.waiter(), MOJO_HANDLE_SIGNAL_PEER_CLOSED,
- 3, nullptr));
+ mp->AddAwakable(1, thread.waiter(),
+ MOJO_HANDLE_SIGNAL_PEER_CLOSED, 3, nullptr));
thread.Start();
// Close port 1 first -- this should result in the waiter being cancelled.
- mp->CancelAllWaiters(1);
+ mp->CancelAllAwakables(1);
mp->Close(1);
- // Port 1 is closed, so |Dispatcher::RemoveWaiter()| wouldn't call into the
- // |MessagePipe| to remove any waiter.
+ // Port 1 is closed, so |Dispatcher::RemoveAwakable()| wouldn't call into
+ // the |MessagePipe| to remove any waiter.
mp->Close(0);
} // Joins |thread|.
@@ -545,21 +548,21 @@ TEST(MessagePipeTest, ThreadedWaiting) {
thread.waiter()->Init();
ASSERT_EQ(MOJO_RESULT_OK,
- mp->AddWaiter(1, thread.waiter(), MOJO_HANDLE_SIGNAL_READABLE, 4,
- nullptr));
+ mp->AddAwakable(1, thread.waiter(), MOJO_HANDLE_SIGNAL_READABLE,
+ 4, nullptr));
thread.Start();
// Close port 0 first -- this should wake the waiter up, since port 1 will
// never be readable.
- mp->CancelAllWaiters(0);
+ mp->CancelAllAwakables(0);
mp->Close(0);
HandleSignalsState hss;
- mp->RemoveWaiter(1, thread.waiter(), &hss);
+ mp->RemoveAwakable(1, thread.waiter(), &hss);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfied_signals);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfiable_signals);
- mp->CancelAllWaiters(1);
+ mp->CancelAllAwakables(1);
mp->Close(1);
} // Joins |thread|.
EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION, result);

Powered by Google App Engine
This is Rietveld 408576698