Fix process_count tests on chromeos

GPU process no longer automatically shows up/after at login.

R=dennisjeffrey@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/8665007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111267 0039d316-1c4b-4281-b951-d872f2087c98
parent 45644f6c
...@@ -16,7 +16,7 @@ class ProcessCountTest(pyauto.PyUITest): ...@@ -16,7 +16,7 @@ class ProcessCountTest(pyauto.PyUITest):
'win': 2, # Processes: browser, tab. 'win': 2, # Processes: browser, tab.
'mac': 2, # Processes: browser, tab. 'mac': 2, # Processes: browser, tab.
'linux': 4, # Processes: browser, tab, sandbox helper, zygote. 'linux': 4, # Processes: browser, tab, sandbox helper, zygote.
'chromeos': 5, # Processes: browser, tab, sandbox helper, zygote, GPU. 'chromeos': 4, # Processes: browser, tab, sandbox helper, zygote.
} }
CHROME_PROCESS_NAME = { CHROME_PROCESS_NAME = {
...@@ -64,10 +64,14 @@ class ProcessCountTest(pyauto.PyUITest): ...@@ -64,10 +64,14 @@ class ProcessCountTest(pyauto.PyUITest):
browser_info = [x for x in proc_info['browsers'] browser_info = [x for x in proc_info['browsers']
if x['process_name'] == self.chrome_proc_name] if x['process_name'] == self.chrome_proc_name]
assert len(browser_info) == 1 assert len(browser_info) == 1
num_actual = len(browser_info[0]['processes']) # Utility processes may show up any time. Ignore them.
processes = [x for x in browser_info[0]['processes']
if x['child_process_type'] != 'Utility']
num_actual = len(processes)
self.assertEqual(num_actual, num_expected, self.assertEqual(num_actual, num_expected,
msg='Number of processes should be %d, but was %d.\n' msg='Number of processes (ignoring Utility processes) '
'should be %d, but was %d.\n'
'Actual process info:\n%s' % ( 'Actual process info:\n%s' % (
num_expected, num_actual, self.pformat(proc_info))) num_expected, num_actual, self.pformat(proc_info)))
...@@ -89,6 +93,10 @@ class ProcessCountTest(pyauto.PyUITest): ...@@ -89,6 +93,10 @@ class ProcessCountTest(pyauto.PyUITest):
"""Verifies the process count when the flash process is running.""" """Verifies the process count when the flash process is running."""
flash_url = self.GetFileURLForDataPath('plugin', 'flash.swf') flash_url = self.GetFileURLForDataPath('plugin', 'flash.swf')
self.NavigateToURL(flash_url) self.NavigateToURL(flash_url)
if self.IsChromeOS():
# Flash triggers an extra GPU process on ChromeOS.
self._VerifyProcessCount(self.proc_count_fresh_profile + 2)
else:
self._VerifyProcessCount(self.proc_count_fresh_profile + 1) self._VerifyProcessCount(self.proc_count_fresh_profile + 1)
def testProcessCountExtensionProcess(self): def testProcessCountExtensionProcess(self):
...@@ -128,6 +136,10 @@ class ProcessCountTest(pyauto.PyUITest): ...@@ -128,6 +136,10 @@ class ProcessCountTest(pyauto.PyUITest):
for _ in xrange(3): for _ in xrange(3):
self.AppendTab(pyauto.GURL('about:blank'), 1) self.AppendTab(pyauto.GURL('about:blank'), 1)
if self.IsChromeOS():
# Flash triggers an extra GPU process on ChromeOS.
self._VerifyProcessCount(self.proc_count_fresh_profile + 9)
else:
self._VerifyProcessCount(self.proc_count_fresh_profile + 8) self._VerifyProcessCount(self.proc_count_fresh_profile + 8)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment