| Index: chrome/test/pyautolib/pyauto.py
|
| diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py
|
| index 9e179f6d7b74b87ca637ab356482d42ee5dc60f9..dee7f6afcac3b6082cf424d4b0730af668221b7d 100644
|
| --- a/chrome/test/pyautolib/pyauto.py
|
| +++ b/chrome/test/pyautolib/pyauto.py
|
| @@ -1716,6 +1716,29 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
|
| return self._GetResultFromJSONRequest(
|
| cmd_dict, windex=window_index)['translation_success']
|
|
|
| + def InstallExtension(self, extension_path):
|
| + """Installs an extension from the given path.
|
| +
|
| + The path must be absolute and may be a crx file or an unpacked extension
|
| + directory. Returns the extension ID if successfully installed and loaded.
|
| + Otherwise, throws an exception. The extension must not already be installed.
|
| +
|
| + Args:
|
| + extension_path: The absolute path to the extension to install. If the
|
| + extension is packed, it must have a .crx extension.
|
| +
|
| + Returns:
|
| + The ID of the installed extension.
|
| +
|
| + Raises:
|
| + pyauto_errors.JSONInterfaceError if the automation call returns an error.
|
| + """
|
| + cmd_dict = {
|
| + 'command': 'InstallExtension',
|
| + 'path': extension_path
|
| + }
|
| + return self._GetResultFromJSONRequest(cmd_dict, windex=-1)['id']
|
| +
|
| def GetExtensionsInfo(self):
|
| """Returns information about all installed extensions.
|
|
|
| @@ -1729,6 +1752,8 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
|
| u'chrome://resources/*'],
|
| u'host_permissions': [u'chrome://favicon/*', u'chrome://resources/*'],
|
| u'id': u'eemcgdkfndhakfknompkggombfjjjeno',
|
| + u'is_component': True,
|
| + u'is_internal': False,
|
| u'name': u'Bookmark Manager',
|
| u'options_url': u'',
|
| u'public_key': u'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDQcByy+eN9jza\
|
| @@ -1756,7 +1781,7 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
|
| cmd_dict = { # Prepare command for the json interface
|
| 'command': 'GetExtensionsInfo'
|
| }
|
| - return self._GetResultFromJSONRequest(cmd_dict)['extensions']
|
| + return self._GetResultFromJSONRequest(cmd_dict, windex=-1)['extensions']
|
|
|
| def UninstallExtensionById(self, id):
|
| """Uninstall the extension with the given id.
|
| @@ -2410,13 +2435,17 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
|
| A theme file is a file with a .crx suffix, like an extension. The theme
|
| file must be specified with an absolute path. This method call waits until
|
| the theme is installed and will trigger the "theme installed" infobar.
|
| + If the install is unsuccessful, will throw an exception.
|
|
|
| Uses InstallExtension().
|
|
|
| Returns:
|
| - The ID of the installed theme, on success. The empty string, otherwise.
|
| + The ID of the installed theme.
|
| +
|
| + Raises:
|
| + pyauto_errors.JSONInterfaceError if the automation call returns an error.
|
| """
|
| - return self.InstallExtension(crx_file_path, True)
|
| + return self.InstallExtension(crx_file_path)
|
|
|
| def WaitUntilDownloadedThemeSet(self, theme_name):
|
| """Waits until the theme has been set.
|
| @@ -3103,31 +3132,6 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
|
| if self.GetNTPThumbnailIndex(thumbnail) == -1:
|
| raise NTPThumbnailNotShownError()
|
|
|
| - def InstallApp(self, app_crx_file_path):
|
| - """Installs the specified app synchronously.
|
| -
|
| - An app file is a file with a .crx suffix, like an extension or theme. The
|
| - app file must be specified with an absolute path. This method will not
|
| - return until the app is installed.
|
| -
|
| - Returns:
|
| - The ID of the installed app, on success. The empty string, otherwise.
|
| - """
|
| - return self.InstallExtension(app_crx_file_path, False)
|
| -
|
| - def UninstallApp(self, app_id):
|
| - """Uninstalls the specified app synchronously.
|
| -
|
| - Args:
|
| - app_id: The string ID of the app to uninstall. It can be retrieved
|
| - through the call to GetNTPApps above.
|
| -
|
| - Returns:
|
| - True, if the app was successfully uninstalled, or
|
| - False, otherwise.
|
| - """
|
| - return self.UninstallExtensionById(app_id)
|
| -
|
| def LaunchApp(self, app_id, windex=0):
|
| """Opens the New Tab Page and launches the specified app from it.
|
|
|
|
|