Chromium Code Reviews| Index: chrome/test/pyautolib/pyauto.py |
| diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py |
| index c8b5270fa57f3c564e30e54e80d42d2bf5872c2b..0059df122a63db39200a9168cc3dc83d1a07515e 100644 |
| --- a/chrome/test/pyautolib/pyauto.py |
| +++ b/chrome/test/pyautolib/pyauto.py |
| @@ -1381,6 +1381,65 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase): |
| } |
| return self._GetResultFromJSONRequest(cmd_dict, windex=-1) |
| + def GetProcessInfo(self): |
| + """Returns information about browser-related processes that currently exist. |
| + |
| + This will also return information about other currently-running browsers |
| + besides just Chrome. |
| + |
| + Returns: |
| + A dictionary containing browser-related process information as identified |
| + by class MemoryDetails in src/chrome/browser/memory_details.h. The |
| + dictionary contains a single key 'browsers', mapped to a list of |
| + dictionaries containing information about each browser process name. |
|
Nirnimesh
2011/09/21 22:42:35
do you expect multiple browser processes?
dennis_jeffrey
2011/09/22 18:25:35
Yes. It doesn't seem to happen on Linux or Chrome
|
| + Each of those dictionaries contains a key 'processes', mapped to a list |
| + of dictionaries containing the specific information for each process |
| + with the given process name. |
| + |
| + The memory values given in |committed_mem| and |working_set_mem| are in |
| + KBytes. |
| + |
| + Sample: |
| + { 'browsers': [ { 'name': 'Chromium', |
| + 'process_name': 'chrome', |
| + 'processes': [ { 'child_process_type': 'Browser', |
| + 'committed_mem': { 'image': 0, |
| + 'mapped': 0, |
| + 'priv': 0}, |
| + 'is_diagnostics': False, |
| + 'num_processes': 1, |
| + 'pid': 7770, |
| + 'product_name': '', |
| + 'renderer_type': 'Unknown', |
| + 'titles': [], |
| + 'version': '', |
| + 'working_set_mem': { 'priv': 43672, |
| + 'shareable': 0, |
| + 'shared': 59251}}, |
| + { 'child_process_type': 'Tab', |
| + 'committed_mem': { 'image': 0, |
| + 'mapped': 0, |
| + 'priv': 0}, |
| + 'is_diagnostics': False, |
| + 'num_processes': 1, |
| + 'pid': 7791, |
| + 'product_name': '', |
| + 'renderer_type': 'Tab', |
| + 'titles': ['about:blank'], |
| + 'version': '', |
| + 'working_set_mem': { 'priv': 16768, |
| + 'shareable': 0, |
| + 'shared': 26256}}, |
| + ...<more processes>...]}]} |
| + |
| + Raises: |
| + pyauto_errors.JSONInterfaceError if the automation call returns an error. |
| + """ |
| + cmd_dict = { # Prepare command for the json interface. |
| + 'command': 'GetProcessInfo', |
| + } |
| + return self._GetResultFromJSONRequest(cmd_dict, windex=-1) |
| + |
| def GetNavigationInfo(self, tab_index=0, windex=0): |
| """Get info about the navigation state of a given tab. |