| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "ipc/ipc_test_base.h" | 7 #include "ipc/ipc_test_base.h" |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/process/kill.h" | 10 #include "base/process/kill.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 CHECK(!channel_.get()); | 70 CHECK(!channel_.get()); |
| 71 CHECK(!channel_proxy_.get()); | 71 CHECK(!channel_proxy_.get()); |
| 72 channel_ = IPC::Channel::CreateServer(channel_handle, listener); | 72 channel_ = IPC::Channel::CreateServer(channel_handle, listener); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void IPCTestBase::CreateChannelProxy( | 75 void IPCTestBase::CreateChannelProxy( |
| 76 IPC::Listener* listener, | 76 IPC::Listener* listener, |
| 77 base::SingleThreadTaskRunner* ipc_task_runner) { | 77 base::SingleThreadTaskRunner* ipc_task_runner) { |
| 78 CHECK(!channel_.get()); | 78 CHECK(!channel_.get()); |
| 79 CHECK(!channel_proxy_.get()); | 79 CHECK(!channel_proxy_.get()); |
| 80 channel_proxy_.reset(new IPC::ChannelProxy(GetChannelName(test_client_name_), | 80 channel_proxy_ = IPC::ChannelProxy::CreateServer( |
| 81 IPC::Channel::MODE_SERVER, | 81 GetChannelName(test_client_name_), |
| 82 listener, | 82 listener, |
| 83 ipc_task_runner)); | 83 ipc_task_runner); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void IPCTestBase::DestroyChannelProxy() { | 86 void IPCTestBase::DestroyChannelProxy() { |
| 87 CHECK(channel_proxy_.get()); | 87 CHECK(channel_proxy_.get()); |
| 88 channel_proxy_.reset(); | 88 channel_proxy_.reset(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 bool IPCTestBase::StartClient() { | 91 bool IPCTestBase::StartClient() { |
| 92 DCHECK(client_process_ == base::kNullProcessHandle); | 92 DCHECK(client_process_ == base::kNullProcessHandle); |
| 93 | 93 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 112 | 112 |
| 113 bool IPCTestBase::WaitForClientShutdown() { | 113 bool IPCTestBase::WaitForClientShutdown() { |
| 114 DCHECK(client_process_ != base::kNullProcessHandle); | 114 DCHECK(client_process_ != base::kNullProcessHandle); |
| 115 | 115 |
| 116 bool rv = base::WaitForSingleProcess(client_process_, | 116 bool rv = base::WaitForSingleProcess(client_process_, |
| 117 base::TimeDelta::FromSeconds(5)); | 117 base::TimeDelta::FromSeconds(5)); |
| 118 base::CloseProcessHandle(client_process_); | 118 base::CloseProcessHandle(client_process_); |
| 119 client_process_ = base::kNullProcessHandle; | 119 client_process_ = base::kNullProcessHandle; |
| 120 return rv; | 120 return rv; |
| 121 } | 121 } |
| OLD | NEW |