Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: ipc/ipc_test_base.cc

Issue 488003003: Add ChannelProxy benchmark to ipc_perftests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Landing. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ipc/ipc_test_base.h ('k') | ipc/mojo/ipc_channel_mojo_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 14 matching lines...) Expand all
25 IPCTestBase::IPCTestBase() 25 IPCTestBase::IPCTestBase()
26 : client_process_(base::kNullProcessHandle) { 26 : client_process_(base::kNullProcessHandle) {
27 } 27 }
28 28
29 IPCTestBase::~IPCTestBase() { 29 IPCTestBase::~IPCTestBase() {
30 } 30 }
31 31
32 void IPCTestBase::SetUp() { 32 void IPCTestBase::SetUp() {
33 MultiProcessTest::SetUp(); 33 MultiProcessTest::SetUp();
34 34
35 // Construct a fresh IO Message loop for the duration of each test. 35 // Construct a fresh Message loop for the duration of each test.
36 DCHECK(!message_loop_.get()); 36 DCHECK(!message_loop_.get());
37 message_loop_.reset(new base::MessageLoopForIO()); 37 message_loop_.reset(new base::MessageLoopForIO());
38 } 38 }
39 39
40 void IPCTestBase::TearDown() { 40 void IPCTestBase::TearDown() {
41 DCHECK(message_loop_.get()); 41 DCHECK(message_loop_.get());
42 message_loop_.reset(); 42 message_loop_.reset();
43 MultiProcessTest::TearDown(); 43 MultiProcessTest::TearDown();
44 } 44 }
45 45
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 bool IPCTestBase::WaitForClientShutdown() { 123 bool IPCTestBase::WaitForClientShutdown() {
124 DCHECK(client_process_ != base::kNullProcessHandle); 124 DCHECK(client_process_ != base::kNullProcessHandle);
125 125
126 bool rv = base::WaitForSingleProcess(client_process_, 126 bool rv = base::WaitForSingleProcess(client_process_,
127 base::TimeDelta::FromSeconds(5)); 127 base::TimeDelta::FromSeconds(5));
128 base::CloseProcessHandle(client_process_); 128 base::CloseProcessHandle(client_process_);
129 client_process_ = base::kNullProcessHandle; 129 client_process_ = base::kNullProcessHandle;
130 return rv; 130 return rv;
131 } 131 }
132 132
133 scoped_refptr<base::TaskRunner> IPCTestBase::io_thread_task_runner() { 133 scoped_refptr<base::TaskRunner> IPCTestBase::task_runner() {
134 return message_loop_->message_loop_proxy(); 134 return message_loop_->message_loop_proxy();
135 } 135 }
136
137 void IPCTestBase::set_message_loop(scoped_ptr<base::MessageLoop> loop) {
138 message_loop_ = loop.Pass();
139 }
OLDNEW
« no previous file with comments | « ipc/ipc_test_base.h ('k') | ipc/mojo/ipc_channel_mojo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698