| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 void IPCTestBase::DestroyChannel() { | 62 void IPCTestBase::DestroyChannel() { |
| 63 DCHECK(channel_.get()); | 63 DCHECK(channel_.get()); |
| 64 channel_.reset(); | 64 channel_.reset(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void IPCTestBase::CreateChannelFromChannelHandle( | 67 void IPCTestBase::CreateChannelFromChannelHandle( |
| 68 const IPC::ChannelHandle& channel_handle, | 68 const IPC::ChannelHandle& channel_handle, |
| 69 IPC::Listener* listener) { | 69 IPC::Listener* listener) { |
| 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_.reset(new IPC::Channel(channel_handle, |
| 73 IPC::Channel::MODE_SERVER, |
| 74 listener)); |
| 73 } | 75 } |
| 74 | 76 |
| 75 void IPCTestBase::CreateChannelProxy( | 77 void IPCTestBase::CreateChannelProxy( |
| 76 IPC::Listener* listener, | 78 IPC::Listener* listener, |
| 77 base::SingleThreadTaskRunner* ipc_task_runner) { | 79 base::SingleThreadTaskRunner* ipc_task_runner) { |
| 78 CHECK(!channel_.get()); | 80 CHECK(!channel_.get()); |
| 79 CHECK(!channel_proxy_.get()); | 81 CHECK(!channel_proxy_.get()); |
| 80 channel_proxy_.reset(new IPC::ChannelProxy(GetChannelName(test_client_name_), | 82 channel_proxy_.reset(new IPC::ChannelProxy(GetChannelName(test_client_name_), |
| 81 IPC::Channel::MODE_SERVER, | 83 IPC::Channel::MODE_SERVER, |
| 82 listener, | 84 listener, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 112 | 114 |
| 113 bool IPCTestBase::WaitForClientShutdown() { | 115 bool IPCTestBase::WaitForClientShutdown() { |
| 114 DCHECK(client_process_ != base::kNullProcessHandle); | 116 DCHECK(client_process_ != base::kNullProcessHandle); |
| 115 | 117 |
| 116 bool rv = base::WaitForSingleProcess(client_process_, | 118 bool rv = base::WaitForSingleProcess(client_process_, |
| 117 base::TimeDelta::FromSeconds(5)); | 119 base::TimeDelta::FromSeconds(5)); |
| 118 base::CloseProcessHandle(client_process_); | 120 base::CloseProcessHandle(client_process_); |
| 119 client_process_ = base::kNullProcessHandle; | 121 client_process_ = base::kNullProcessHandle; |
| 120 return rv; | 122 return rv; |
| 121 } | 123 } |
| OLD | NEW |