Index: sandbox/tests/common/controller.cc |
=================================================================== |
--- sandbox/tests/common/controller.cc (revision 129628) |
+++ sandbox/tests/common/controller.cc (working copy) |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -51,13 +51,6 @@ |
return full_path; |
} |
-bool IsProcessRunning(HANDLE process) { |
- DWORD exit_code = 0; |
- if (::GetExitCodeProcess(process, &exit_code)) |
- return exit_code == STILL_ACTIVE; |
- return false; |
-} |
- |
} // namespace |
namespace sandbox { |
@@ -88,13 +81,11 @@ |
} |
TestRunner::TestRunner(JobLevel job_level, TokenLevel startup_token, |
- TokenLevel main_token) |
- : is_init_(false), is_async_(false), target_process_id_(0) { |
+ TokenLevel main_token) : is_init_(false) { |
Init(job_level, startup_token, main_token); |
} |
-TestRunner::TestRunner() |
- : is_init_(false), is_async_(false), target_process_id_(0) { |
+TestRunner::TestRunner() : is_init_(false) { |
Init(JOB_LOCKDOWN, USER_RESTRICTED_SAME_ACCESS, USER_LOCKDOWN); |
} |
@@ -104,8 +95,6 @@ |
policy_ = NULL; |
timeout_ = kDefaultTimeout; |
state_ = AFTER_REVERT; |
- is_async_= false; |
- target_process_id_ = 0; |
broker_ = GetBroker(); |
if (!broker_) |
@@ -126,9 +115,6 @@ |
} |
TestRunner::~TestRunner() { |
- if (target_process_) |
- ::TerminateProcess(target_process_, 0); |
- |
if (policy_) |
policy_->Release(); |
} |
@@ -191,14 +177,6 @@ |
if (!is_init_) |
return SBOX_TEST_FAILED_TO_RUN_TEST; |
- // For simplicity TestRunner supports only one process per instance. |
- if (target_process_) { |
- if (IsProcessRunning(target_process_)) |
- return SBOX_TEST_FAILED_TO_RUN_TEST; |
- target_process_.Close(); |
- target_process_id_ = 0; |
- } |
- |
// Get the path to the sandboxed process. |
wchar_t prog_name[MAX_PATH]; |
GetModuleFileNameW(NULL, prog_name, MAX_PATH); |
@@ -220,14 +198,6 @@ |
::ResumeThread(target.hThread); |
- // For an asynchronous run we don't bother waiting. |
- if (is_async_) { |
- target_process_.Set(target.hProcess); |
- target_process_id_ = target.dwProcessId; |
- ::CloseHandle(target.hThread); |
- return SBOX_TEST_SUCCEEDED; |
- } |
- |
if (::IsDebuggerPresent()) { |
// Don't kill the target process on a time-out while we are debugging. |
timeout_ = INFINITE; |