Chromium Code Reviews| Index: chrome/test/pyautolib/pyauto.py |
| diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py |
| index 1ba07cb79e5e8cca8804c49017d6d7dbe54e0bdc..d468d877c5702394f7a38a9f585c0a67eac7ce6e 100644 |
| --- a/chrome/test/pyautolib/pyauto.py |
| +++ b/chrome/test/pyautolib/pyauto.py |
| @@ -2918,6 +2918,41 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase): |
| cmd_dict = { 'command': 'GetBatteryInfo' } |
| return self._GetResultFromJSONRequest(cmd_dict, windex=-1) |
| + def GetPanelInfo(self): |
| + """Get details about open ChromeOS panels. |
| + |
| + Returns: |
| + A dictionary. |
| + Sample: |
| + [{ 'incognito': False, |
| + 'renderer_pid': 4820, |
| + 'title': u'Downloads', |
| + 'url': u'chrome://active-downloads/'}] |
| + |
| + Raises: |
| + pyauto_errors.JSONInterfaceError if the automation call returns an error. |
| + """ |
| + panels = [] |
| + browsers = self.GetBrowserInfo() |
| + for browser in browsers['windows']: |
| + if browser['type'] != 'panel': |
| + continue |
| + |
| + panel = {} |
| + panels.append(panel) |
| + panel['incognito'] = browser['incognito'] |
| + panel['title'] = self.GetActiveTabTitle(browser['index']) |
| + |
| + for tab in browser['tabs']: |
|
Nirnimesh
2011/06/08 21:50:28
Won't there be just one tab?
dtu
2011/06/08 22:02:57
Done.
|
| + if tab['index'] != browser['selected_tab']: |
| + continue |
| + |
| + panel['renderer_pid'] = tab['renderer_pid'] |
| + panel['url'] = tab['url'] |
| + break |
| + |
| + return panels |
| + |
| def GetNetworkInfo(self): |
| """Get details about ethernet, wifi, and cellular networks on chromeos. |