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

Side by Side Diff: ipc/ipc_test_base.cc

Issue 14383024: ipc: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
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/debug/debug_on_start_win.h" 10 #include "base/debug/debug_on_start_win.h"
(...skipping 13 matching lines...) Expand all
24 } 24 }
25 25
26 IPCTestBase::~IPCTestBase() { 26 IPCTestBase::~IPCTestBase() {
27 } 27 }
28 28
29 void IPCTestBase::SetUp() { 29 void IPCTestBase::SetUp() {
30 MultiProcessTest::SetUp(); 30 MultiProcessTest::SetUp();
31 31
32 // Construct a fresh IO Message loop for the duration of each test. 32 // Construct a fresh IO Message loop for the duration of each test.
33 DCHECK(!message_loop_.get()); 33 DCHECK(!message_loop_.get());
34 message_loop_.reset(new MessageLoopForIO()); 34 message_loop_.reset(new base::MessageLoopForIO());
35 } 35 }
36 36
37 void IPCTestBase::TearDown() { 37 void IPCTestBase::TearDown() {
38 DCHECK(message_loop_.get()); 38 DCHECK(message_loop_.get());
39 message_loop_.reset(); 39 message_loop_.reset();
40 MultiProcessTest::TearDown(); 40 MultiProcessTest::TearDown();
41 } 41 }
42 42
43 void IPCTestBase::Init(const std::string& test_client_name) { 43 void IPCTestBase::Init(const std::string& test_client_name) {
44 DCHECK(!test_client_name.empty()); 44 DCHECK(!test_client_name.empty());
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 bool IPCTestBase::WaitForClientShutdown() { 114 bool IPCTestBase::WaitForClientShutdown() {
115 DCHECK(client_process_ != base::kNullProcessHandle); 115 DCHECK(client_process_ != base::kNullProcessHandle);
116 116
117 bool rv = base::WaitForSingleProcess(client_process_, 117 bool rv = base::WaitForSingleProcess(client_process_,
118 base::TimeDelta::FromSeconds(5)); 118 base::TimeDelta::FromSeconds(5));
119 base::CloseProcessHandle(client_process_); 119 base::CloseProcessHandle(client_process_);
120 client_process_ = base::kNullProcessHandle; 120 client_process_ = base::kNullProcessHandle;
121 return rv; 121 return rv;
122 } 122 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698