summaryrefslogtreecommitdiffstats
path: root/chrome/test/pyautolib
diff options
context:
space:
mode:
authoralyssad@chromium.org <alyssad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-03 16:27:01 +0000
committeralyssad@chromium.org <alyssad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-03 16:27:01 +0000
commit32a69cf04fe60cf9bfa6fe4e63a4dc0069b2d080 (patch)
treeb41acbb9ffae65e0993e478d25133784cd392b67 /chrome/test/pyautolib
parentc84741368416b492169d2f94ac39cdc3d5400f91 (diff)
downloadchromium_src-32a69cf04fe60cf9bfa6fe4e63a4dc0069b2d080.zip
chromium_src-32a69cf04fe60cf9bfa6fe4e63a4dc0069b2d080.tar.gz
chromium_src-32a69cf04fe60cf9bfa6fe4e63a4dc0069b2d080.tar.bz2
New PyAuto hooks for extensions.
Added two new hooks for extensions: GetExtensionsInfo returns information about all installed extensions and UninstallExtensionById uninstalls a given extension based on its id. Review URL: http://codereview.chromium.org/3053034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54761 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/pyautolib')
-rw-r--r--chrome/test/pyautolib/pyauto.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py
index 8a4bb60..3c3f979 100644
--- a/chrome/test/pyautolib/pyauto.py
+++ b/chrome/test/pyautolib/pyauto.py
@@ -720,6 +720,46 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
}
self._GetResultFromJSONRequest(cmd_dict, windex=window_index)
+ def GetExtensionsInfo(self):
+ """Returns information about all installed extensions.
+
+ Returns:
+ A list of dictionaries representing each of the installed extensions.
+ Example:
+ [ { u'background_url': u'',
+ u'description': u'Bookmark Manager',
+ u'id': u'eemcgdkfndhakfknompkggombfjjjeno',
+ u'name': u'Bookmark Manager',
+ u'options_url': u'',
+ u'version': u'0.1' },
+ { u'background_url': u'chrome-extension://\
+ lkdedmbpkaiahjjibfdmpoefffnbdkli/\
+ background.html',
+ u'description': u'Extension which lets you read your Facebook news \
+ feed and wall. You can also post status updates.',
+ u'id': u'lkdedmbpkaiahjjibfdmpoefffnbdkli',
+ u'name': u'Facebook for Google Chrome',
+ u'options_url': u'',
+ u'version': u'2.0.9' } ]
+ """
+ cmd_dict = { # Prepare command for the json interface
+ 'command': 'GetExtensionsInfo'
+ }
+ return self._GetResultFromJSONRequest(cmd_dict)['extensions']
+
+ def UninstallExtensionById(self, id):
+ """Uninstall the extension with the given id.
+
+ Args:
+ id: The string id of the extension. It can be retrieved through the
+ GetExtensionsInfo call above.
+ """
+ cmd_dict = { # Prepare command for the json interface
+ 'command': 'UninstallExtensionById',
+ 'id': id
+ }
+ self._GetResultFromJSONRequest(cmd_dict)
+
def SelectTranslateOption(self, option, tab_index=0, window_index=0):
"""Selects one of the options in the drop-down menu for the translate bar.