| Index: ash/test/test_metro_viewer_process_host.cc
|
| diff --git a/ash/test/test_metro_viewer_process_host.cc b/ash/test/test_metro_viewer_process_host.cc
|
| index 00c00d257c18bb4af126c45ec7618befe7143228..04fbaa5dd7e1b7147d3d2fa5cac7eb4064cc7ae6 100644
|
| --- a/ash/test/test_metro_viewer_process_host.cc
|
| +++ b/ash/test/test_metro_viewer_process_host.cc
|
| @@ -7,6 +7,7 @@
|
| #include <windef.h>
|
|
|
| #include "base/logging.h"
|
| +#include "base/process/process.h"
|
| #include "ui/aura/remote_window_tree_host_win.h"
|
| #include "ui/gfx/win/dpi.h"
|
|
|
| @@ -24,15 +25,13 @@ TestMetroViewerProcessHost::~TestMetroViewerProcessHost() {
|
| void TestMetroViewerProcessHost::TerminateViewer() {
|
| base::ProcessId viewer_process_id = GetViewerProcessId();
|
| if (viewer_process_id != base::kNullProcessId) {
|
| - base::ProcessHandle viewer_process = NULL;
|
| - base::OpenProcessHandleWithAccess(
|
| + base::Process viewer_process = base::Process::OpenWithAccess(
|
| viewer_process_id,
|
| - PROCESS_QUERY_INFORMATION | SYNCHRONIZE | PROCESS_TERMINATE,
|
| - &viewer_process);
|
| - if (viewer_process) {
|
| - ::TerminateProcess(viewer_process, 0);
|
| - ::WaitForSingleObject(viewer_process, INFINITE);
|
| - ::CloseHandle(viewer_process);
|
| + PROCESS_QUERY_INFORMATION | SYNCHRONIZE | PROCESS_TERMINATE);
|
| + if (viewer_process.IsValid()) {
|
| + viewer_process.Terminate(0);
|
| + int exit_code;
|
| + viewer_process.WaitForExit(&exit_code);
|
| }
|
| }
|
| }
|
|
|