summaryrefslogtreecommitdiffstats
path: root/chrome/test/pyautolib
diff options
context:
space:
mode:
authordtu@chromium.org <dtu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-02 21:25:19 +0000
committerdtu@chromium.org <dtu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-02 21:25:19 +0000
commit9833514789f079b3d8353ce2cf43ec64e4e92b69 (patch)
tree28b96938e2aa61b7aa8e0a16dea1769ef48da074 /chrome/test/pyautolib
parent0ce42cec3a83e0d3c4cccda2e801590730f211ce (diff)
downloadchromium_src-9833514789f079b3d8353ce2cf43ec64e4e92b69.zip
chromium_src-9833514789f079b3d8353ce2cf43ec64e4e92b69.tar.gz
chromium_src-9833514789f079b3d8353ce2cf43ec64e4e92b69.tar.bz2
Add ChromeOS PyAuto hook, CreateAccount(), which goes to the account creation page.
BUG=chromium-os:14683 TEST=Manual. Review URL: http://codereview.chromium.org/6883281 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83793 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/pyautolib')
-rw-r--r--chrome/test/pyautolib/pyauto.py26
1 files changed, 22 insertions, 4 deletions
diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py
index 05ca87c..b64ef7a 100644
--- a/chrome/test/pyautolib/pyauto.py
+++ b/chrome/test/pyautolib/pyauto.py
@@ -160,6 +160,7 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
if not named_channel_id:
named_channel_id = self.EnableChromeTestingOnChromeOS()
if named_channel_id:
+ self._named_channel_id = named_channel_id
self.UseNamedChannelID(named_channel_id)
self.SetUp() # Fire browser
@@ -2510,6 +2511,23 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
cmd_dict = { 'command': 'GetLoginInfo' }
return self._GetResultFromJSONRequest(cmd_dict, windex=-1)
+ def ShowCreateAccountUI(self):
+ """Go to the account creation page.
+
+ This is the same as clicking the "Create Account" link on the
+ ChromeOS login screen. Does not actually create a new account.
+ Should be displaying the login screen to work.
+
+ Raises:
+ pyauto_errors.JSONInterfaceError if the automation call returns an error.
+ """
+ cmd_dict = { 'command': 'ShowCreateAccountUI' }
+ self._GetResultFromJSONRequest(cmd_dict, windex=-1)
+ # See note below under LoginAsGuest(). ShowCreateAccountUI() essentially
+ # logs the user in as guest in order to access the account creation page.
+ os.unlink(self._named_channel_id)
+ self.SetUp()
+
def LoginAsGuest(self):
"""Login to chromeos as a guest user.
@@ -2521,10 +2539,10 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
"""
cmd_dict = { 'command': 'LoginAsGuest' }
self._GetResultFromJSONRequest(cmd_dict, windex=-1)
- # Currently, logging in as guest causes session_manager to restart
- # Chrome with new parameters, which will close the testing channel.
- # We need to call EnableChromeTesting again.
- self.EnableChromeTestingOnChromeOS()
+ # Currently, logging in as guest causes session_manager to
+ # restart Chrome, which will close the testing channel.
+ # We need to call SetUp() again to reconnect to the new channel.
+ os.unlink(self._named_channel_id)
self.SetUp()
def Login(self, username, password):