| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1305 | 1305 |
| 1306 // Wait on handle 0 using MojoWait. | 1306 // Wait on handle 0 using MojoWait. |
| 1307 EXPECT_EQ(MOJO_RESULT_OK, MojoWait(handles[0], MOJO_HANDLE_SIGNAL_PEER_CLOSED, | 1307 EXPECT_EQ(MOJO_RESULT_OK, MojoWait(handles[0], MOJO_HANDLE_SIGNAL_PEER_CLOSED, |
| 1308 MOJO_DEADLINE_INDEFINITE, nullptr)); | 1308 MOJO_DEADLINE_INDEFINITE, nullptr)); |
| 1309 | 1309 |
| 1310 base::MessageLoop message_loop; | 1310 base::MessageLoop message_loop; |
| 1311 | 1311 |
| 1312 // Wait on handle 1 using a Watcher. | 1312 // Wait on handle 1 using a Watcher. |
| 1313 { | 1313 { |
| 1314 base::RunLoop run_loop; | 1314 base::RunLoop run_loop; |
| 1315 Watcher watcher; | 1315 Watcher watcher(FROM_HERE); |
| 1316 watcher.Start(Handle(handles[1]), MOJO_HANDLE_SIGNAL_PEER_CLOSED, | 1316 watcher.Start(Handle(handles[1]), MOJO_HANDLE_SIGNAL_PEER_CLOSED, |
| 1317 base::Bind([] (base::RunLoop* loop, MojoResult result) { | 1317 base::Bind([] (base::RunLoop* loop, MojoResult result) { |
| 1318 EXPECT_EQ(MOJO_RESULT_OK, result); | 1318 EXPECT_EQ(MOJO_RESULT_OK, result); |
| 1319 loop->Quit(); | 1319 loop->Quit(); |
| 1320 }, &run_loop)); | 1320 }, &run_loop)); |
| 1321 run_loop.Run(); | 1321 run_loop.Run(); |
| 1322 } | 1322 } |
| 1323 | 1323 |
| 1324 // Wait on handle 2 by polling with MojoReadMessage. | 1324 // Wait on handle 2 by polling with MojoReadMessage. |
| 1325 MojoResult result; | 1325 MojoResult result; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1421 INSTANTIATE_TEST_CASE_P( | 1421 INSTANTIATE_TEST_CASE_P( |
| 1422 , | 1422 , |
| 1423 MultiprocessMessagePipeTestWithPeerSupport, | 1423 MultiprocessMessagePipeTestWithPeerSupport, |
| 1424 testing::Values(test::MojoTestBase::LaunchType::CHILD, | 1424 testing::Values(test::MojoTestBase::LaunchType::CHILD, |
| 1425 test::MojoTestBase::LaunchType::PEER, | 1425 test::MojoTestBase::LaunchType::PEER, |
| 1426 test::MojoTestBase::LaunchType::NAMED_CHILD, | 1426 test::MojoTestBase::LaunchType::NAMED_CHILD, |
| 1427 test::MojoTestBase::LaunchType::NAMED_PEER)); | 1427 test::MojoTestBase::LaunchType::NAMED_PEER)); |
| 1428 } // namespace | 1428 } // namespace |
| 1429 } // namespace edk | 1429 } // namespace edk |
| 1430 } // namespace mojo | 1430 } // namespace mojo |
| OLD | NEW |