| 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 // Note: This file also tests child_process.*. | 5 // Note: This file also tests child_process.*. |
| 6 | 6 |
| 7 #include "mojo/shell/runner/host/child_process_host.h" | 7 #include "mojo/shell/runner/host/child_process_host.h" |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 NativeRunnerDelegateImpl native_runner_delegate; | 93 NativeRunnerDelegateImpl native_runner_delegate; |
| 94 ChildProcessHost child_process_host(blocking_pool.get(), | 94 ChildProcessHost child_process_host(blocking_pool.get(), |
| 95 &native_runner_delegate, false, | 95 &native_runner_delegate, false, |
| 96 Identity(), base::FilePath()); | 96 Identity(), base::FilePath()); |
| 97 base::RunLoop run_loop; | 97 base::RunLoop run_loop; |
| 98 child_process_host.Start( | 98 child_process_host.Start( |
| 99 base::Bind(&ProcessReadyCallbackAdapater, run_loop.QuitClosure())); | 99 base::Bind(&ProcessReadyCallbackAdapater, run_loop.QuitClosure())); |
| 100 run_loop.Run(); | 100 run_loop.Run(); |
| 101 | 101 |
| 102 child_process_host.ExitNow(123); | 102 child_process_host.Join(); |
| 103 int exit_code = child_process_host.Join(); | |
| 104 VLOG(2) << "Joined child: exit_code = " << exit_code; | |
| 105 EXPECT_EQ(123, exit_code); | |
| 106 blocking_pool->Shutdown(); | 103 blocking_pool->Shutdown(); |
| 107 edk::ShutdownIPCSupport(); | 104 edk::ShutdownIPCSupport(); |
| 108 EXPECT_EQ(1u, native_runner_delegate.get_and_clear_adjust_count()); | 105 EXPECT_EQ(1u, native_runner_delegate.get_and_clear_adjust_count()); |
| 109 } | 106 } |
| 110 | 107 |
| 111 } // namespace | 108 } // namespace |
| 112 } // namespace shell | 109 } // namespace shell |
| 113 } // namespace mojo | 110 } // namespace mojo |
| OLD | NEW |