| 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 "mojo/common/test/multiprocess_test_base.h" | 5 #include "mojo/common/test/multiprocess_test_base.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/process/kill.h" | 9 #include "base/process/kill.h" |
| 10 #include "base/process/process_handle.h" | 10 #include "base/process/process_handle.h" |
| 11 // TODO(vtl): Remove build_config.h include when fully implemented on Windows. |
| 11 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 12 | 13 |
| 13 namespace mojo { | 14 namespace mojo { |
| 14 namespace test { | 15 namespace test { |
| 15 | 16 |
| 16 MultiprocessTestBase::MultiprocessTestBase() | 17 MultiprocessTestBase::MultiprocessTestBase() |
| 17 : test_child_handle_(base::kNullProcessHandle) { | 18 : test_child_handle_(base::kNullProcessHandle) { |
| 18 } | 19 } |
| 19 | 20 |
| 20 MultiprocessTestBase::~MultiprocessTestBase() { | 21 MultiprocessTestBase::~MultiprocessTestBase() { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 #if defined(OS_POSIX) | 90 #if defined(OS_POSIX) |
| 90 base::FileHandleMappingVector unused; | 91 base::FileHandleMappingVector unused; |
| 91 platform_server_channel_->GetDataNeededToPassClientChannelToChildProcess( | 92 platform_server_channel_->GetDataNeededToPassClientChannelToChildProcess( |
| 92 &command_line, &unused); | 93 &command_line, &unused); |
| 93 #endif | 94 #endif |
| 94 return command_line; | 95 return command_line; |
| 95 } | 96 } |
| 96 | 97 |
| 97 // static | 98 // static |
| 98 void MultiprocessTestBase::ChildSetup() { | 99 void MultiprocessTestBase::ChildSetup() { |
| 99 // TODO(vtl) | 100 CHECK(CommandLine::InitializedForCurrentProcess()); |
| 100 NOTIMPLEMENTED(); | 101 // TODO(vtl): Not implemented on Windows yet. |
| 102 #if defined(OS_POSIX) |
| 103 platform_client_channel = |
| 104 system::PlatformClientChannel::CreateFromParentProcess( |
| 105 *CommandLine::ForCurrentProcess()); |
| 106 CHECK(platform_client_channel.get()); |
| 107 #endif |
| 101 } | 108 } |
| 102 | 109 |
| 110 // static |
| 111 scoped_ptr<system::PlatformClientChannel> |
| 112 MultiprocessTestBase::platform_client_channel; |
| 113 |
| 103 } // namespace test | 114 } // namespace test |
| 104 } // namespace mojo | 115 } // namespace mojo |
| OLD | NEW |