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

Side by Side Diff: mojo/edk/system/core_unittest.cc

Issue 1488853002: Add multiplexing of message pipes in the new EDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tsepez review comments Created 5 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 unified diff | Download patch
« no previous file with comments | « mojo/edk/system/core_test_base.h ('k') | mojo/edk/system/data_pipe_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/edk/system/core.h" 5 #include "mojo/edk/system/core.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 #endif 723 #endif
724 ASSERT_EQ(MOJO_RESULT_INVALID_ARGUMENT, 724 ASSERT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
725 core()->WriteMessage(h_passing[0], kHello, kHelloSize, 725 core()->WriteMessage(h_passing[0], kHello, kHelloSize,
726 &h_passing[1], 1, 726 &h_passing[1], 1,
727 MOJO_WRITE_MESSAGE_FLAG_NONE)); 727 MOJO_WRITE_MESSAGE_FLAG_NONE));
728 #if defined(OS_WIN) 728 #if defined(OS_WIN)
729 } 729 }
730 #endif 730 #endif
731 731
732 MojoHandle h_passed[2]; 732 MojoHandle h_passed[2];
733 MojoCreateMessagePipeOptions options;
734 options.struct_size = sizeof(MojoCreateMessagePipeOptions);
735 options.flags = MOJO_CREATE_MESSAGE_PIPE_OPTIONS_FLAG_TRANSFERABLE;
733 ASSERT_EQ(MOJO_RESULT_OK, 736 ASSERT_EQ(MOJO_RESULT_OK,
734 core()->CreateMessagePipe(nullptr, &h_passed[0], &h_passed[1])); 737 core()->CreateMessagePipe(&options, &h_passed[0], &h_passed[1]));
735 738
736 // Make sure that |h_passed[]| work properly. 739 // Make sure that |h_passed[]| work properly.
737 ASSERT_EQ(MOJO_RESULT_OK, 740 ASSERT_EQ(MOJO_RESULT_OK,
738 core()->WriteMessage(h_passed[0], kHello, kHelloSize, nullptr, 0, 741 core()->WriteMessage(h_passed[0], kHello, kHelloSize, nullptr, 0,
739 MOJO_WRITE_MESSAGE_FLAG_NONE)); 742 MOJO_WRITE_MESSAGE_FLAG_NONE));
740 hss = kEmptyMojoHandleSignalsState; 743 hss = kEmptyMojoHandleSignalsState;
741 ASSERT_EQ(MOJO_RESULT_OK, 744 ASSERT_EQ(MOJO_RESULT_OK,
742 core()->Wait(h_passed[1], MOJO_HANDLE_SIGNAL_READABLE, 1000000000, 745 core()->Wait(h_passed[1], MOJO_HANDLE_SIGNAL_READABLE, 1000000000,
743 &hss)); 746 &hss));
744 ASSERT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_WRITABLE, 747 ASSERT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_WRITABLE,
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 ASSERT_EQ(MOJO_RESULT_BUSY, waiter.result); 1269 ASSERT_EQ(MOJO_RESULT_BUSY, waiter.result);
1267 1270
1268 ASSERT_EQ(MOJO_RESULT_OK, core()->Close(h)); 1271 ASSERT_EQ(MOJO_RESULT_OK, core()->Close(h));
1269 } 1272 }
1270 1273
1271 // TODO(vtl): Test |DuplicateBufferHandle()| and |MapBuffer()|. 1274 // TODO(vtl): Test |DuplicateBufferHandle()| and |MapBuffer()|.
1272 1275
1273 } // namespace 1276 } // namespace
1274 } // namespace edk 1277 } // namespace edk
1275 } // namespace mojo 1278 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/core_test_base.h ('k') | mojo/edk/system/data_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698