OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |