diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-13 14:37:38 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-13 14:37:38 +0000 |
commit | 4b59cf24ca1128e5b3f3b4fa8b585575d44222f7 (patch) | |
tree | 063ccb2187e2285260b309e284b2f2170b0240e4 /chrome/test/chrome_process_util.cc | |
parent | fd7bdcc89b6483ebbfc4eaca6a7b0ba1fe1aca1b (diff) | |
download | chromium_src-4b59cf24ca1128e5b3f3b4fa8b585575d44222f7.zip chromium_src-4b59cf24ca1128e5b3f3b4fa8b585575d44222f7.tar.gz chromium_src-4b59cf24ca1128e5b3f3b4fa8b585575d44222f7.tar.bz2 |
Make running chrome process detection in ui tests more reliable.
Also drops fragile code.
TEST=Covered by ui_tests.
BUG=10840
Review URL: http://codereview.chromium.org/545006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36119 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/chrome_process_util.cc')
-rw-r--r-- | chrome/test/chrome_process_util.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/chrome/test/chrome_process_util.cc b/chrome/test/chrome_process_util.cc index fea1d0e..dd3ee1b 100644 --- a/chrome/test/chrome_process_util.cc +++ b/chrome/test/chrome_process_util.cc @@ -15,12 +15,12 @@ using base::Time; using base::TimeDelta; -void TerminateAllChromeProcesses(const FilePath& data_dir) { +void TerminateAllChromeProcesses(base::ProcessId browser_pid) { // Total time the function will wait for chrome processes // to terminate after it told them to do so. const TimeDelta kExitTimeout = TimeDelta::FromSeconds(30); - ChromeProcessList process_pids(GetRunningChromeProcesses(data_dir)); + ChromeProcessList process_pids(GetRunningChromeProcesses(browser_pid)); std::vector<base::ProcessHandle> handles; { @@ -68,11 +68,10 @@ class ChildProcessFilter : public base::ProcessFilter { DISALLOW_COPY_AND_ASSIGN(ChildProcessFilter); }; -ChromeProcessList GetRunningChromeProcesses(const FilePath& data_dir) { +ChromeProcessList GetRunningChromeProcesses(base::ProcessId browser_pid) { ChromeProcessList result; - - base::ProcessId browser_pid = ChromeBrowserProcessId(data_dir); - if (browser_pid == (base::ProcessId) -1) + + if (browser_pid == static_cast<base::ProcessId>(-1)) return result; ChildProcessFilter filter(browser_pid); |