Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8344)

Unified Diff: chrome/test/pyautolib/pyauto.py

Issue 7108025: Add PyAuto automation call GetPanelInfo(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/automation/testing_automation_provider.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « chrome/browser/automation/testing_automation_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698