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

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: Comment. 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..24a35aa740fe3f29cbc8aefcaec3864f3a12d5da 100644
--- a/chrome/test/pyautolib/pyauto.py
+++ b/chrome/test/pyautolib/pyauto.py
@@ -1190,6 +1190,7 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
u'renderer_pid': 93929,
u'url': u'http://slides.html5rocks.com/#slide14'},
],
+ u'type': u'tabbed',
u'width': 925,
u'x': 26,
u'y': 44}]}
@@ -2918,6 +2919,38 @@ 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.
+
+ A panel is actually a type of browser window, so all of
+ this information is also available using GetBrowserInfo().
+
+ 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 = []
+ for browser in self.GetBrowserInfo()['windows']:
+ if browser['type'] != 'panel':
+ continue
+
+ panel = {}
+ panels.append(panel)
+ tab = browser['tabs'][0]
+ panel['incognito'] = browser['incognito']
+ panel['renderer_pid'] = tab['renderer_pid']
+ panel['title'] = self.GetActiveTabTitle(browser['index'])
+ panel['url'] = tab['url']
+
+ 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