OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/embedder/embedder.h" | 5 #include "mojo/edk/embedder/embedder.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 203 |
204 EXPECT_EQ(kHello, ReadMessage(child_mp.get().value())); | 204 EXPECT_EQ(kHello, ReadMessage(child_mp.get().value())); |
205 } | 205 } |
206 | 206 |
207 TEST_F(EmbedderTest, PipeSetup_LaunchDeath) { | 207 TEST_F(EmbedderTest, PipeSetup_LaunchDeath) { |
208 PlatformChannelPair pair; | 208 PlatformChannelPair pair; |
209 | 209 |
210 PendingProcessConnection process; | 210 PendingProcessConnection process; |
211 std::string pipe_token; | 211 std::string pipe_token; |
212 ScopedMessagePipeHandle parent_mp = process.CreateMessagePipe(&pipe_token); | 212 ScopedMessagePipeHandle parent_mp = process.CreateMessagePipe(&pipe_token); |
213 process.Connect(base::GetCurrentProcessHandle(), pair.PassServerHandle()); | 213 process.Connect(base::GetCurrentProcessHandle(), |
| 214 ConnectionParams(pair.PassServerHandle())); |
214 | 215 |
215 // Close the remote end, simulating child death before the child connects to | 216 // Close the remote end, simulating child death before the child connects to |
216 // the reserved port. | 217 // the reserved port. |
217 ignore_result(pair.PassClientHandle()); | 218 ignore_result(pair.PassClientHandle()); |
218 | 219 |
219 EXPECT_EQ(MOJO_RESULT_OK, MojoWait(parent_mp.get().value(), | 220 EXPECT_EQ(MOJO_RESULT_OK, MojoWait(parent_mp.get().value(), |
220 MOJO_HANDLE_SIGNAL_PEER_CLOSED, | 221 MOJO_HANDLE_SIGNAL_PEER_CLOSED, |
221 MOJO_DEADLINE_INDEFINITE, | 222 MOJO_DEADLINE_INDEFINITE, |
222 nullptr)); | 223 nullptr)); |
223 } | 224 } |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 client_mp) { | 653 client_mp) { |
653 ASSERT_EQ(MOJO_RESULT_OK, MojoWait(client_mp, MOJO_HANDLE_SIGNAL_PEER_CLOSED, | 654 ASSERT_EQ(MOJO_RESULT_OK, MojoWait(client_mp, MOJO_HANDLE_SIGNAL_PEER_CLOSED, |
654 MOJO_DEADLINE_INDEFINITE, nullptr)); | 655 MOJO_DEADLINE_INDEFINITE, nullptr)); |
655 } | 656 } |
656 | 657 |
657 #endif // !defined(OS_IOS) | 658 #endif // !defined(OS_IOS) |
658 | 659 |
659 } // namespace | 660 } // namespace |
660 } // namespace edk | 661 } // namespace edk |
661 } // namespace mojo | 662 } // namespace mojo |
OLD | NEW |