diff options
author | craigdh@google.com <craigdh@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-15 18:20:38 +0000 |
---|---|---|
committer | craigdh@google.com <craigdh@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-15 18:20:38 +0000 |
commit | d8ce941cb60f0d70308ab013c0db4f9c54016b82 (patch) | |
tree | 6636fd77c482d6d2b37e179072743ea92a501544 /chrome/test/pyautolib | |
parent | 9f2d19c8e0acc55e45b72cc0ef1ac07abb0d98b3 (diff) | |
download | chromium_src-d8ce941cb60f0d70308ab013c0db4f9c54016b82.zip chromium_src-d8ce941cb60f0d70308ab013c0db4f9c54016b82.tar.gz chromium_src-d8ce941cb60f0d70308ab013c0db4f9c54016b82.tar.bz2 |
Added two initial Enterprise policy automation hooks for use with PyAuto.
IsEnterpriseDevice() returns whether the device is registered as an enterprise device.
FetchEnterprisePolicy() initiates a policy update and blocks until the fetch completes or fails.
BUG=chromium-os:16060
TEST=Manually verified the example PyAuto test script
Review URL: http://codereview.chromium.org/7355006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92715 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/pyautolib')
-rw-r--r-- | chrome/test/pyautolib/pyauto.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py index 6bb0cad..a806d52 100644 --- a/chrome/test/pyautolib/pyauto.py +++ b/chrome/test/pyautolib/pyauto.py @@ -3401,6 +3401,36 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase): } return self._GetResultFromJSONRequest(cmd_dict, windex=-1) + def IsEnterpriseDevice(self): + """Check whether the device is managed by an enterprise. + + Returns: + True if the device is managed by an enterprise, False otherwise. + + Raises: + pyauto_errors.JSONInterfaceError if the automation call returns an error. + """ + cmd_dict = { + 'command': 'IsEnterpriseDevice', + } + result = self._GetResultFromJSONRequest(cmd_dict, windex=-1) + return result.get('enterprise') + + def FetchEnterprisePolicy(self): + """Fetch enterprise policy from server. + + Triggers a policy fetch and blocks until the policy is fetched or the fetch + fails. This is separate from any auto policy fetches the device may perform + on its own. + + Raises: + pyauto_errors.JSONInterfaceError if the fetch fails. + """ + cmd_dict = { + 'command': 'FetchEnterprisePolicy', + } + return self._GetResultFromJSONRequest(cmd_dict, windex=-1) + def GetUpdateInfo(self): """Gets the status of the ChromeOS updater. |