Index: sandbox/win/tests/common/controller.cc |
diff --git a/sandbox/win/tests/common/controller.cc b/sandbox/win/tests/common/controller.cc |
index 8d355b6549bb8442449066bbafb26b26869d318f..bdf9627c9b350f1b056bcef9cb5c3e59a5040ac7 100644 |
--- a/sandbox/win/tests/common/controller.cc |
+++ b/sandbox/win/tests/common/controller.cc |
@@ -129,8 +129,8 @@ TargetPolicy* TestRunner::GetPolicy() { |
} |
TestRunner::~TestRunner() { |
- if (target_process_ && kill_on_destruction_) |
- ::TerminateProcess(target_process_, 0); |
+ if (target_process_.IsValid() && kill_on_destruction_) |
+ ::TerminateProcess(target_process_.Get(), 0); |
if (policy_) |
policy_->Release(); |
@@ -195,8 +195,8 @@ int TestRunner::InternalRunTest(const wchar_t* command) { |
return SBOX_TEST_FAILED_TO_RUN_TEST; |
// For simplicity TestRunner supports only one process per instance. |
- if (target_process_) { |
- if (IsProcessRunning(target_process_)) |
+ if (target_process_.IsValid()) { |
+ if (IsProcessRunning(target_process_.Get())) |
return SBOX_TEST_FAILED_TO_RUN_TEST; |
target_process_.Close(); |
target_process_id_ = 0; |