| Index: chrome/test/pyautolib/pyauto.py
|
| diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py
|
| index 45c97c35022cdb8181ca029ea48bf43d3b0bc1e0..c83dee4c0a763d2c7022583815487de6e2fcae12 100755
|
| --- a/chrome/test/pyautolib/pyauto.py
|
| +++ b/chrome/test/pyautolib/pyauto.py
|
| @@ -85,6 +85,7 @@ import omnibox_info
|
| import plugins_info
|
| import prefs_info
|
| from pyauto_errors import JSONInterfaceError
|
| +from pyauto_errors import EnrollmentError
|
| from pyauto_errors import NTPThumbnailNotShownError
|
| import pyauto_utils
|
| import simplejson as json # found in third_party
|
| @@ -4911,21 +4912,21 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
|
| equivalent to pressing Ctrl-Alt-e to enroll the device from the login
|
| screen.
|
|
|
| - Returns:
|
| - An error string if the enrollment fails.
|
| - None otherwise.
|
| -
|
| Raises:
|
| pyauto_errors.JSONInterfaceError if the automation call returns an error.
|
| - """
|
| - cmd_dict = {
|
| - 'command': 'EnrollEnterpriseDevice',
|
| - 'user': user,
|
| - 'password': password,
|
| - }
|
| - time.sleep(5) # TODO(craigdh): Block until Install Attributes is ready.
|
| - result = self._GetResultFromJSONRequest(cmd_dict, windex=None)
|
| - return result.get('error_string')
|
| + pyauto_errors.EnrollmentError if the enrollment fails.
|
| + """
|
| + self._GetResultFromJSONRequest(
|
| + {'command': 'ShowEnterpriseWizard'}, windex=None)
|
| + observer_id = self._GetResultFromJSONRequest(
|
| + {'command': 'AddEnrollmentObserver'}, windex=None)['observer_id']
|
| + self.ExecuteJavascriptInOOBEWebUI("""
|
| + chrome.send("oauthEnrollCompleteLogin", ["%s", "%s"] );
|
| + window.domAutomationController.send("success");""" %
|
| + (user, password));
|
| + response = self.GetNextEvent(observer_id)
|
| + if 'error_string' in response:
|
| + raise EnrollmentError(response['error_string'])
|
|
|
| def GetUpdateInfo(self):
|
| """Gets the status of the ChromeOS updater.
|
|
|