Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(767)

Unified Diff: ash/test/test_metro_viewer_process_host.cc

Issue 584213002: Only do aggressive metro viewer termination in tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add wfso Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/test/test_metro_viewer_process_host.h ('k') | base/base.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 85df3e21cbccfb6f64faad4fb6aaa9ea2dbdf6f5..156cf99770c84fe96e732ff9bba86068f489614b 100644
--- a/ash/test/test_metro_viewer_process_host.cc
+++ b/ash/test/test_metro_viewer_process_host.cc
@@ -22,6 +22,22 @@ TestMetroViewerProcessHost::TestMetroViewerProcessHost(
TestMetroViewerProcessHost::~TestMetroViewerProcessHost() {
}
+void TestMetroViewerProcessHost::TerminateViewer() {
+ base::ProcessId viewer_process_id = GetViewerProcessId();
+ if (viewer_process_id != base::kNullProcessId) {
+ base::ProcessHandle viewer_process = NULL;
+ base::OpenProcessHandleWithAccess(
+ 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);
+ }
+ }
+}
+
void TestMetroViewerProcessHost::OnChannelError() {
closed_unexpectedly_ = true;
aura::RemoteWindowTreeHostWin::Instance()->Disconnected();
« no previous file with comments | « ash/test/test_metro_viewer_process_host.h ('k') | base/base.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698