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

Unified Diff: ash/test/ash_test_base.cc

Issue 12314043: Make Ash unittests clean up zombie viewer processes between test runs. These zombie viewer proce… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | « no previous file | base/base.gyp » ('j') | base/test/test_process_util_win.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/ash_test_base.cc
diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc
index 0116710690c5ae948386dd52f7e67953a3308077..813f5fe08835baf5d304e391696b485ba54cf1ab 100644
--- a/ash/test/ash_test_base.cc
+++ b/ash/test/ash_test_base.cc
@@ -32,6 +32,7 @@
#if defined(OS_WIN)
#include "ash/test/test_metro_viewer_process_host.h"
+#include "base/test/test_process_util_win.h"
#include "base/win/windows_version.h"
#include "ui/aura/remote_root_window_host_win.h"
#include "ui/aura/root_window_host_win.h"
@@ -131,11 +132,21 @@ void AshTestBase::TearDown() {
Shell::DeleteInstance();
aura::Env::DeleteInstance();
ui::TextInputTestSupport::Shutdown();
+
#if defined(OS_WIN)
aura::test::SetUsePopupAsRootWindowForTest(false);
// Kill the viewer process if we spun one up.
metro_viewer_host_.reset();
+
+ // Clean up any dangling viewer processes as the metro APIs sometimes leave
+ // zombies behind. A default browser process in metro will have the
+ // following command line arg so use that to avoid killing all processes named
+ // win8::test::kDefaultTestExePath.
+ const wchar_t kViewerProcessArgument[] = L"DefaultBrowserServer";
+ KillAllNamedProcessesWithArgument(win8::test::kDefaultTestExePath,
+ kViewerProcessArgument);
#endif
+
event_generator_.reset();
// Some tests set an internal display id,
// reset it here, so other tests will continue in a clean environment.
« no previous file with comments | « no previous file | base/base.gyp » ('j') | base/test/test_process_util_win.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698