Index: components/browser_watcher/watcher_client_win_unittest.cc |
diff --git a/components/browser_watcher/watcher_client_win_unittest.cc b/components/browser_watcher/watcher_client_win_unittest.cc |
index 2e19f42064140d6d2b017580496e8bfcdf1b1719..bfe4a57972e4c9911e7e6c122498ccbf3125def9 100644 |
--- a/components/browser_watcher/watcher_client_win_unittest.cc |
+++ b/components/browser_watcher/watcher_client_win_unittest.cc |
@@ -10,8 +10,8 @@ |
#include "base/bind.h" |
#include "base/command_line.h" |
#include "base/logging.h" |
-#include "base/process/process_handle.h" |
#include "base/process/kill.h" |
+#include "base/process/process.h" |
#include "base/strings/string_number_conversions.h" |
#include "base/strings/stringprintf.h" |
#include "base/test/multiprocess_test.h" |
@@ -142,19 +142,19 @@ class WatcherClientTest : public base::MultiProcessTest { |
// Duplicate the process handle to work around the fact that |
// WaitForExitCode closes it(!!!). |
Sigurður Ásgeirsson
2015/01/26 14:21:29
Stale comment.
I think the dupe is still necessar
rvargas (doing something else)
2015/02/02 20:57:00
Done.
|
- base::ProcessHandle dupe = NULL; |
+ base::ProcessHandle duped_handle = NULL; |
ASSERT_TRUE(::DuplicateHandle(base::GetCurrentProcessHandle(), |
handle, |
base::GetCurrentProcessHandle(), |
- &dupe, |
+ &duped_handle, |
SYNCHRONIZE | PROCESS_QUERY_INFORMATION, |
FALSE, |
0)); |
- ASSERT_NE(base::kNullProcessHandle, dupe); |
+ base::Process duped_process(duped_handle); |
+ ASSERT_TRUE(duped_process.IsValid()); |
int exit_code = 0; |
- if (!base::WaitForExitCode(dupe, &exit_code)) { |
- base::CloseProcessHandle(dupe); |
- FAIL() << "WaitForExitCode failed."; |
+ if (!duped_process.WaitForExit(&exit_code)) { |
+ FAIL() << "WaitForExit failed."; |
} |
ASSERT_EQ(0, exit_code); |
} |