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 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1267 | 1267 |
1268 // Wait on handle 0 using MojoWait. | 1268 // Wait on handle 0 using MojoWait. |
1269 EXPECT_EQ(MOJO_RESULT_OK, MojoWait(handles[0], MOJO_HANDLE_SIGNAL_PEER_CLOSED, | 1269 EXPECT_EQ(MOJO_RESULT_OK, MojoWait(handles[0], MOJO_HANDLE_SIGNAL_PEER_CLOSED, |
1270 MOJO_DEADLINE_INDEFINITE, nullptr)); | 1270 MOJO_DEADLINE_INDEFINITE, nullptr)); |
1271 | 1271 |
1272 base::MessageLoop message_loop; | 1272 base::MessageLoop message_loop; |
1273 | 1273 |
1274 // Wait on handle 1 using a Watcher. | 1274 // Wait on handle 1 using a Watcher. |
1275 { | 1275 { |
1276 base::RunLoop run_loop; | 1276 base::RunLoop run_loop; |
1277 Watcher watcher(FROM_HERE); | 1277 Watcher watcher(FROM_HERE, Watcher::ArmingPolicy::AUTOMATIC); |
1278 watcher.Start(Handle(handles[1]), MOJO_HANDLE_SIGNAL_PEER_CLOSED, | 1278 watcher.Start(Handle(handles[1]), MOJO_HANDLE_SIGNAL_PEER_CLOSED, |
1279 base::Bind([] (base::RunLoop* loop, MojoResult result) { | 1279 base::Bind([] (base::RunLoop* loop, MojoResult result) { |
1280 EXPECT_EQ(MOJO_RESULT_OK, result); | 1280 EXPECT_EQ(MOJO_RESULT_OK, result); |
1281 loop->Quit(); | 1281 loop->Quit(); |
1282 }, &run_loop)); | 1282 }, &run_loop)); |
1283 run_loop.Run(); | 1283 run_loop.Run(); |
1284 } | 1284 } |
1285 | 1285 |
1286 // Wait on handle 2 by polling with MojoReadMessage. | 1286 // Wait on handle 2 by polling with MojoReadMessage. |
1287 MojoResult result; | 1287 MojoResult result; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1383 INSTANTIATE_TEST_CASE_P( | 1383 INSTANTIATE_TEST_CASE_P( |
1384 , | 1384 , |
1385 MultiprocessMessagePipeTestWithPeerSupport, | 1385 MultiprocessMessagePipeTestWithPeerSupport, |
1386 testing::Values(test::MojoTestBase::LaunchType::CHILD, | 1386 testing::Values(test::MojoTestBase::LaunchType::CHILD, |
1387 test::MojoTestBase::LaunchType::PEER, | 1387 test::MojoTestBase::LaunchType::PEER, |
1388 test::MojoTestBase::LaunchType::NAMED_CHILD, | 1388 test::MojoTestBase::LaunchType::NAMED_CHILD, |
1389 test::MojoTestBase::LaunchType::NAMED_PEER)); | 1389 test::MojoTestBase::LaunchType::NAMED_PEER)); |
1390 } // namespace | 1390 } // namespace |
1391 } // namespace edk | 1391 } // namespace edk |
1392 } // namespace mojo | 1392 } // namespace mojo |
OLD | NEW |