summaryrefslogtreecommitdiffstats
path: root/chrome/test/pyautolib
diff options
context:
space:
mode:
authoralyssad@chromium.org <alyssad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 20:51:57 +0000
committeralyssad@chromium.org <alyssad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 20:51:57 +0000
commit5bcfe167fdaae9e5de58ef0892c77793d66d7ac1 (patch)
tree008b00fbe793927314262e64b6a3a453e9519dc2 /chrome/test/pyautolib
parent66758a6fc9621d32bc556b07e3503e0c14cf0468 (diff)
downloadchromium_src-5bcfe167fdaae9e5de58ef0892c77793d66d7ac1.zip
chromium_src-5bcfe167fdaae9e5de58ef0892c77793d66d7ac1.tar.gz
chromium_src-5bcfe167fdaae9e5de58ef0892c77793d66d7ac1.tar.bz2
New PyAuto hook to get saved passwords. BUG=36179
Review URL: http://codereview.chromium.org/2842047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52745 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/pyautolib')
-rw-r--r--chrome/test/pyautolib/pyauto.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py
index 10a4504..fc3e306 100644
--- a/chrome/test/pyautolib/pyauto.py
+++ b/chrome/test/pyautolib/pyauto.py
@@ -806,6 +806,43 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
}
return self._GetResultFromJSONRequest(cmd_dict)
+ def AddSavedPassword(self, username, password, time=None, window_index=0):
+ """Adds the given username-password combination to the saved passwords.
+
+ Args:
+ username: a string representing the username
+ password: a string representing the password
+ window_index: window index, defaults to 0
+
+ Returns:
+ The success or failure of adding the password. In incognito mode, adding
+ the password should fail. Example return:
+ { "password_added": True }
+
+ Raises:
+ JSONInterfaceError on error.
+ """
+ cmd_dict = { # Prepare command for the json interface
+ 'command': 'AddSavedPassword',
+ 'username': username,
+ 'password': password,
+ 'time': time
+ }
+ return self._GetResultFromJSONRequest(cmd_dict)
+
+ def GetSavedPasswords(self):
+ """Return the passwords currently saved.
+
+ Returns:
+ A list of 2-item lists of username, password for all saved passwords.
+ Example:
+ { 'passwords': [['username1', 'password1'], ['username2', 'password2']] }
+ """
+ cmd_dict = { # Prepare command for the json interface
+ 'command': 'GetSavedPasswords'
+ }
+ return self._GetResultFromJSONRequest(cmd_dict)
+
def SetTheme(self, crx_file_path):
"""Installs the given theme synchronously.