| 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 "ipc/ipc_test_base.h" | 5 #include "ipc/ipc_test_base.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 IPCTestBase::~IPCTestBase() { | 31 IPCTestBase::~IPCTestBase() { |
| 32 } | 32 } |
| 33 | 33 |
| 34 void IPCTestBase::TearDown() { | 34 void IPCTestBase::TearDown() { |
| 35 message_loop_.reset(); | 35 message_loop_.reset(); |
| 36 MultiProcessTest::TearDown(); | 36 MultiProcessTest::TearDown(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void IPCTestBase::Init(const std::string& test_client_name) { | 39 void IPCTestBase::Init(const std::string& test_client_name) { |
| 40 InitWithCustomMessageLoop(test_client_name, | 40 InitWithCustomMessageLoop(test_client_name, |
| 41 base::WrapUnique(new base::MessageLoopForIO())); | 41 base::MakeUnique<base::MessageLoopForIO>()); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void IPCTestBase::InitWithCustomMessageLoop( | 44 void IPCTestBase::InitWithCustomMessageLoop( |
| 45 const std::string& test_client_name, | 45 const std::string& test_client_name, |
| 46 std::unique_ptr<base::MessageLoop> message_loop) { | 46 std::unique_ptr<base::MessageLoop> message_loop) { |
| 47 DCHECK(!test_client_name.empty()); | 47 DCHECK(!test_client_name.empty()); |
| 48 DCHECK(test_client_name_.empty()); | 48 DCHECK(test_client_name_.empty()); |
| 49 DCHECK(!message_loop_); | 49 DCHECK(!message_loop_); |
| 50 | 50 |
| 51 test_client_name_ = test_client_name; | 51 test_client_name_ = test_client_name; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 161 |
| 162 scoped_refptr<base::SingleThreadTaskRunner> IPCTestBase::task_runner() { | 162 scoped_refptr<base::SingleThreadTaskRunner> IPCTestBase::task_runner() { |
| 163 return message_loop_->task_runner(); | 163 return message_loop_->task_runner(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 std::unique_ptr<IPC::ChannelFactory> IPCTestBase::CreateChannelFactory( | 166 std::unique_ptr<IPC::ChannelFactory> IPCTestBase::CreateChannelFactory( |
| 167 const IPC::ChannelHandle& handle, | 167 const IPC::ChannelHandle& handle, |
| 168 base::SingleThreadTaskRunner* runner) { | 168 base::SingleThreadTaskRunner* runner) { |
| 169 return IPC::ChannelFactory::Create(handle, IPC::Channel::MODE_SERVER, runner); | 169 return IPC::ChannelFactory::Create(handle, IPC::Channel::MODE_SERVER, runner); |
| 170 } | 170 } |
| OLD | NEW |