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

Unified Diff: mojo/system/message_pipe_dispatcher_unittest.cc

Issue 60103005: Mojo: First stab at making MessagePipes work across OS pipes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 1 month 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/system/message_pipe_dispatcher_unittest.cc
diff --git a/mojo/system/message_pipe_dispatcher_unittest.cc b/mojo/system/message_pipe_dispatcher_unittest.cc
index 6e7bfcf47b63cd175b3995a070481de3c09dab41..32c978bf35a37d4a58ec7612dc2ff60dd2fd0d87 100644
--- a/mojo/system/message_pipe_dispatcher_unittest.cc
+++ b/mojo/system/message_pipe_dispatcher_unittest.cc
@@ -211,6 +211,14 @@ TEST(MessagePipeDispatcherTest, BasicClosed) {
EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
d_0->AddWaiter(&w, MOJO_WAIT_FLAG_READABLE, 0));
+ // Try reading from |d_1|; should fail (nothing to read).
+ buffer[0] = 0;
+ buffer_size = kBufferSize;
+ EXPECT_EQ(MOJO_RESULT_NOT_FOUND,
+ d_1->ReadMessage(buffer, &buffer_size,
+ NULL, NULL,
+ MOJO_READ_MESSAGE_FLAG_NONE));
+
// Close |d_1|.
EXPECT_EQ(MOJO_RESULT_OK, d_1->Close());
@@ -254,10 +262,11 @@ TEST(MessagePipeDispatcherTest, BasicClosed) {
EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
d_0->AddWaiter(&w, MOJO_WAIT_FLAG_WRITABLE, 4));
- // Try reading from |d_0|; should fail (nothing to read).
+ // Try reading from |d_0|; should fail (nothing to read and other end
+ // closed).
buffer[0] = 0;
buffer_size = kBufferSize;
- EXPECT_EQ(MOJO_RESULT_NOT_FOUND,
+ EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
d_0->ReadMessage(buffer, &buffer_size,
NULL, NULL,
MOJO_READ_MESSAGE_FLAG_NONE));

Powered by Google App Engine
This is Rietveld 408576698