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 "chrome/utility/importer/firefox_importer_unittest_utils.h" | 5 #include "chrome/utility/importer/firefox_importer_unittest_utils.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // Spawn child and set up sync IPC connection. | 144 // Spawn child and set up sync IPC connection. |
145 child_process_ = LaunchNSSDecrypterChildProcess(nss_path, channel_.get()); | 145 child_process_ = LaunchNSSDecrypterChildProcess(nss_path, channel_.get()); |
146 return child_process_.IsValid(); | 146 return child_process_.IsValid(); |
147 } | 147 } |
148 | 148 |
149 FFUnitTestDecryptorProxy::~FFUnitTestDecryptorProxy() { | 149 FFUnitTestDecryptorProxy::~FFUnitTestDecryptorProxy() { |
150 listener_->QuitClient(); | 150 listener_->QuitClient(); |
151 channel_->Close(); | 151 channel_->Close(); |
152 | 152 |
153 if (child_process_.IsValid()) { | 153 if (child_process_.IsValid()) { |
154 base::WaitForSingleProcess(child_process_.Handle(), | 154 int exit_code; |
155 base::TimeDelta::FromSeconds(5)); | 155 child_process_.WaitForExitWithTimeout(base::TimeDelta::FromSeconds(5), |
156 child_process_.Close(); | 156 &exit_code); |
157 } | 157 } |
158 } | 158 } |
159 | 159 |
160 // A message_loop task that quits the message loop when invoked, setting cancel | 160 // A message_loop task that quits the message loop when invoked, setting cancel |
161 // causes the task to do nothing when invoked. | 161 // causes the task to do nothing when invoked. |
162 class CancellableQuitMsgLoop : public base::RefCounted<CancellableQuitMsgLoop> { | 162 class CancellableQuitMsgLoop : public base::RefCounted<CancellableQuitMsgLoop> { |
163 public: | 163 public: |
164 CancellableQuitMsgLoop() : cancelled_(false) {} | 164 CancellableQuitMsgLoop() : cancelled_(false) {} |
165 void QuitNow() { | 165 void QuitNow() { |
166 if (!cancelled_) | 166 if (!cancelled_) |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 scoped_ptr<IPC::Channel> channel = IPC::Channel::CreateClient( | 287 scoped_ptr<IPC::Channel> channel = IPC::Channel::CreateClient( |
288 kTestChannelID, &listener); | 288 kTestChannelID, &listener); |
289 CHECK(channel->Connect()); | 289 CHECK(channel->Connect()); |
290 listener.SetSender(channel.get()); | 290 listener.SetSender(channel.get()); |
291 | 291 |
292 // run message loop | 292 // run message loop |
293 base::MessageLoop::current()->Run(); | 293 base::MessageLoop::current()->Run(); |
294 | 294 |
295 return 0; | 295 return 0; |
296 } | 296 } |
OLD | NEW |