Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / sandbox / win / tests / common / controller.cc
index ac20f6c..bdf9627 100644 (file)
@@ -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;
@@ -247,13 +247,13 @@ int TestRunner::InternalRunTest(const wchar_t* command) {
   }
 
   if (WAIT_TIMEOUT == ::WaitForSingleObject(target.hProcess, timeout_)) {
-    ::TerminateProcess(target.hProcess, SBOX_TEST_TIMED_OUT);
+    ::TerminateProcess(target.hProcess, static_cast<UINT>(SBOX_TEST_TIMED_OUT));
     ::CloseHandle(target.hProcess);
     ::CloseHandle(target.hThread);
     return SBOX_TEST_TIMED_OUT;
   }
 
-  DWORD exit_code = SBOX_TEST_LAST_RESULT;
+  DWORD exit_code = static_cast<DWORD>(SBOX_TEST_LAST_RESULT);
   if (!::GetExitCodeProcess(target.hProcess, &exit_code)) {
     ::CloseHandle(target.hProcess);
     ::CloseHandle(target.hThread);