summaryrefslogtreecommitdiffstats
path: root/chrome/test/chrome_process_util.cc
diff options
context:
space:
mode:
authordkegel@google.com <dkegel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-08 23:29:11 +0000
committerdkegel@google.com <dkegel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-08 23:29:11 +0000
commit78c6dd65953307dd0b550a16d92267a450c01309 (patch)
tree41fbb424f0285933d7fddd1d06d24b0b3a1a349b /chrome/test/chrome_process_util.cc
parent37cd3a96b55aac1dad9016c05e78b5983972f985 (diff)
downloadchromium_src-78c6dd65953307dd0b550a16d92267a450c01309.zip
chromium_src-78c6dd65953307dd0b550a16d92267a450c01309.tar.gz
chromium_src-78c6dd65953307dd0b550a16d92267a450c01309.tar.bz2
Enable zygote manager by default.
Fix broken recursion check. Make OpenFile warning less scary, indicate it's normal at start of ui tests. Make ui tests pass. Avoid generating extra code on Mac. BUG=11841 TEST=start the browser, then make chrome and all .pak files unreadable; or alternately, start an installed browser, and uninstall the browser while it's running. Then create a new tab and browse to two new sites. Review URL: http://codereview.chromium.org/119289 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17909 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/chrome_process_util.cc')
-rw-r--r--chrome/test/chrome_process_util.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/chrome/test/chrome_process_util.cc b/chrome/test/chrome_process_util.cc
index 461194f..296b291 100644
--- a/chrome/test/chrome_process_util.cc
+++ b/chrome/test/chrome_process_util.cc
@@ -77,13 +77,33 @@ ChromeProcessList GetRunningChromeProcesses(const FilePath& data_dir) {
if (browser_pid < 0)
return result;
- ChromeProcessFilter filter(browser_pid);
+ // Normally, the browser is the parent process for all the renderers
+ base::ProcessId parent_pid = browser_pid;
+
+#if defined(OS_LINUX)
+ // But if the browser's parent is the same executable as the browser,
+ // then it's the zygote manager, and it's the parent for all the renderers.
+ base::ProcessId manager_pid = base::GetParentProcessId(browser_pid);
+ FilePath selfPath = base::GetProcessExecutablePath(browser_pid);
+ FilePath managerPath = base::GetProcessExecutablePath(manager_pid);
+ if (!selfPath.empty() && !managerPath.empty() && selfPath == managerPath) {
+ LOG(INFO) << "Zygote manager in use.";
+ parent_pid = manager_pid;
+ }
+#endif
+
+ ChromeProcessFilter filter(parent_pid);
base::NamedProcessIterator it(chrome::kBrowserProcessExecutableName, &filter);
const ProcessEntry* process_entry;
while ((process_entry = it.NextProcessEntry())) {
#if defined(OS_WIN)
result.push_back(process_entry->th32ProcessID);
+#elif defined(OS_LINUX)
+ // Don't count the zygote manager, that screws up unit tests,
+ // and it will exit cleanly on its own when first client exits.
+ if (process_entry->pid != manager_pid)
+ result.push_back(process_entry->pid);
#elif defined(OS_POSIX)
result.push_back(process_entry->pid);
#endif