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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 // Close the remote end, simulating child death before the child connects to | 217 // Close the remote end, simulating child death before the child connects to |
218 // the reserved port. | 218 // the reserved port. |
219 ignore_result(pair.PassClientHandle()); | 219 ignore_result(pair.PassClientHandle()); |
220 | 220 |
221 EXPECT_EQ(MOJO_RESULT_OK, MojoWait(parent_mp.get().value(), | 221 EXPECT_EQ(MOJO_RESULT_OK, MojoWait(parent_mp.get().value(), |
222 MOJO_HANDLE_SIGNAL_PEER_CLOSED, | 222 MOJO_HANDLE_SIGNAL_PEER_CLOSED, |
223 MOJO_DEADLINE_INDEFINITE, | 223 MOJO_DEADLINE_INDEFINITE, |
224 nullptr)); | 224 nullptr)); |
225 } | 225 } |
226 | 226 |
227 #if defined(OS_ANDROID) | 227 TEST_F(EmbedderTest, PipeSetup_LaunchFailure) { |
228 // This test is suspected to be flaky on android https://crbug.com/663998. | |
229 #define MAYBE_PipeSetup_LaunchFailure \ | |
230 DISABLED_PipeSetup_LaunchFailure | |
231 #else | |
232 #define MAYBE_PipeSetup_LaunchFailure \ | |
233 PipeSetup_LaunchFailure | |
234 #endif | |
235 TEST_F(EmbedderTest, MAYBE_PipeSetup_LaunchFailure) { | |
236 PlatformChannelPair pair; | 228 PlatformChannelPair pair; |
237 | 229 |
238 std::string child_token = GenerateRandomToken(); | 230 std::string child_token = GenerateRandomToken(); |
239 std::string pipe_token = GenerateRandomToken(); | 231 std::string pipe_token = GenerateRandomToken(); |
240 | 232 |
241 ScopedMessagePipeHandle parent_mp = | 233 ScopedMessagePipeHandle parent_mp = |
242 CreateParentMessagePipe(pipe_token, child_token); | 234 CreateParentMessagePipe(pipe_token, child_token); |
243 | 235 |
244 ChildProcessLaunchFailed(child_token); | 236 ChildProcessLaunchFailed(child_token); |
245 EXPECT_EQ(MOJO_RESULT_OK, MojoWait(parent_mp.get().value(), | 237 EXPECT_EQ(MOJO_RESULT_OK, MojoWait(parent_mp.get().value(), |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 client_mp) { | 653 client_mp) { |
662 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, |
663 MOJO_DEADLINE_INDEFINITE, nullptr)); | 655 MOJO_DEADLINE_INDEFINITE, nullptr)); |
664 } | 656 } |
665 | 657 |
666 #endif // !defined(OS_IOS) | 658 #endif // !defined(OS_IOS) |
667 | 659 |
668 } // namespace | 660 } // namespace |
669 } // namespace edk | 661 } // namespace edk |
670 } // namespace mojo | 662 } // namespace mojo |
OLD | NEW |